Skip to content

Commit 24bfcb1

Browse files
committed
timer: Fix hotplug regression
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]>
1 parent 56a94f1 commit 24bfcb1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/time/timer.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ static void migrate_timers(int cpu)
15661566

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

15911591
spin_unlock(&old_base->lock);
15921592
spin_unlock_irq(&new_base->lock);
1593+
put_cpu_ptr(&tvec_bases);
15931594
}
15941595

15951596
static int timer_cpu_notify(struct notifier_block *self,

0 commit comments

Comments
 (0)