kernel - Add hw.cpu_mwait_haltand hw.cpu_mwait_spin
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 31 Jul 2013 23:34:28 +0000 (16:34 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 31 Jul 2013 23:34:28 +0000 (16:34 -0700)
commita46b4a23d8980802ae39fb00397b19320968c4d6
treeeb46ce71fa26847764f1a5c931b7a99633ac348f
parent39a1ee098a93d3f7b3a91dd03acf16a1883393d5
kernel - Add hw.cpu_mwait_haltand hw.cpu_mwait_spin

* Add globals with machine-specific meanings.  This allows us to operate
  with MONITOR/MWAIT and gain the same power savings that we get with
  ACPI halt mode when idle.  Waiting on a follow-up commit to set the
  the defaults.

* For example, if we sysctl hw.cpu_mwait_halt=0x44 hw.cpu_mwait_spin=0x11
  (and leaving machdep.cpu_idle_hlt=2) on a haswell cpu it will shave the
  idle power down by another 5W, from 25W to 20W on an idle Haswell Xeon
  3.4 GHz server chip without impacting wakeup performance too badly.
sys/cpu/i386/misc/monitor.s
sys/cpu/x86_64/misc/monitor.s
sys/kern/lwkt_thread.c
sys/platform/pc32/i386/machdep.c
sys/platform/pc64/x86_64/machdep.c
sys/sys/systm.h