]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:42:39 +0000 (14:42 +0200)
commit2e2155744a707352438f2631d988f21ac45098b9
treecdcea32a2189b90c62e4c817f42234a091090b2e
parent1625a8935148979160e559cf98a7d6ae9dc63b5c
cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state

BugLink: https://bugs.launchpad.net/bugs/1969857
commit b7ba6d8dc3569e49800ef0136799f26f43e237e8 upstream.

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: 2ea46c6fc945 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/cpu.c