Re: finding out the value of HZ from userspace

From: Andrew Morton
Date: Sat Mar 13 2004 - 20:51:28 EST

Micha Feigin <michf@xxxxxxxxxxxxxx> wrote:
> > Wrong. Any such interface is supposed to convert automatically. Any
> > interface you can find that doesn't should be reported as a serious bug!
> >
> Like I said, look at bdflush in 2.4 (this was fixed with the changed 2.6
> interface) and xfs proc interface in both 2.4 and 2.6.
> In light of your post then there is a serious bug.
> For example for bdflush age_buffer field (true for the other used fields
> also), no conversion:
> bh->b_flushtime = jiffies + bdf_prm.b_un.age_buffer;

I doubt if there's any motivation to fix these things in 2.4. If you change
HZ in 2.4 you own both pieces. (alpha has HZ=1024 in 2.4, so presumably
bdflush tuning doesn't work right).

In 2.6, the bdflush parameters do not exist. They were replaced by
/proc/sys/vm/*_centisecs, which are HZ-independent.

There are, I think, still some /proc tunables in 2.6 which do depend upon
HZ and they should be found and fixed. If the same tunables are present in
2.4 kernels then they should be converted to take centiseconds in 2.6, so
2.4-based tools continue to work correctly.

We have similar problems where /proc tunables are expressed in terms of
"number of pages". As PAGE_SIZE varies from 4096 to 65536 this is
sometimes wrong. Fixing this is more subtle.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at