On Mon, 2005-Dec-05 10:15:52 -0800, Kevin Oberman wrote: >> On Mon, Dec 05, 2005 at 09:42:08AM +0100 I heard the voice of >> kama, and lo! it spake thus: >> > >> > I appreciate that you took time to answer about the different >> > clocks. But that does not answer why vmstat -i shows a rate of 2000 >> > when I have set the hz to 1000. >> >> Because the rate is always twice hz. > >While I will concede that I have no explanation, but on all of my systems >rate = HZ +/-1. I have never seen a case where rate/2 = HZ.
Basically, it depends on what clock(s) your kernel is using. Traditionally, FreeBSD/i386 uses the one of the i8254 counters to generate hz (on irq0) and the RTC to generate profhz/stathz (on irq8). In this case, the rate on those interrupts should match the values reported by kern.clockrate. On SMP machines, this approach is fairly expensive because the interrupts need to be forwarded to all CPUs using IPIs. In early February, jhb implemented an alternative approach using the local APIC clock (sys/i386/i386/local_apic.c v1.13 and other files). Since every CPU has a LAPIC, every CPU gets its own clock interrupts without needing IPIs. The downside is that there's only a single LAPIC so a single hardware clock interrupt needs to generate separate (and independent) hz/tick and stathz/profhz clocks. Since the clocks need to be independent (to make process statistics meaningful), this implies that the hardware (LAPIC) clock (cpu0) needs to be faster than hz. The original commit ran LAPIC at hz*3 but this was later changed to hz*2 to reduce overheads. -- Peter Jeremy _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "[EMAIL PROTECTED]"