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

Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull SMP hotplug update from Thomas Gleixner:
"This contains a trivial typo fix and an extension to the core code for
dynamically allocating states in the prepare stage.

The extension is necessary right now because we need a proper way to
unbreak LTTNG, which iscurrently non functional due to the removal of
the notifiers. Surely it's out of tree, but it's widely used by
distros.

The simple solution would have been to reserve a state for LTTNG, but
I'm not fond about unused crap in the kernel and the dynamic range,
which we admittedly should have done right away, allows us to remove
quite some of the hardcoded states, i.e. those which have no ordering
requirements. So doing the right thing now is better than having an
smaller intermediate solution which needs to be reworked anyway"

* 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
cpu/hotplug: Provide dynamic range for prepare stage
perf/x86/amd/ibs: Fix typo after cleanup state names in cpu/hotplug

+21 -5
+1 -1
arch/x86/events/amd/ibs.c
··· 1010 1010 * all online cpus. 1011 1011 */ 1012 1012 cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_IBS_STARTING, 1013 - "perf/x86/amd/ibs:STARTING", 1013 + "perf/x86/amd/ibs:starting", 1014 1014 x86_pmu_amd_ibs_starting_cpu, 1015 1015 x86_pmu_amd_ibs_dying_cpu); 1016 1016
+2
include/linux/cpuhotplug.h
··· 74 74 CPUHP_ZCOMP_PREPARE, 75 75 CPUHP_TIMERS_DEAD, 76 76 CPUHP_MIPS_SOC_PREPARE, 77 + CPUHP_BP_PREPARE_DYN, 78 + CPUHP_BP_PREPARE_DYN_END = CPUHP_BP_PREPARE_DYN + 20, 77 79 CPUHP_BRINGUP_CPU, 78 80 CPUHP_AP_IDLE_DEAD, 79 81 CPUHP_AP_OFFLINE,
+18 -4
kernel/cpu.c
··· 1302 1302 */ 1303 1303 static int cpuhp_reserve_state(enum cpuhp_state state) 1304 1304 { 1305 - enum cpuhp_state i; 1305 + enum cpuhp_state i, end; 1306 + struct cpuhp_step *step; 1306 1307 1307 - for (i = CPUHP_AP_ONLINE_DYN; i <= CPUHP_AP_ONLINE_DYN_END; i++) { 1308 - if (!cpuhp_ap_states[i].name) 1308 + switch (state) { 1309 + case CPUHP_AP_ONLINE_DYN: 1310 + step = cpuhp_ap_states + CPUHP_AP_ONLINE_DYN; 1311 + end = CPUHP_AP_ONLINE_DYN_END; 1312 + break; 1313 + case CPUHP_BP_PREPARE_DYN: 1314 + step = cpuhp_bp_states + CPUHP_BP_PREPARE_DYN; 1315 + end = CPUHP_BP_PREPARE_DYN_END; 1316 + break; 1317 + default: 1318 + return -EINVAL; 1319 + } 1320 + 1321 + for (i = state; i <= end; i++, step++) { 1322 + if (!step->name) 1309 1323 return i; 1310 1324 } 1311 1325 WARN(1, "No more dynamic states available for CPU hotplug\n"); ··· 1337 1323 1338 1324 mutex_lock(&cpuhp_state_mutex); 1339 1325 1340 - if (state == CPUHP_AP_ONLINE_DYN) { 1326 + if (state == CPUHP_AP_ONLINE_DYN || state == CPUHP_BP_PREPARE_DYN) { 1341 1327 ret = cpuhp_reserve_state(state); 1342 1328 if (ret < 0) 1343 1329 goto out;