[PATCH 11/11] powerpc/smp: Provide an ability to disable coregroup

Srikar Dronamraju srikar at linux.vnet.ibm.com
Tue Jul 14 14:36:24 AEST 2020


If user wants to enable coregroup sched_domain then they can boot with
kernel parameter "coregroup_support=on"

Cc: linuxppc-dev <linuxppc-dev at lists.ozlabs.org>
Cc: Michael Ellerman <michaele at au1.ibm.com>
Cc: Nick Piggin <npiggin at au1.ibm.com>
Cc: Oliver OHalloran <oliveroh at au1.ibm.com>
Cc: Nathan Lynch <nathanl at linux.ibm.com>
Cc: Michael Neuling <mikey at linux.ibm.com>
Cc: Anton Blanchard <anton at au1.ibm.com>
Cc: Gautham R Shenoy <ego at linux.vnet.ibm.com>
Cc: Vaidyanathan Srinivasan <svaidy at linux.ibm.com>
Signed-off-by: Srikar Dronamraju <srikar at linux.vnet.ibm.com>
---
 arch/powerpc/kernel/smp.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index bb25c13bbb79..c43909e6e8e9 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -118,6 +118,23 @@ struct smp_ops_t *smp_ops;
 volatile unsigned int cpu_callin_map[NR_CPUS];
 
 int smt_enabled_at_boot = 1;
+int coregroup_support;
+
+static int __init early_coregroup(char *p)
+{
+	if (!p)
+		return 0;
+
+	if (strstr(p, "on"))
+		coregroup_support = 1;
+
+	if (strstr(p, "1"))
+		coregroup_support = 1;
+
+	return 0;
+}
+
+early_param("coregroup_support", early_coregroup);
 
 /*
  * Returns 1 if the specified cpu should be brought up during boot.
@@ -878,7 +895,7 @@ static struct cpumask *cpu_coregroup_mask(int cpu)
 
 static bool has_coregroup_support(void)
 {
-	return coregroup_enabled;
+	return coregroup_enabled && coregroup_support;
 }
 
 static const struct cpumask *cpu_mc_mask(int cpu)
-- 
2.17.1



More information about the Linuxppc-dev mailing list