2012-12-14 01:14:08 +00:00
|
|
|
From dddd928d9cf46a871272555aa8e31d29da24deff Mon Sep 17 00:00:00 2001
|
2011-11-20 00:01:55 +00:00
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
2012-05-12 14:20:55 +00:00
|
|
|
Date: Tue, 7 Jun 2011 11:25:03 +0200
|
2012-12-09 22:00:02 +00:00
|
|
|
Subject: [PATCH 149/290] sched-cond-resched.patch
|
2011-11-20 00:01:55 +00:00
|
|
|
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
---
|
|
|
|
kernel/sched.c | 14 +++++++++++---
|
|
|
|
1 file changed, 11 insertions(+), 3 deletions(-)
|
|
|
|
|
2012-05-12 14:20:55 +00:00
|
|
|
diff --git a/kernel/sched.c b/kernel/sched.c
|
2012-10-20 06:00:02 +00:00
|
|
|
index afc9d85..eb84999 100644
|
2012-05-12 14:20:55 +00:00
|
|
|
--- a/kernel/sched.c
|
|
|
|
+++ b/kernel/sched.c
|
2012-10-10 05:15:23 +00:00
|
|
|
@@ -5967,9 +5967,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)
|