x86_64: Implement idle mwait hint auto tuning
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 2 Feb 2014 13:48:19 +0000 (21:48 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 2 Feb 2014 14:00:32 +0000 (22:00 +0800)
commit1786faf9e0837dd7ac069226d45053086253153b
treefef56cf91e041cc1a8144e77b2598f62cd19d832
parentf23178a0e264f3152d1dfbd984cfdc82f996fb14
x86_64: Implement idle mwait hint auto tuning

The tuning is based on gd_idle_repeat.  The higher the gd_idle_repeat,
the deeper cpu specific C-state the current CPU will enter.

The idle mwait hint auto tuning could be enabled by setting sysctl
machdep.mwait.CX.idle to "AUTO" or "AUTODEEP":
"AUTO"     -- C0 ~ C2
"AUTODEEP" -- C0 ~ deepest cpu specific C-state

This will allow us to enter deepest cpu specific C-state, even if ACPI
does not map its deepest C-State to the deepest cpu specific C-state.

NOTE:
AUTODEEP and C3+ cpu specific C-state is not bullet prove yet.  We need
to get the bus master operations information from ACPI.
sys/platform/pc64/x86_64/machdep.c