Skip to content

cpu/hotplug: Fix cpuhp_cpu_state used before init

Steven Price lkml 2 versions – Applied

Status from this message: The following commit has been merged into the smp/urgent branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesApplied
  2. v11 patch 0 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_statekernel/cpu.c+18 -180 replies
2/2cpu/hotplug: Initialise all cpuhp_cpu_state structs earlierkernel/cpu.c+13 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] cpu/hotplug: Fix cpuhp_cpu_state used before init

Currently it's possible to trigger a case where the cpuhp_cpu_state::cpu member is used before it has been initialised. This can cause CPU 0 to be erroneously marked as dying and trigger a scheduler panic (full details in v1[1]).

The two patches here fix the root cause by removing the 'cpu' member altogether and to prevent similar confusion in the future ensure that the cpuhp_cpu_state structures are initialised before any hotplugging occurs.

Changes since v2[2]:
* Remove the cpu member altogether (first patch)
* Move the initialisation of cpuhp_cpu_state as suggested by tglx (second patch)

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

Steven Price (2):
cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state cpu/hotplug: Initialise all cpuhp_cpu_state structs earlier

 kernel/cpu.c | 58 ++++++++++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 27 deletions(-)
Signature · 1 line
2.25.1