]> git.baikalelectronics.ru Git - kernel.git/commit
cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state
authorSteven Price <steven.price@arm.com>
Mon, 11 Apr 2022 15:22:32 +0000 (16:22 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 13 Apr 2022 19:25:40 +0000 (21:25 +0200)
commit80b52afb43ef8b2ae71e0739baa5b0cb7670d8d1
tree471096212904c8a757af531fe7fca1781cf59109
parenta014a6359c1798896b49bf10d2fad65e8e9c6bc8
cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state

Currently the setting of the 'cpu' member of struct cpuhp_cpu_state in
cpuhp_create() is too late as it is used earlier in _cpu_up().

If kzalloc_node() in __smpboot_create_thread() fails then the rollback will
be done with st->cpu==0 causing CPU0 to be erroneously set to be dying,
causing the scheduler to get mightily confused and throw its toys out of
the pram.

However the cpu number is actually available directly, so simply remove
the 'cpu' member and avoid the problem in the first place.

Fixes: 7750f4a682c8 ("cpumask/hotplug: Fix cpu_dying() state tracking")
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220411152233.474129-2-steven.price@arm.com
kernel/cpu.c