diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-06-07 09:25:03 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-10 00:19:10 (GMT) |
commit | 8a1275be207e70273c6170b24be2f553add716b4 (patch) | |
tree | 974e94dacdb1f75dc5f36ec7d50f0dd9bb812f98 | |
parent | e189367f6b74bfe4d0c88cf1f19054fda795e540 (diff) | |
download | linux-fsl-qoriq-8a1275be207e70273c6170b24be2f553add716b4.tar.xz |
sched-cond-resched.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | kernel/sched/core.c | 14 |
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) |