Re: [patch] jiffies wraparound [Re: 2.1.125 Show stopper list: Draft]

Mitchell Blank Jr (mitch@execpc.com)
Fri, 23 Oct 1998 01:16:17 -0500


Albert D. Cahalan wrote:
> > Especially as the only thing that knows about HZ is "clock_t", and if I
> > remember correctly the _only_ system call that actually returns a clock_t
> > is "clock()".
>
> There is a sys_times(), which can become sys_oldtimes() if needed.

clock() is a wrapper around times(). It's defined to report times in
microseconds. It's not the real issue.

Any standards-compliant program that reads data out of times() directly
should always be scaling it by CLK_TCK. CLK_TCK is hardcoded to be
100 under linux/i386, but it could just as easily expand to
sysconf(_SC_CLK_TCK). Then any program compiled against the new
header files can cope with any reasonable HZ value. See solaris's
/usr/include/limits.h for an example.

Yes, old binaries would still be confused by the result of times(), but
hopefully they would have died out long before any change in HZ happens.
Most binaries don't use sys_times anyway.

This would all be possible now except that sysconf(_SC_CLK_TCK) is a
compiled-in constant in libc, which illistrates the problem.

This is my last message on the subject. Linus is obviously very attached
to doing it the current way. I'm not going to waste more of his valuable
time trying to convince him to do it right.

-Mitch

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