History

tick: Remove pointless cpu valid check in hotplug code

tick_handover_do_timer() which is invoked when a CPU is unplugged has a check for cpumask_first(cpu_online_mask) when it tries to hand over the tick update duty. Checking the result of cpumask_first() there is pointless because if the online mask is empty at this point, then this would be the last CPU in the system going offline, which is impossible. There is always at least one CPU remaining. If online mask would be really empty then the timer duty would be the least of the resulting problems. Remove the well meant check simply because it is pointless and confusing.

Thomas Gleixner committed 5 years ago

Commit f12ad421 parent 533369b1 file · +3 −7Browse files

Unified · Split

kernel/time/tick-common.c+3−7
@@ -407,17 +407,13 @@ EXPORT_SYMBOL_GPL(tick_broadcast_oneshot_control); · 406 unmodified lines
407/*407/*
408 * Transfer the do_timer job away from a dying cpu.408 * Transfer the do_timer job away from a dying cpu.
409 *409 *
410 * Called with interrupts disabled. Not locking required. If410 * Called with interrupts disabled. No locking required. If
411 * tick_do_timer_cpu is owned by this cpu, nothing can change it.411 * tick_do_timer_cpu is owned by this cpu, nothing can change it.
412 */412 */
413void tick_handover_do_timer(void)413void tick_handover_do_timer(void)
414{414{
415 if (tick_do_timer_cpu == smp_processor_id()) {415 if (tick_do_timer_cpu == smp_processor_id())
416 int cpu = cpumask_first(cpu_online_mask);416 tick_do_timer_cpu = cpumask_first(cpu_online_mask);
417
418 tick_do_timer_cpu = (cpu < nr_cpu_ids) ? cpu :
419 TICK_DO_TIMER_NONE;
420 }
421}417}
422 418
423/*419/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t