Skip to content

Commit 5256184

Browse files
committed
Merge tag 'timers-urgent-2024-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer migration updates from Thomas Gleixner: "Fixes and minor updates for the timer migration code: - Stop testing the group->parent pointer as it is not guaranteed to be stable over a chain of operations by design. This includes a warning which would be nice to have but it produces false positives due to the racy nature of the check. - Plug a race between CPUs going in and out of idle and a CPU hotplug operation. The latter can create and connect a new hierarchy level which is missed in the concurrent updates of CPUs which go into idle. As a result the events of such a CPU might not be processed and timers go stale. Cure it by splitting the hotplug operation into a prepare and online callback. The prepare callback is guaranteed to run on an online and therefore active CPU. This CPU updates the hierarchy and being online ensures that there is always at least one migrator active which handles the modified hierarchy correctly when going idle. The online callback which runs on the incoming CPU then just marks the CPU active and brings it into operation. - Improve tracing and polish the code further so it is more obvious what's going on" * tag 'timers-urgent-2024-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timers/migration: Fix grammar in comment timers/migration: Spare write when nothing changed timers/migration: Rename childmask by groupmask to make naming more obvious timers/migration: Read childmask and parent pointer in a single place timers/migration: Use a single struct for hierarchy walk data timers/migration: Improve tracing timers/migration: Move hierarchy setup into cpuhotplug prepare callback timers/migration: Do not rely always on group->parent
2 parents c9f3343 + f004bf9 commit 5256184

File tree

4 files changed

+224
-213
lines changed

4 files changed

+224
-213
lines changed

include/linux/cpuhotplug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ enum cpuhp_state {
122122
CPUHP_KVM_PPC_BOOK3S_PREPARE,
123123
CPUHP_ZCOMP_PREPARE,
124124
CPUHP_TIMERS_PREPARE,
125+
CPUHP_TMIGR_PREPARE,
125126
CPUHP_MIPS_SOC_PREPARE,
126127
CPUHP_BP_PREPARE_DYN,
127128
CPUHP_BP_PREPARE_DYN_END = CPUHP_BP_PREPARE_DYN + 20,

include/trace/events/timer_migration.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ TRACE_EVENT(tmigr_connect_child_parent,
4343
__field( unsigned int, lvl )
4444
__field( unsigned int, numa_node )
4545
__field( unsigned int, num_children )
46-
__field( u32, childmask )
46+
__field( u32, groupmask )
4747
),
4848

4949
TP_fast_assign(
@@ -52,11 +52,11 @@ TRACE_EVENT(tmigr_connect_child_parent,
5252
__entry->lvl = child->parent->level;
5353
__entry->numa_node = child->parent->numa_node;
5454
__entry->num_children = child->parent->num_children;
55-
__entry->childmask = child->childmask;
55+
__entry->groupmask = child->groupmask;
5656
),
5757

58-
TP_printk("group=%p childmask=%0x parent=%p lvl=%d numa=%d num_children=%d",
59-
__entry->child, __entry->childmask, __entry->parent,
58+
TP_printk("group=%p groupmask=%0x parent=%p lvl=%d numa=%d num_children=%d",
59+
__entry->child, __entry->groupmask, __entry->parent,
6060
__entry->lvl, __entry->numa_node, __entry->num_children)
6161
);
6262

@@ -72,7 +72,7 @@ TRACE_EVENT(tmigr_connect_cpu_parent,
7272
__field( unsigned int, lvl )
7373
__field( unsigned int, numa_node )
7474
__field( unsigned int, num_children )
75-
__field( u32, childmask )
75+
__field( u32, groupmask )
7676
),
7777

7878
TP_fast_assign(
@@ -81,11 +81,11 @@ TRACE_EVENT(tmigr_connect_cpu_parent,
8181
__entry->lvl = tmc->tmgroup->level;
8282
__entry->numa_node = tmc->tmgroup->numa_node;
8383
__entry->num_children = tmc->tmgroup->num_children;
84-
__entry->childmask = tmc->childmask;
84+
__entry->groupmask = tmc->groupmask;
8585
),
8686

87-
TP_printk("cpu=%d childmask=%0x parent=%p lvl=%d numa=%d num_children=%d",
88-
__entry->cpu, __entry->childmask, __entry->parent,
87+
TP_printk("cpu=%d groupmask=%0x parent=%p lvl=%d numa=%d num_children=%d",
88+
__entry->cpu, __entry->groupmask, __entry->parent,
8989
__entry->lvl, __entry->numa_node, __entry->num_children)
9090
);
9191

0 commit comments

Comments
 (0)