History

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.

Frederic Weisbecker committed 1 year ago

Commit f4005651 parent d20eb2d2 files · +0 −6Browse files

Showing the changes to kernel/cpu.c (1 of 2 files). Show all

Unified · Split

kernel/cpu.c+0−5
@@ -2069,11 +2069,6 @@ static struct cpuhp_step cpuhp_hp_states[] = { · 2068 unmodified lines
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,