diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index e1ba8cb24e4..30eb651d1fa 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -403,6 +403,14 @@ void default_idle(void) | |||
403 | EXPORT_SYMBOL(default_idle); | 403 | EXPORT_SYMBOL(default_idle); |
404 | #endif | 404 | #endif |
405 | 405 | ||
406 | bool set_pm_idle_to_default(void) | ||
407 | { | ||
408 | bool ret = !!pm_idle; | ||
409 | |||
410 | pm_idle = default_idle; | ||
411 | |||
412 | return ret; | ||
413 | } | ||
406 | void stop_this_cpu(void *dummy) | 414 | void stop_this_cpu(void *dummy) |
407 | { | 415 | { |
408 | local_irq_disable(); | 416 | local_irq_disable(); |
@@ -438,29 +446,6 @@ void cpu_idle_wait(void) | |||
438 | } | 446 | } |
439 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | 447 | EXPORT_SYMBOL_GPL(cpu_idle_wait); |
440 | 448 | ||
441 | /* | ||
442 | * This uses new MONITOR/MWAIT instructions on P4 processors with PNI, | ||
443 | * which can obviate IPI to trigger checking of need_resched. | ||
444 | * We execute MONITOR against need_resched and enter optimized wait state | ||
445 | * through MWAIT. Whenever someone changes need_resched, we would be woken | ||
446 | * up from MWAIT (without an IPI). | ||
447 | * | ||
448 | * New with Core Duo processors, MWAIT can take some hints based on CPU | ||
449 | * capability. | ||
450 | */ | ||
451 | void mwait_idle_with_hints(unsigned long ax, unsigned long cx) | ||
452 | { | ||
453 | if (!need_resched()) { | ||
454 | if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) | ||
455 | clflush((void *)¤t_thread_info()->flags); | ||
456 | |||
457 | __monitor((void *)¤t_thread_info()->flags, 0, 0); | ||
458 | smp_mb(); | ||
459 | if (!need_resched()) | ||
460 | __mwait(ax, cx); | ||
461 | } | ||
462 | } | ||
463 | |||
464 | /* Default MONITOR/MWAIT with no hints, used for default C1 state */ | 449 | /* Default MONITOR/MWAIT with no hints, used for default C1 state */ |
465 | static void mwait_idle(void) | 450 | static void mwait_idle(void) |
466 | { | 451 | { |