Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'timers-core-2025-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer core updates from Thomas Gleixner:

- Simplify the logic in the timer migration code

- Simplify the clocksource code by utilizing the more modern
cpumask+*() interfaces

* tag 'timers-core-2025-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
clocksource: Use cpumask_next_wrap() in clocksource_watchdog()
clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus()
timers/migration: Clean up the loop in tmigr_quick_check()

+12 -19
+2 -6
kernel/time/clocksource.c
··· 323 323 return; 324 324 325 325 /* Make sure to select at least one CPU other than the current CPU. */ 326 - cpu = cpumask_first(cpu_online_mask); 327 - if (cpu == smp_processor_id()) 328 - cpu = cpumask_next(cpu, cpu_online_mask); 326 + cpu = cpumask_any_but(cpu_online_mask, smp_processor_id()); 329 327 if (WARN_ON_ONCE(cpu >= nr_cpu_ids)) 330 328 return; 331 329 cpumask_set_cpu(cpu, &cpus_chosen); ··· 587 589 * Cycle through CPUs to check if the CPUs stay synchronized 588 590 * to each other. 589 591 */ 590 - next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask); 591 - if (next_cpu >= nr_cpu_ids) 592 - next_cpu = cpumask_first(cpu_online_mask); 592 + next_cpu = cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask); 593 593 594 594 /* 595 595 * Arm timer if not already pending: could race with concurrent
+10 -13
kernel/time/timer_migration.c
··· 1405 1405 return KTIME_MAX; 1406 1406 1407 1407 do { 1408 - if (!tmigr_check_lonely(group)) { 1408 + if (!tmigr_check_lonely(group)) 1409 1409 return KTIME_MAX; 1410 - } else { 1411 - /* 1412 - * Since current CPU is active, events may not be sorted 1413 - * from bottom to the top because the CPU's event is ignored 1414 - * up to the top and its sibling's events not propagated upwards. 1415 - * Thus keep track of the lowest observed expiry. 1416 - */ 1417 - nextevt = min_t(u64, nextevt, READ_ONCE(group->next_expiry)); 1418 - if (!group->parent) 1419 - return nextevt; 1420 - } 1410 + 1411 + /* 1412 + * Since current CPU is active, events may not be sorted 1413 + * from bottom to the top because the CPU's event is ignored 1414 + * up to the top and its sibling's events not propagated upwards. 1415 + * Thus keep track of the lowest observed expiry. 1416 + */ 1417 + nextevt = min_t(u64, nextevt, READ_ONCE(group->next_expiry)); 1421 1418 group = group->parent; 1422 1419 } while (group); 1423 1420 1424 - return KTIME_MAX; 1421 + return nextevt; 1425 1422 } 1426 1423 1427 1424 /*