Hi, I am just wondering why the cpu-timer is doubled from what I set in kern.hz? # vmstat -i interrupt total rate irq1: atkbd0 4 0 irq6: fdc0 87 0 irq13: npx0 1 0 irq14: ata0 46 0 irq29: bge0 154553 21 irq30: ciss0 282200 39 cpu0: timer 14314031 1999 Total 14750922 2060 # sysctl -a | grep hz kern.clockrate: { hz = 1000, tick = 1000, profhz = 666, stathz = 133 } /Bjorn
On Fri, 2005-Dec-02 14:32:58 +0100, kama wrote:>I am just wondering why the cpu-timer is doubled from what I set in >kern.hz? > ># vmstat -i >interrupt total rate...>cpu0: timer 14314031 1999 >Total 14750922 2060 > ># sysctl -a | grep hz >kern.clockrate: { hz = 1000, tick = 1000, profhz = 666, stathz = 133 }There's only a single timer but FreeBSD needs two independent clocks. The 'tick' clock is used to update the TOD counters and decide when to reschedule processes. The 'stathz' is used to collect statistics on CPU utilisation ('profhz' is used instead if any process is using profiling). Since processes tend to synchronize to 'tick' the statistics clock needs to be independent to ensure that a CPU utilisation is correctly allocated. In order to simulate two clocks, FreeBSD runs the hardware clock at a high rate and uses two different divisors for the soft clocks (/2 for tick, /3 for profhz and /15 for stathz). Larger divisors are better for utilisation statistics but increase clock interrupt overheads. -- Peter Jeremy
> Date: Mon, 5 Dec 2005 06:49:10 -0600 > From: "Matthew D. Fuller" <fullermd@over-yonder.net> > Sender: owner-freebsd-stable@freebsd.org > > 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. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634
On Friday, 2 December 2005 at 14:32:58 +0100, kama wrote:> > Hi, > > I am just wondering why the cpu-timer is doubled from what I set in > kern.hz? > > # vmstat -i > ... > cpu0: timer 14314031 1999 > > # sysctl -a | grep hz > kern.clockrate: { hz = 1000, tick = 1000, profhz = 666, stathz = 133 }Interesting question. So far I haven't seen an answer that comes close to explaining it. My guess is that it's because of the specific timer you're using; which is it? Is there anything else of interest in your setup? FWIW, I get (without ACPI) on two different machines essentially the same: $ vmstat -i interrupt total rate irq0: clk 55250411 1000 irq1: atkbd0 47365 0 irq5: ohci1 97516 1 irq8: rtc 7069645 127 irq10: ehci0 1 0 irq11: nve0 xl0+ 1022991 18 irq14: ata0 425652 7 irq15: ata1 4777 0 Total 63918358 1157 $ sysctl -a | grep hz kern.clockrate: { hz = 1000, tick = 1000, profhz = 1024, stathz = 128 } debug.psm.hz: 20 Greg -- See complete headers for address and phone numbers. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20051207/3aa87c9e/attachment.bin
On Wed, Dec 07, 2005 at 04:23:04PM -0800, Ed wrote:> My apologies, I did not understand this specific meaning of "core team" > when I wrote that. > > What term should I use in the future, when discussing problems of this > nature? "FreeBSD kernel developers," or some such?"FreeBSD developers" is fine. Kris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20051207/6caf8bad/attachment.bin