summaryrefslogtreecommitdiff
path: root/drivers/idle
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2013-09-11 10:43:13 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-29 19:27:55 (GMT)
commitfc97fc29e0a2942e6fe72963cff235a932b91be9 (patch)
tree01c10a1f65fab00de7d11e74a9555ddf1a6275b3 /drivers/idle
parent19dbd3f28ce670a6b016c595e29626d1533bba39 (diff)
downloadlinux-fsl-qoriq-fc97fc29e0a2942e6fe72963cff235a932b91be9.tar.xz
sched, idle: Fix the idle polling state logic
commit ea8117478918a4734586d35ff530721b682425be upstream. Mike reported that commit 7d1a9417 ("x86: Use generic idle loop") regressed several workloads and caused excessive reschedule interrupts. The patch in question failed to notice that the x86 code had an inverted sense of the polling state versus the new generic code (x86: default polling, generic: default !polling). Fix the two prominent x86 mwait based idle drivers and introduce a few new generic polling helpers (fixing the wrong smp_mb__after_clear_bit usage). Also switch the idle routines to using tif_need_resched() which is an immediate TIF_NEED_RESCHED test as opposed to need_resched which will end up being slightly different. Reported-by: Mike Galbraith <bitbucket@online.de> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: lenb@kernel.org Cc: tglx@linutronix.de Link: http://lkml.kernel.org/n/tip-nc03imb0etuefmzybzj7sprf@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/idle')
-rw-r--r--drivers/idle/intel_idle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index fa6964d..f116d66 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -359,7 +359,7 @@ static int intel_idle(struct cpuidle_device *dev,
if (!(lapic_timer_reliable_states & (1 << (cstate))))
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
- if (!need_resched()) {
+ if (!current_set_polling_and_test()) {
__monitor((void *)&current_thread_info()->flags, 0, 0);
smp_mb();