Re: HZ, preferably as small as possible

From: Martin Dalecki (dalecki@evision-ventures.com)
Date: Thu Jul 11 2002 - 12:08:11 EST


Użytkownik Jeff Garzik napisał:
> Grover, Andrew wrote:
>
>> So, a changing tick *can* be done. If Linux does the same thing, seems
>> like
>> everyone is happy. What are the obstacles to this for Linux? If code is
>> based on the assumption of a constant timer tick, I humbly assert that
>> the
>> code is broken.
>
>
> Unfortunately code in Linux has traditionally compiled in a constant HZ
> all over the place, and jiffies instead of real time units are at the
> heart of all Linux timer-related activities.
>
> I don't see that making 'HZ' a variable is really an option, because
> many drivers and scheduler-related code will be wildly inaccurate as
> soon as HZ actually changes values.
>
> So that leaves us with the option of changing all the code related to
> waiting to be based on msecs and usecs. Which I would love to do, but
> that's a lot of work, both code- and audit-wise.

vmstat.c:

hz = sysconf(_SC_CLK_TCK); /* get ticks/s from system */

And yes I know the libproc is *evil* in this area.
The rest should be an implementation detail of sysconf().
Changing this value during the runtime of vmstat is interresting story
anyway, but it should be up to the sysadmin to do this kind
of stuff only at runtlevel 1.
sysconf can be indeed imeplemented as a single global
file containing configuration data. But sysctl is another story
of course.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:20 EST