1 Subject: sched: only update rq->clock while holding rq->lock
2 From: Peter Zijlstra <a.p.zijlstra@chello.nl>
3 References: 437171 - LTC47404
5 Vatsa noticed rq->clock going funny and tracked it down to an update_rq_clock()
6 outside a rq->lock section.
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.
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>
17 kernel/sched.c | 5 +----
18 1 file changed, 1 insertion(+), 4 deletions(-)
22 @@ -4449,12 +4449,9 @@ need_resched_nonpreemptible:
23 if (sched_feat(HRTICK))
27 - * Do the rq-clock update outside the rq lock:
30 - update_rq_clock(rq);
32 + update_rq_clock(rq);
33 clear_tsk_need_resched(prev);
35 if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {