Skip to content

Commit f400565

Browse files
Frederic WeisbeckerPeter Zijlstra
authored andcommitted
perf: Remove too early and redundant CPU hotplug handling
The CPU hotplug handlers are called twice: at prepare and online stage. Their role is to: 1) Enable/disable a CPU context. This is irrelevant and even buggy at the prepare stage because the CPU is still offline. On early secondary CPU up, creating an event attached to that CPU might silently fail because the CPU context is observed as online but the context installation's IPI failure is ignored. 2) Update the scope cpumasks and re-migrate the events accordingly in the CPU down case. This is irrelevant at the prepare stage. 3) Remove the events attached to the context of the offlining CPU. It even uses an (unnecessary) IPI for it. This is also irrelevant at the prepare stage. Also none of the *_PREPARE and *_STARTING architecture perf related CPU hotplug callbacks rely on CPUHP_PERF_PREPARE. CPUHP_AP_PERF_ONLINE is enough and the right place to perform the work. Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent d20eb2d commit f400565

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

include/linux/cpuhotplug.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ enum cpuhp_state {
6060
/* PREPARE section invoked on a control CPU */
6161
CPUHP_OFFLINE = 0,
6262
CPUHP_CREATE_THREADS,
63-
CPUHP_PERF_PREPARE,
6463
CPUHP_PERF_X86_PREPARE,
6564
CPUHP_PERF_X86_AMD_UNCORE_PREP,
6665
CPUHP_PERF_POWER,

kernel/cpu.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,11 +2069,6 @@ static struct cpuhp_step cpuhp_hp_states[] = {
20692069
.teardown.single = NULL,
20702070
.cant_stop = true,
20712071
},
2072-
[CPUHP_PERF_PREPARE] = {
2073-
.name = "perf:prepare",
2074-
.startup.single = perf_event_init_cpu,
2075-
.teardown.single = perf_event_exit_cpu,
2076-
},
20772072
[CPUHP_RANDOM_PREPARE] = {
20782073
.name = "random:prepare",
20792074
.startup.single = random_prepare_cpu,

0 commit comments

Comments
 (0)