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
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