]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.fixes/bug-437171_1_sched_clock_lock.patch
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / bug-437171_1_sched_clock_lock.patch
diff --git a/src/patches/suse-2.6.27.31/patches.fixes/bug-437171_1_sched_clock_lock.patch b/src/patches/suse-2.6.27.31/patches.fixes/bug-437171_1_sched_clock_lock.patch
new file mode 100644 (file)
index 0000000..f96bbdb
--- /dev/null
@@ -0,0 +1,35 @@
+Subject: sched: only update rq->clock while holding rq->lock
+From: Peter Zijlstra <a.p.zijlstra@chello.nl>
+References: 437171 - LTC47404
+
+Vatsa noticed rq->clock going funny and tracked it down to an update_rq_clock()
+outside a rq->lock section.
+
+This is a problem because things like double_rq_lock() update the rq->clock
+value for both rqs. Therefore disabling interrupts isn't strong enough.
+
+Reported-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
+Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Olaf Hering <olh@suse.de>
+
+---
+ kernel/sched.c |    5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+--- a/kernel/sched.c
++++ b/kernel/sched.c
+@@ -4449,12 +4449,9 @@ need_resched_nonpreemptible:
+       if (sched_feat(HRTICK))
+               hrtick_clear(rq);
+-      /*
+-       * Do the rq-clock update outside the rq lock:
+-       */
+       local_irq_disable();
+-      update_rq_clock(rq);
+       spin_lock(&rq->lock);
++      update_rq_clock(rq);
+       clear_tsk_need_resched(prev);
+       if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {