Date: Mon, 5 Dec 2005 09:42:08 +0100 (CET) From: kama <kama@pvp.se> To: Peter Jeremy <PeterJeremy@optushome.com.au> Cc: freebsd-stable@freebsd.org Subject: Re: cpu-timer rate Message-ID: <20051205093804.D5758@ns1.as.pvp.se> In-Reply-To: <20051202190242.GL32006@cirb503493.alcatel.com.au> References: <20051202142731.H92866@ns1.as.pvp.se> <20051202190242.GL32006@cirb503493.alcatel.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 3 Dec 2005, Peter Jeremy wrote: > 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. Ehm, Im sorry, but did that even answer my question? 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. /Bjorn
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051205093804.D5758>