diff options
author | Mikulas Patocka <[email protected]> | 2022-06-01 13:18:22 -0400 |
---|---|---|
committer | Helge Deller <[email protected]> | 2022-06-03 09:54:01 +0200 |
commit | 6ba688364856ad083be537f08e86ba97f433d405 (patch) | |
tree | 4c9e7b5878038a1b6b6f10703a70eb5cfe91fc0e /arch/parisc/kernel/processor.c | |
parent | 4b0986a3613c92f4ec1bdc7f60ec66fea135991f (diff) |
parisc: fix a crash with multicore scheduler
With the kernel 5.18, the system will hang on boot if it is compiled with
CONFIG_SCHED_MC. The last printed message is "Brought up 1 node, 1 CPU".
The crash happens in sd_init
tl->mask (which is cpu_coregroup_mask) returns an empty mask. This happens
because cpu_topology[0].core_sibling is empty.
Consequently, sd_span is set to an empty mask
sd_id = cpumask_first(sd_span) sets sd_id == NR_CPUS (because the mask is
empty)
sd->shared = *per_cpu_ptr(sdd->sds, sd_id); sets sd->shared to NULL
because sd_id is out of range
atomic_inc(&sd->shared->ref); crashes without printing anything
We can fix it by calling reset_cpu_topology() from init_cpu_topology() -
this will initialize the sibling masks on CPUs, so that they're not empty.
This patch also removes the variable "dualcores_found", it is useless,
because during boot, init_cpu_topology is called before
store_cpu_topology. Thus, set_sched_topology(parisc_mc_topology) is never
called. We don't need to call it at all because default_topology in
kernel/sched/topology.c contains the same items as parisc_mc_topology.
Note that we should not call store_cpu_topology() from init_per_cpu()
because it is called too early in the kernel initialization process and it
results in the message "Failure to register CPU0 device". Before this
patch, store_cpu_topology() would exit immediatelly because
cpuid_topo->core id was uninitialized and it was 0.
Signed-off-by: Mikulas Patocka <[email protected]>
Cc: [email protected] # v5.18
Signed-off-by: Helge Deller <[email protected]>
Diffstat (limited to 'arch/parisc/kernel/processor.c')
-rw-r--r-- | arch/parisc/kernel/processor.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index 26eb568f8b96..dddaaa6e7a82 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -327,8 +327,6 @@ int init_per_cpu(int cpunum) set_firmware_width(); ret = pdc_coproc_cfg(&coproc_cfg); - store_cpu_topology(cpunum); - if(ret >= 0 && coproc_cfg.ccr_functional) { mtctl(coproc_cfg.ccr_functional, 10); /* 10 == Coprocessor Control Reg */ |