summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-06-07 09:25:03 (GMT)
committerScott Wood <scottwood@freescale.com>2014-05-14 18:38:12 (GMT)
commitf15a3389156d2edf1fc8427ef6cef53212b15e9e (patch)
tree24f9d1c24019c78fd6fbbf5764852d32e259590d
parentec1b84de36897c03c3b471ff2da289285a4a24af (diff)
downloadlinux-fsl-qoriq-f15a3389156d2edf1fc8427ef6cef53212b15e9e.tar.xz
sched-cond-resched.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/sched/core.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 34247ee..d9e3b58 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3903,9 +3903,17 @@ static inline int should_resched(void)
static void __cond_resched(void)
{
- add_preempt_count(PREEMPT_ACTIVE);
- __schedule();
- sub_preempt_count(PREEMPT_ACTIVE);
+ do {
+ add_preempt_count(PREEMPT_ACTIVE);
+ __schedule();
+ sub_preempt_count(PREEMPT_ACTIVE);
+ /*
+ * Check again in case we missed a preemption
+ * opportunity between schedule and now.
+ */
+ barrier();
+
+ } while (need_resched());
}
int __sched _cond_resched(void)