]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | Subject: sched: only update rq->clock while holding rq->lock |
2 | From: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
3 | References: 437171 - LTC47404 | |
4 | ||
5 | Vatsa noticed rq->clock going funny and tracked it down to an update_rq_clock() | |
6 | outside a rq->lock section. | |
7 | ||
8 | This is a problem because things like double_rq_lock() update the rq->clock | |
9 | value for both rqs. Therefore disabling interrupts isn't strong enough. | |
10 | ||
11 | Reported-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> | |
12 | Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
13 | Signed-off-by: Ingo Molnar <mingo@elte.hu> | |
14 | Signed-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)) { |