Skip to content

Commit

Permalink
timer: Fix hotplug regression
Browse files Browse the repository at this point in the history
The recent timer wheel rework removed the get/put_cpu_var() pair in
the hotplug migration code, which results in:

BUG: using smp_processor_id() in preemptible [00000000] code: hib.sh/2845
...
[<ffffffff810d4fa3>] timer_cpu_notify+0x53/0x12

That hunk is a leftover from an earlier iteration and went unnoticed
so far.

Restore the previous code which was obviously correct.

Fixes: 0eeda71 'timer: Replace timer base by a cpu index'
Reported-and_tested-by: Borislav Petkov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
KAGA-KOKO committed Jun 26, 2015
1 parent 56a94f1 commit 24bfcb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/time/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ static void migrate_timers(int cpu)

BUG_ON(cpu_online(cpu));
old_base = per_cpu_ptr(&tvec_bases, cpu);
new_base = this_cpu_ptr(&tvec_bases);
new_base = get_cpu_ptr(&tvec_bases);
/*
* The caller is globally serialized and nobody else
* takes two locks at once, deadlock is not possible.
Expand All @@ -1590,6 +1590,7 @@ static void migrate_timers(int cpu)

spin_unlock(&old_base->lock);
spin_unlock_irq(&new_base->lock);
put_cpu_ptr(&tvec_bases);
}

static int timer_cpu_notify(struct notifier_block *self,
Expand Down

0 comments on commit 24bfcb1

Please sign in to comment.