Commit 2cd4d0ea authored by Ingo Molnar's avatar Ingo Molnar

[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: default avatarIngo Molnar <mingo@elte.hu>
parent 018a2212
...@@ -383,13 +383,12 @@ static inline unsigned long long rq_clock(struct rq *rq) ...@@ -383,13 +383,12 @@ static inline unsigned long long rq_clock(struct rq *rq)
*/ */
unsigned long long cpu_clock(int cpu) unsigned long long cpu_clock(int cpu)
{ {
struct rq *rq = cpu_rq(cpu);
unsigned long long now; unsigned long long now;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&rq->lock, flags); local_irq_save(flags);
now = rq_clock(rq); now = rq_clock(cpu_rq(cpu));
spin_unlock_irqrestore(&rq->lock, flags); local_irq_restore(flags);
return now; return now;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment