diff options
author | Peter Zijlstra <peterz@infradead.org> | 2008-10-15 20:37:23 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-15 20:43:27 +0200 |
commit | 8cd162ce230b154e564a1285bb5f89fcf73f0dce (patch) | |
tree | aaace0250b44a77d71cd650edaa395d9b3f891e7 /kernel | |
parent | 5b16a2212f1840b63d6cc476b26ff9349dab185e (diff) | |
download | op-kernel-dev-8cd162ce230b154e564a1285bb5f89fcf73f0dce.zip op-kernel-dev-8cd162ce230b154e564a1285bb5f89fcf73f0dce.tar.gz |
sched: only update rq->clock while holding rq->lock
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 6f23059..c530b84 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -4441,12 +4441,8 @@ need_resched_nonpreemptible: if (sched_feat(HRTICK)) hrtick_clear(rq); - /* - * Do the rq-clock update outside the rq lock: - */ - local_irq_disable(); + spin_lock_irq(&rq->lock); update_rq_clock(rq); - spin_lock(&rq->lock); clear_tsk_need_resched(prev); if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) { |