]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/bug-437171_1_sched_clock_lock.patch
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / bug-437171_1_sched_clock_lock.patch
CommitLineData
2cb7cef9
BS
1Subject: sched: only update rq->clock while holding rq->lock
2From: Peter Zijlstra <a.p.zijlstra@chello.nl>
3References: 437171 - LTC47404
4
5Vatsa noticed rq->clock going funny and tracked it down to an update_rq_clock()
6outside a rq->lock section.
7
8This is a problem because things like double_rq_lock() update the rq->clock
9value for both rqs. Therefore disabling interrupts isn't strong enough.
10
11Reported-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
12Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
13Signed-off-by: Ingo Molnar <mingo@elte.hu>
14Signed-off-by: Olaf Hering <olh@suse.de>
15
16---
17 kernel/sched.c | 5 +----
18 1 file changed, 1 insertion(+), 4 deletions(-)
19
20--- a/kernel/sched.c
21+++ b/kernel/sched.c
22@@ -4449,12 +4449,9 @@ need_resched_nonpreemptible:
23 if (sched_feat(HRTICK))
24 hrtick_clear(rq);
25
26- /*
27- * Do the rq-clock update outside the rq lock:
28- */
29 local_irq_disable();
30- update_rq_clock(rq);
31 spin_lock(&rq->lock);
32+ update_rq_clock(rq);
33 clear_tsk_need_resched(prev);
34
35 if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {