[kernel/f14/master] Fix possible lockup with new scheduler idle balance code.

Chuck Ebbert cebbert at fedoraproject.org
Wed Sep 22 12:41:20 UTC 2010


commit 69a476baa962effbf7baaeef54cbc867e89a9f28
Author: Chuck Ebbert <cebbert at redhat.com>
Date:   Wed Sep 22 08:40:20 2010 -0400

    Fix possible lockup with new scheduler idle balance code.

 kernel.spec                                |    5 +++
 sched-30-sched-fix-nohz-balance-kick.patch |   39 ++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 8c8d920..f14fb24 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -748,6 +748,7 @@ Patch12570: sched-10-change-nohz-idle-load-balancing-logic-to-push-model.patch
 Patch12575: sched-15-update-rq-clock-for-nohz-balanced-cpus.patch
 Patch12580: sched-20-fix-rq-clock-synchronization-when-migrating-tasks.patch
 Patch12585: sched-25-move-sched_avg_update-to-update_cpu_load.patch
+Patch12590: sched-30-sched-fix-nohz-balance-kick.patch
 
 Patch13600: btusb-macbookpro-6-2.patch
 Patch13601: btusb-macbookpro-7-1.patch
@@ -1388,6 +1389,7 @@ ApplyPatch sched-10-change-nohz-idle-load-balancing-logic-to-push-model.patch
 ApplyPatch sched-15-update-rq-clock-for-nohz-balanced-cpus.patch
 ApplyPatch sched-20-fix-rq-clock-synchronization-when-migrating-tasks.patch
 ApplyPatch sched-25-move-sched_avg_update-to-update_cpu_load.patch
+ApplyPatch sched-30-sched-fix-nohz-balance-kick.patch
 
 ApplyPatch btusb-macbookpro-7-1.patch
 ApplyPatch btusb-macbookpro-6-2.patch
@@ -1978,6 +1980,9 @@ fi
 # and build.
 
 %changelog
+* Wed Sep 22 2010 Chuck Ebbert <cebbert at redhat.com>
+- Fix possible lockup with new scheduler idle balance code.
+
 * Tue Sep 21 2010 Kyle McMartin <kyle at redhat.com>
 - Add new btusb ids for MacBookPro from wwoods at .
 
diff --git a/sched-30-sched-fix-nohz-balance-kick.patch b/sched-30-sched-fix-nohz-balance-kick.patch
new file mode 100644
index 0000000..debad52
--- /dev/null
+++ b/sched-30-sched-fix-nohz-balance-kick.patch
@@ -0,0 +1,39 @@
+From: Suresh Siddha <suresh.b.siddha at intel.com>
+Date: Mon, 13 Sep 2010 18:02:21 +0000 (-0700)
+Subject: sched: Fix nohz balance kick
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=f6c3f1686e7ec1dd8725a9a3dcb857dfd0c7a5bf
+
+sched: Fix nohz balance kick
+
+There's a situation where the nohz balancer will try to wake itself:
+
+cpu-x is idle which is also ilb_cpu
+got a scheduler tick during idle
+and the nohz_kick_needed() in trigger_load_balance() checks for
+rq_x->nr_running which might not be zero (because of someone waking a
+task on this rq etc) and this leads to the situation of the cpu-x
+sending a kick to itself.
+
+And this can cause a lockup.
+
+Avoid this by not marking ourself eligible for kicking.
+
+Signed-off-by: Suresh Siddha <suresh.b.siddha at intel.com>
+Signed-off-by: Peter Zijlstra <a.p.zijlstra at chello.nl>
+LKML-Reference: <1284400941.2684.19.camel at sbsiddha-MOBL3.sc.intel.com>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+---
+
+diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
+index a171138..db3f674 100644
+--- a/kernel/sched_fair.c
++++ b/kernel/sched_fair.c
+@@ -3630,7 +3630,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
+ 	if (time_before(now, nohz.next_balance))
+ 		return 0;
+ 
+-	if (!rq->nr_running)
++	if (rq->idle_at_tick)
+ 		return 0;
+ 
+ 	first_pick_cpu = atomic_read(&nohz.first_pick_cpu);


More information about the scm-commits mailing list