polling(4) and idle time/cpu usage percentages

Bruce Evans bde at zeta.org.au
Sun May 11 02:52:30 PDT 2003


On Sat, 10 May 2003, Don Bowman wrote:

[accounting for the details of idle time]

> > 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.

Did you try my hack?

> Does the machdep.cpu_idle_hlt=1 have any affect on this?

No.  However, counting the halted time separately would give another
indication of fully idle time (if this sysctl variable is set).  On
waking up from the halted state, the CPU has to check if there is
something to run.  This can be considered as useful work and counted
as system time.  However, if we don't halt then we have to mostly
just spin doing the check, and this must be considered as unuseful work.

> 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.

I don't quite believe that it could have 88.4% fully idle.

Bruce


More information about the freebsd-net mailing list