On Tue, Mar 23, 2004 at 10:04:22AM +1100, Peter Williams wrote:> Micha Feigin wrote:> >On Sat, Mar 20, 2004 at 12:28:00PM +0100, Stefan Smietanowski wrote:> >> >>>>>there is one. Nothing uses it> >>>>>(sysconf() provides this info)> >>>>> >>>>Seems to me that it would be fairly trivial to modify those programs > >>>>(that should use this mechanism but don't) to use it? So why should > >>>>they be allowed to dictate kernel behaviour?> >>>> >>>> >>>quality of implementation; for example shell scripts that want to do> >>>echo 500 > /proc/sys/foo/bar/something_in_HZ> >>>...> >>>or /etc/sysctl.conf or ...> >>>> >>> >>Then write a simple program already. How hard is it to write a program> >>that does a sysconf() and returns (as ascii of course) just the> >>value of HZ? Then do some trivial calculation off of that.> >>> >>HZ=$(gethz)> >>> >>If your 500 was 5 seconds, do> >>> >>TIME=$[HZ*5]> >>echo $TIME > /proc/sys/foo/bar/something_in_HZ> >>> >> >> >Will this be USER_HZ or kernel HZ?> >Someone earlier suggested it would be USER_HZ which would make it> >pointless.> > It has to be whatever enables user space to correctly interpret values > sent to user space as "ticks". That means USER_HZ and it's not useless > as it enables USER_HZ to be different and/or change without breaking > programs that use values expressed in "ticks".>

Unless the kernel is converted to make that conversion possible then itis useless at the moment since userspace gets USER_HZ and the kernelproc interface speaks (KERNEL) HZ so userspace really has no idea howto speak to kernel space with 2.6.