Skip to content

Commit

Permalink
hrtimer: fix timerqueue conversion flub
Browse files Browse the repository at this point in the history
In converting the hrtimers to timerqueue, I missed
a spot in hrtimer_run_queues where we loop running
timers. We end up not pulling the new next value out
and instead just use the last next value, causing
boot time hangs in some cases.

The proper fix is to pull timerqueue_getnext each iteration
instead of using a local next value.

Reported-by: Ingo Molnar <[email protected]>
Signed-off-by: John Stultz <[email protected]>
  • Loading branch information
johnstultz-work committed Dec 11, 2010
1 parent 998adc3 commit b007c38
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,11 +1412,8 @@ void hrtimer_run_queues(void)
return;

for (index = 0; index < HRTIMER_MAX_CLOCK_BASES; index++) {
struct timerqueue_node *next;

base = &cpu_base->clock_base[index];
next = timerqueue_getnext(&base->active);
if (!next)
if (!timerqueue_getnext(&base->active))
continue;

if (gettime) {
Expand All @@ -1426,7 +1423,7 @@ void hrtimer_run_queues(void)

raw_spin_lock(&cpu_base->lock);

while ((node = next)) {
while ((node = timerqueue_getnext(&base->active))) {
struct hrtimer *timer;

timer = container_of(node, struct hrtimer, node);
Expand Down

0 comments on commit b007c38

Please sign in to comment.