xfs
[Top] [All Lists]

Re: [patch 1/1] Make XFS sysctl parameters use USER_HZ instead of HZ.

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [patch 1/1] Make XFS sysctl parameters use USER_HZ instead of HZ.
From: Bart Samwel <bart@xxxxxxxxx>
Date: Mon, 05 Apr 2004 10:33:47 +0200
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20040405083839.A2647@xxxxxxxxxxxxx>
References: <E1B9j4r-00081Q-DD@xxxxxxxxx> <20040405083839.A2647@xxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

Christoph Hellwig wrote:

> On Sat, Apr 03, 2004 at 01:12:40PM +0200, bart@xxxxxxxxx wrote:
> 
>>From: Bart Samwel <bart@xxxxxxxxx>
>>
>>The sysctl parameters sync_interval, flush_interval and age_buffer are
>>in units of jiffies, which are very variable between kernels and
>>architectures. These parameters should use USER_HZ, which is meant for
>>use in external interfaces.
>>
>>Rationale: If there is no interface with a reliable unit, the laptop mode
>>control script can never work reliably, because it then needs to know the
>>value of HZ, which is intentionally not exported from the kernel anywhere.
>>
>>Possible improvement (matter of taste): renaming the variables, so that
>>old code knows that the new variables are in new units. I suggest to not
>>do this, because the variables previously didn't have any usable unit
>>anyway. Any code that was written against this interface had to assume
>>some HZ and would _have_ to have known that it would break with _any_ 
>>change in HZ.
> 
> 
> I think this is problematic because schedule_timeout() expects these in
> units of HZ.  So you need to re-unit them somewhere in the sysctl handler,
> IIRC the networking folks even added special sysctl handlers that do it
> automatically.

The reunit code is there, e.g., for the sync interval there is:

-#define xfs_syncd_interval     xfs_params.sync_interval.val
+#define xfs_syncd_interval     (xfs_params.sync_interval.val * HZ / USER_HZ)

So the xfs_params.XXX values are in USER_HZ, but the xfs_XXX values are
in HZ.

--Bart



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