Detangle lwkt_switch() and the idle thread and consolidate sleep variables

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Sun Sep 2 17:02:00 PDT 2007


Simon 'corecode' Schubert wrote:
Using it for spinlocks is rather easy, because there is just one 
variable to monitor.
Just as a data point:

checking sysctl every second, I get about:
5-10 spinlock_contested1
0 spinlock_contested2
30000-200000 cpu_idle_spincnt
1400 cpu_idle_hltcnt
this is on an idle system, except for the statistics gathering.  without 
statistics, I get even less contested spinlocks.

So spinlocks basically do not contribute to wasted cpu time.  A bigger 
offender is the idle spin, but that's also not sooo much.  Still 
something that could be optimized.

I'll see if I can import the latest ACPI from freebsd, they have some 
nice changes for the apci idle hook, which hopefully will make my laptop 
run cooler (maybe I should simply boot freebsd to check).

cheers
  simon




More information about the Kernel mailing list