High-resolution user/system times?

High-resolution user/system times?

Oleg Goldshmidt pub at goldshmidt.org
Wed Jul 25 15:28:52 IDT 2012


On Wed, Jul 25, 2012 at 2:29 PM, Nadav Har'El <nyh at math.technion.ac.il>wrote:

>
> HZ used to default to 100 in the Linux kernel, but now it actually
> defaults (unless I'm mis-remembering) to 250, and this is where the 4-ms
> resolution came from.


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.

Unless you configure the kernel yourself, the HZ value the kernel comes
with probably depends on the distro. The tradeoff is as follows: desktop
systems benefit from a higher HZ value because interactive processes are
latency-sensitive. Servers, especially NUMA systems, don't have interactive
processes and may, on the other hand, experience a lot of unpleasant
effects (bus contention as an example) if there are lots of interrupts.
Also note that the interrupt rate will be HZ*#CPUs.

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.

If you go back to, say, 2.6.11 or 2.6.12, then you'll see HZ=1000 by
default, I think. Was that "Linux on a desktop"? ;-)


-- 
Oleg Goldshmidt | oleg at goldshmidt.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20120725/eb605516/attachment.html>


More information about the Linux-il mailing list