aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/thread_info.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2013-09-11 06:43:13 -0400
committerIngo Molnar <mingo@kernel.org>2013-09-25 07:53:10 -0400
commitea8117478918a4734586d35ff530721b682425be (patch)
treeccbaaa51ffd91f34fc0a4f5c5dbad34452ddc354 /include/linux/thread_info.h
parent3150398626466c6cc626732f60bc901d58f40677 (diff)
sched, idle: Fix the idle polling state logic
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>
Diffstat (limited to 'include/linux/thread_info.h')
-rw-r--r--include/linux/thread_info.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index a629e4b23217..fddbe2023a5d 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -118,6 +118,8 @@ static inline __deprecated void set_need_resched(void)
118 */ 118 */
119} 119}
120 120
121#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
122
121#if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK 123#if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK
122/* 124/*
123 * An arch can define its own version of set_restore_sigmask() to get the 125 * An arch can define its own version of set_restore_sigmask() to get the