default HZ value in 5.2.1
Chuck Swiger
cswiger at mac.com
Fri Jul 9 10:24:22 PDT 2004
Poul-Henning Kamp wrote:
[ ... ]
> Most of my systems run with HZ=1000 already, but that is hardly
> ground for changes to the default. What we need is some pro et
> contra arguments, including benchmarks.
You're right. Back around 1990, Avie Tenavian spent some brainpower figuring
out the preemptive scheduling overhead for Mach, and determined that a 25MHz
68040 machine took up to about 0.5 ms to handle a timer interrupt and run
through the scheduler, which meant that the system lost about 5% overhead when
using a 10ms scheduler quantum (or HZ=100, whatever).
While I think have some idea as to the time it takes a Pentium to do a context
switch (300 clocks?), I don't know enough about the way the clock timer is
managed under FreeBSD, nor do I know how much other stuff is glommed onto the
periodic timer interrupt. Mach used kernel threads and a messaging paradigm
from day one, so it's scheduler was fairly simple-- less worrying about a
queue of pending callbacks along the lines of libevent and kqueue.
Anyway, I suspect that the default scheduler quantum might be better chosen
based on the scheduling overhead of each machine: set HZ as fast as the local
system will deal with without exceeding a single-digit percent overhead...
--
-Chuck
More information about the freebsd-current
mailing list