x86, acpi, idle: Restructure the mwait idle routines

People seem to delight in writing wrong and broken mwait idle routines;
collapse the lot.

This leaves mwait_play_dead() the sole remaining user of __mwait() and
new __mwait() users are probably doing it wrong.

Also remove __sti_mwait() as its unused.

Cc: Arjan van de Ven <[email protected]>
Cc: Jacob Jun Pan <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Rui Zhang <[email protected]>
Acked-by: Rafael Wysocki <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: H. Peter Anvin <[email protected]>
This commit is contained in:
Peter Zijlstra 2013-12-12 15:08:36 +01:00 • committed by H. Peter Anvin
commit 1682425539
7 changed files with 43 additions and 78 deletions

View file

@ -438,9 +438,7 @@ static int clamp_thread(void *arg)
*/
local_touch_nmi();
stop_critical_timings();
__monitor((void *)&current_thread_info()->flags, 0, 0);
cpu_relax(); /* allow HT sibling to run */
__mwait(eax, ecx);
mwait_idle_with_hints(eax, ecx);
start_critical_timings();
atomic_inc(&idle_wakeup_counter);
}