2012-06-26 06:28:34 +00:00
|
|
|
From 1aa975279d4a5596e082534477783a3961a32c62 Mon Sep 17 00:00:00 2001
|
2011-11-20 00:01:55 +00:00
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
2012-06-17 19:52:06 +00:00
|
|
|
Date: Tue, 7 Jun 2011 11:25:03 +0200
|
2012-06-26 06:28:34 +00:00
|
|
|
Subject: [129/256] sched-cond-resched.patch
|
2011-11-20 00:01:55 +00:00
|
|
|
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
---
|
2012-06-04 21:20:09 +00:00
|
|
|
kernel/sched/core.c | 14 +++++++++++---
|
2011-11-20 00:01:55 +00:00
|
|
|
1 file changed, 11 insertions(+), 3 deletions(-)
|
|
|
|
|
2012-06-17 19:52:06 +00:00
|
|
|
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
2012-06-26 06:28:34 +00:00
|
|
|
index 7fd59a2..dbe9a7d 100644
|
2012-06-17 19:52:06 +00:00
|
|
|
--- a/kernel/sched/core.c
|
|
|
|
+++ b/kernel/sched/core.c
|
2012-06-04 21:20:09 +00:00
|
|
|
@@ -4554,9 +4554,17 @@ static inline int should_resched(void)
|
2011-11-20 00:01:55 +00:00
|
|
|
|
|
|
|
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)
|