aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-07-26 07:40:43 -0400
committerIngo Molnar <mingo@elte.hu>2007-07-26 07:40:43 -0400
commit2cd4d0ea19713304963dbb2de5073700bfe253f5 (patch)
tree39a374d0918db059413f6709184669da63af81ef
parent018a2212950457b1093e504cd834aa0fe749da6c (diff)
[PATCH] sched: make cpu_clock() not use the rq clock
it is enough to disable interrupts to get the precise rq-clock of the local CPU. this also solves an NMI watchdog regression: the NMI watchdog calls touch_softlockup_watchdog(), which might deadlock on rq->lock if the NMI hits an rq-locked critical section. Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/sched.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index cc6c1192c448..3eed860cf292 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -383,13 +383,12 @@ static inline unsigned long long rq_clock(struct rq *rq)
383 */ 383 */
384unsigned long long cpu_clock(int cpu) 384unsigned long long cpu_clock(int cpu)
385{ 385{
386 struct rq *rq = cpu_rq(cpu);
387 unsigned long long now; 386 unsigned long long now;
388 unsigned long flags; 387 unsigned long flags;
389 388
390 spin_lock_irqsave(&rq->lock, flags); 389 local_irq_save(flags);
391 now = rq_clock(rq); 390 now = rq_clock(cpu_rq(cpu));
392 spin_unlock_irqrestore(&rq->lock, flags); 391 local_irq_restore(flags);
393 392
394 return now; 393 return now;
395} 394}