High-resolution user/system times?

High-resolution user/system times?

Nadav Har'El nyh at math.technion.ac.il
Wed Jul 25 15:44:45 IDT 2012


On Wed, Jul 25, 2012, Oleg Goldshmidt wrote about "Re: High-resolution user/system times?":
> Actually, there is the default HZ and inside the kernel HZ there is HZ that
> you can configure at compile time (with CONFIG_HZ) and USER_HZ, which, I
> think, is still 100 whether or not the kernel's HZ is customized. I think
> USER_HZ is what is important for "soft timers" you are interested in.

USER_HZ is just used to fake the reports to user-space, pretending the
resolution is of USER_HZ. The actual measured resolution is of
CONFIG_HZ.

> I am used to RedHat systems whose kernels normally come with HZ=100. You
> are talking about a server as well, right? You may be right about HZ=250 by
> default in the vanilla kernel that is supposed to be a compromise between
> 100 and 1000.

Like both you and I already said, the CONFIG_HZ setting is completely
arbitrary, but it's compiled into the kernel and cannot be changed in
the kernel. I just checked and in Ubuntu 12.04 the distro set it to 250 Hz,
as I remembered. But on Fedora 17, it is set to 1000 Hz.

But I noticed another thing which complicates things further - both
distros seem to enable CONFIG_NO_HZ=y, which means we shoudln't actually
have timer interrupts at regular intervals - not 250 Hz and not 1000 Hz.
In that case, I'm not even sure how times() works, and what resolution
it really has, in this case, and if the number "250" and "1000" have any
effect on this resolution...

-- 
Nadav Har'El                        |        Wednesday, Jul 25 2012, 6 Av 5772
nyh at math.technion.ac.il             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |The knowledge that you are an idiot, is
http://nadav.harel.org.il           |what distinguishes you from one.



More information about the Linux-il mailing list