xfs
[Top] [All Lists]

Re: [patch 1/1] Update laptop mode control script with XFS_HZ=100

To: Andrew Morton <akpm@xxxxxxxx>
Subject: Re: [patch 1/1] Update laptop mode control script with XFS_HZ=100
From: Bart Samwel <bart@xxxxxxxxx>
Date: Wed, 12 May 2004 09:54:44 +0200
Cc: Nathan Scott <nathans@xxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <20040511161756.189308e6.akpm@osdl.org>
References: <E1BNdCk-0008BN-TJ@samwel.tk> <20040511154057.6d6c193b.akpm@osdl.org> <20040512090006.B362314@wobbly.melbourne.sgi.com> <20040511161756.189308e6.akpm@osdl.org>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113


Andrew Morton wrote:

Nathan Scott <nathans@xxxxxxx> wrote:

What's the right way to convert milli/centiseconds into jiffies for
subsequent use in time_before()/schedule_timeout()?


erm,

        millisecs = (jiffies * 1000) / HZ
        centisecs = (jiffies * 100) / HZ
        jiffies = (millisecs * HZ) / 1000
        jiffies = (centisecs * HZ) / 100

obviously one needs to watch out for overflows, but I think we can safely
assume the user is asking for less than 4 million seconds.

The XFS tunables are all guarded by max/min values, so this is guaranteed to not overflow.


--Bart


<Prev in Thread] Current Thread [Next in Thread>