diff mbox series

Drop CONFIG_SCHED_MC

Message ID YpZYPokZr9s4uwtt@p100 (mailing list archive)
State Superseded
Headers show
Series Drop CONFIG_SCHED_MC | expand

Commit Message

Helge Deller May 31, 2022, 6:02 p.m. UTC
Mikulas noticed that the parisc kernel crashes in sd_init() if
CONFIG_SCHED_MC is enabled.
Multicore-scheduling is probably not very useful on parisc, so simply
drop this option.

Signed-off-by: Helge Deller <deller@gmx.de>
Noticed-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: <stable@vger.kernel.org> # 5.18

Comments

Mikulas Patocka June 1, 2022, 1:42 p.m. UTC | #1
On Tue, 31 May 2022, Helge Deller wrote:

> Mikulas noticed that the parisc kernel crashes in sd_init() if
> CONFIG_SCHED_MC is enabled.
> Multicore-scheduling is probably not very useful on parisc, so simply
> drop this option.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> Noticed-by: Mikulas Patocka <mpatocka@redhat.com>
> Cc: <stable@vger.kernel.org> # 5.18

Hi

I think that we should fix the root cause instead of trying to treat the 
symptoms.

Some more testing showed that:

in sd_init: tl->mask(cpu) returns an empty mask
tl->mask is cpu_coregroup_mask
in cpu_coregroup_mask: cpu_topology[cpu].core_sibling is an empty mask, 
that gets returned to sd_init

In arch/parisc/kernel/topology.c:
init_cpu_topology is called before store_cpu_topology, but it depends on 
the variable dualcores_found being set by store_cpu_topology. Thus, it is 
not set.

store_cpu_topology returns if cpuid_topo->core_id != -1, but during boot, 
store_cpu_topology is called before reset_cpu_topology, thus the member 
"core_id" is uninitialized zero and store_cpu_tolopogy does nothing.

If these issues are addrssed, multicore scheduling will work.

Mikulas
Mikulas Patocka June 1, 2022, 2:54 p.m. UTC | #2
On Wed, 1 Jun 2022, Mikulas Patocka wrote:

> 
> 
> On Tue, 31 May 2022, Helge Deller wrote:
> 
> > Mikulas noticed that the parisc kernel crashes in sd_init() if
> > CONFIG_SCHED_MC is enabled.
> > Multicore-scheduling is probably not very useful on parisc, so simply
> > drop this option.
> > 
> > Signed-off-by: Helge Deller <deller@gmx.de>
> > Noticed-by: Mikulas Patocka <mpatocka@redhat.com>
> > Cc: <stable@vger.kernel.org> # 5.18
> 
> Hi
> 
> I think that we should fix the root cause instead of trying to treat the 
> symptoms.
> 
> Some more testing showed that:
> 
> in sd_init: tl->mask(cpu) returns an empty mask
> tl->mask is cpu_coregroup_mask
> in cpu_coregroup_mask: cpu_topology[cpu].core_sibling is an empty mask, 
> that gets returned to sd_init
> 
> In arch/parisc/kernel/topology.c:
> init_cpu_topology is called before store_cpu_topology, but it depends on 
> the variable dualcores_found being set by store_cpu_topology. Thus, it is 
> not set.
> 
> store_cpu_topology returns if cpuid_topo->core_id != -1, but during boot, 
> store_cpu_topology is called before reset_cpu_topology, thus the member 
> "core_id" is uninitialized zero and store_cpu_tolopogy does nothing.
> 
> If these issues are addrssed, multicore scheduling will work.

I've found that this fixes it.

Mikulas


---
 arch/parisc/kernel/topology.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/arch/parisc/kernel/topology.c
===================================================================
--- linux-2.6.orig/arch/parisc/kernel/topology.c	2022-06-01 15:32:59.000000000 +0200
+++ linux-2.6/arch/parisc/kernel/topology.c	2022-06-01 16:47:36.000000000 +0200
@@ -95,7 +95,8 @@ static struct sched_domain_topology_leve
  */
 void __init init_cpu_topology(void)
 {
+	reset_cpu_topology();
 	/* Set scheduler topology descriptor */
-	if (dualcores_found)
+	/*if (dualcores_found)*/
 		set_sched_topology(parisc_mc_topology);
 }
diff mbox series

Patch

diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index bd22578859d0..34591a981cb7 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -281,14 +281,6 @@  config SMP

 	  If you don't know what to do here, say N.

-config SCHED_MC
-	bool "Multi-core scheduler support"
-	depends on GENERIC_ARCH_TOPOLOGY && PA8X00
-	help
-	  Multi-core scheduler support improves the CPU scheduler's decision
-	  making when dealing with multi-core CPU chips at a cost of slightly
-	  increased overhead in some places. If unsure say N here.
-
 config IRQSTACKS
 	bool "Use separate kernel stacks when processing interrupts"
 	default y
diff --git a/arch/parisc/kernel/topology.c b/arch/parisc/kernel/topology.c
index 9696e3cb6a2a..71a678ceb33a 100644
--- a/arch/parisc/kernel/topology.c
+++ b/arch/parisc/kernel/topology.c
@@ -81,10 +81,6 @@  void store_cpu_topology(unsigned int cpuid)
 }

 static struct sched_domain_topology_level parisc_mc_topology[] = {
-#ifdef CONFIG_SCHED_MC
-	{ cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
-#endif
-
 	{ cpu_cpu_mask, SD_INIT_NAME(DIE) },
 	{ NULL, },
 };