xfs
[Top] [All Lists]

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

To: Nathan Scott <nathans@xxxxxxx>
Subject: Re: [patch 1/1] Update laptop mode control script with XFS_HZ=100
From: Andrew Morton <akpm@xxxxxxxx>
Date: Tue, 11 May 2004 16:17:56 -0700
Cc: bart@xxxxxxxxx, linux-xfs@xxxxxxxxxxx
In-reply-to: <20040512090006.B362314@xxxxxxxxxxxxxxxxxxxxxxxx>
References: <E1BNdCk-0008BN-TJ@xxxxxxxxx> <20040511154057.6d6c193b.akpm@xxxxxxxx> <20040512090006.B362314@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
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.

In page-writeback.c I didn't bother converting the numbers - just do the
math each time we use the number because these are very low-frequency
callpaths.


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