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.

timers/migration: Rename 'online' bit to 'available'

The timer migration hierarchy excludes offline CPUs via the
tmigr_is_not_available function, which is essentially checking the
online bit for the CPU.

Rename the online bit to available and all references in function names
and tracepoint to generalise the concept of available CPUs.

Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://patch.msgid.link/20251120145653.296659-2-gmonaco@redhat.com

authored by

Gabriele Monaco and committed by
Thomas Gleixner
8312cab5 308bc2e3

+15 -15
+2 -2
include/trace/events/timer_migration.h
··· 173 173 TP_ARGS(tmc) 174 174 ); 175 175 176 - DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_online, 176 + DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_available, 177 177 178 178 TP_PROTO(struct tmigr_cpu *tmc), 179 179 180 180 TP_ARGS(tmc) 181 181 ); 182 182 183 - DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_offline, 183 + DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_unavailable, 184 184 185 185 TP_PROTO(struct tmigr_cpu *tmc), 186 186
+12 -12
kernel/time/timer_migration.c
··· 429 429 430 430 static inline bool tmigr_is_not_available(struct tmigr_cpu *tmc) 431 431 { 432 - return !(tmc->tmgroup && tmc->online); 432 + return !(tmc->tmgroup && tmc->available); 433 433 } 434 434 435 435 /* ··· 926 926 * updated the event takes care when hierarchy is completely 927 927 * idle. Otherwise the migrator does it as the event is enqueued. 928 928 */ 929 - if (!tmc->online || tmc->remote || tmc->cpuevt.ignore || 929 + if (!tmc->available || tmc->remote || tmc->cpuevt.ignore || 930 930 now < tmc->cpuevt.nextevt.expires) { 931 931 raw_spin_unlock_irq(&tmc->lock); 932 932 return; ··· 973 973 * (See also section "Required event and timerqueue update after a 974 974 * remote expiry" in the documentation at the top) 975 975 */ 976 - if (!tmc->online || !tmc->idle) { 976 + if (!tmc->available || !tmc->idle) { 977 977 timer_unlock_remote_bases(cpu); 978 978 goto unlock; 979 979 } ··· 1422 1422 { 1423 1423 struct tmigr_cpu *tmc = this_cpu_ptr(&tmigr_cpu); 1424 1424 1425 - WARN_ON_ONCE(!tmc->online || tmc->idle); 1425 + WARN_ON_ONCE(!tmc->available || tmc->idle); 1426 1426 1427 1427 return 0; 1428 1428 } 1429 1429 1430 - static int tmigr_cpu_offline(unsigned int cpu) 1430 + static int tmigr_clear_cpu_available(unsigned int cpu) 1431 1431 { 1432 1432 struct tmigr_cpu *tmc = this_cpu_ptr(&tmigr_cpu); 1433 1433 int migrator; 1434 1434 u64 firstexp; 1435 1435 1436 1436 raw_spin_lock_irq(&tmc->lock); 1437 - tmc->online = false; 1437 + tmc->available = false; 1438 1438 WRITE_ONCE(tmc->wakeup, KTIME_MAX); 1439 1439 1440 1440 /* ··· 1442 1442 * offline; Therefore nextevt value is set to KTIME_MAX 1443 1443 */ 1444 1444 firstexp = __tmigr_cpu_deactivate(tmc, KTIME_MAX); 1445 - trace_tmigr_cpu_offline(tmc); 1445 + trace_tmigr_cpu_unavailable(tmc); 1446 1446 raw_spin_unlock_irq(&tmc->lock); 1447 1447 1448 1448 if (firstexp != KTIME_MAX) { ··· 1453 1453 return 0; 1454 1454 } 1455 1455 1456 - static int tmigr_cpu_online(unsigned int cpu) 1456 + static int tmigr_set_cpu_available(unsigned int cpu) 1457 1457 { 1458 1458 struct tmigr_cpu *tmc = this_cpu_ptr(&tmigr_cpu); 1459 1459 ··· 1462 1462 return -EINVAL; 1463 1463 1464 1464 raw_spin_lock_irq(&tmc->lock); 1465 - trace_tmigr_cpu_online(tmc); 1465 + trace_tmigr_cpu_available(tmc); 1466 1466 tmc->idle = timer_base_is_idle(); 1467 1467 if (!tmc->idle) 1468 1468 __tmigr_cpu_activate(tmc); 1469 - tmc->online = true; 1469 + tmc->available = true; 1470 1470 raw_spin_unlock_irq(&tmc->lock); 1471 1471 return 0; 1472 1472 } ··· 1758 1758 * The (likely) current CPU is expected to be online in the hierarchy, 1759 1759 * otherwise the old root may not be active as expected. 1760 1760 */ 1761 - WARN_ON_ONCE(!per_cpu_ptr(&tmigr_cpu, raw_smp_processor_id())->online); 1761 + WARN_ON_ONCE(!per_cpu_ptr(&tmigr_cpu, raw_smp_processor_id())->available); 1762 1762 ret = tmigr_setup_groups(-1, old_root->numa_node, old_root, true); 1763 1763 } 1764 1764 ··· 1854 1854 goto err; 1855 1855 1856 1856 ret = cpuhp_setup_state(CPUHP_AP_TMIGR_ONLINE, "tmigr:online", 1857 - tmigr_cpu_online, tmigr_cpu_offline); 1857 + tmigr_set_cpu_available, tmigr_clear_cpu_available); 1858 1858 if (ret) 1859 1859 goto err; 1860 1860
+1 -1
kernel/time/timer_migration.h
··· 97 97 */ 98 98 struct tmigr_cpu { 99 99 raw_spinlock_t lock; 100 - bool online; 100 + bool available; 101 101 bool idle; 102 102 bool remote; 103 103 struct tmigr_group *tmgroup;