polling(4) and idle time/cpu usage percentages

Don Bowman don at sandvine.com
Sat May 10 16:52:34 PDT 2003


From: Bruce Evans [mailto:bde at zeta.org.au]
> On Sun, 4 May 2003, Kevin Day wrote:
> 
> > I've got a FreeBSD system acting as a router, it's passing 
> 250-600mbps of
> > traffic through it most of the time.
> >
> > Yesterday it was running 4.6-RELEASE without polling. I've 
> upgraded it to
> > 4.8 and enabled polling. Before it was showing 30-50% CPU 
> use in interrupt
> > and system combined. Now it's showing 0-1% (99% idle).
> >
> > Is this because it's polling in the idle loop, and time 
> spent doing this
> > isn't getting accounted for anywhere, or is polling THAT 
> much more efficient?
> >
> > If it's the former, is it supposed to work this way? Now 
> I've got no clear
> > way of knowing how busy the system is. (It's just routing 
> packets, really
> > nothing more)
> 
> The former.  It's hard for it to work better without wasting too many
> cycles for the accounting.  In RELENG_4, everything done in the "idle"
> loop is counted as idle time using the single counter 
> cp_time[CP_IDLE].
> This is very efficient.

I tried this on my system, but I still end up with 0 system time.
Does the machdep.cpu_idle_hlt=1 have any affect on this?

I'm passing 1Gbps each way through a bridge (e.g. 1Gbps in
and 1Gbps out each of 2 interfaces), and I have 88.4% idle.
This is admittedly on a pretty fast processor, a 2x2.8GHz XEON.



More information about the freebsd-net mailing list