diff mbox

powerpc: remove the smt-enabled kernel parameter

Message ID 20141203135812.4126.85795.stgit@bahia.local (mailing list archive)
State Changes Requested
Headers show

Commit Message

Greg Kurz Dec. 3, 2014, 1:58 p.m. UTC
This parameter basically leaves unwanted cpus executing in firmware or
wherever they happen to be. This is a hack that shoudn't be used in a
production environment.

It also has an evil side effect on the split-core feature for powernv. The
code needs all the cpus to participate to the split mode update: it relies
on smp_send_reschedule() to get offline ones to do so. This doesn't work with
cpus that haven't come up... The consequence is a kernel hang at boot time
on powernv when smt-enabled is used to limit the number of threads.

This patch simply removes the smt-enabled kernel parameter for all platforms.
>From now on, SMT mode should be set by userspace.

I see there also is a ibm,smt-enabled property but I could not find any
piece of information about it. Since it does the very same thing as the
kernel parameter, it is tempting to drop it alike... This would possibly
allow more simplification like killing the cpu_bootable hook.

Please give advice anyone.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/setup_64.c |   51 +++++++++-------------------------------
 1 file changed, 12 insertions(+), 39 deletions(-)

Comments

Michael Ellerman Dec. 4, 2014, 6:03 a.m. UTC | #1
On Wed, 2014-03-12 at 13:58:13 UTC, Greg Kurz wrote:
> This parameter basically leaves unwanted cpus executing in firmware or
> wherever they happen to be. This is a hack that shoudn't be used in a
> production environment.
> 
> It also has an evil side effect on the split-core feature for powernv. The
> code needs all the cpus to participate to the split mode update: it relies
> on smp_send_reschedule() to get offline ones to do so. This doesn't work with
> cpus that haven't come up... The consequence is a kernel hang at boot time
> on powernv when smt-enabled is used to limit the number of threads.
> 
> This patch simply removes the smt-enabled kernel parameter for all platforms.
> >From now on, SMT mode should be set by userspace.
> 
> I see there also is a ibm,smt-enabled property but I could not find any
> piece of information about it. Since it does the very same thing as the
> kernel parameter, it is tempting to drop it alike... This would possibly
> allow more simplification like killing the cpu_bootable hook.
> 
> Please give advice anyone.

Hi Greg,

Thanks for doing this.

I discussed this on irc and Benh & Anton both agree we should drop it.

Please send a v2 which also drops the support for ibm,smt-enabled.

Our reasoning is 1) it doesn't work correctly in the same way as the command
line option, 2) no one is aware of anything that still uses it, 3) there are
better ways for firmware to disable SMT.

Can you then send a 2nd patch which removes the cpu_bootable hook.

cheers
diff mbox

Patch

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4f3cfe1..62c7602 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -131,8 +131,6 @@  static void setup_tlb_core_data(void)
 
 #ifdef CONFIG_SMP
 
-static char *smt_enabled_cmdline;
-
 /* Look for ibm,smt-enabled OF option */
 static void check_smt_enabled(void)
 {
@@ -142,46 +140,21 @@  static void check_smt_enabled(void)
 	/* Default to enabling all threads */
 	smt_enabled_at_boot = threads_per_core;
 
-	/* Allow the command line to overrule the OF option */
-	if (smt_enabled_cmdline) {
-		if (!strcmp(smt_enabled_cmdline, "on"))
-			smt_enabled_at_boot = threads_per_core;
-		else if (!strcmp(smt_enabled_cmdline, "off"))
-			smt_enabled_at_boot = 0;
-		else {
-			int smt;
-			int rc;
-
-			rc = kstrtoint(smt_enabled_cmdline, 10, &smt);
-			if (!rc)
-				smt_enabled_at_boot =
-					min(threads_per_core, smt);
-		}
-	} else {
-		dn = of_find_node_by_path("/options");
-		if (dn) {
-			smt_option = of_get_property(dn, "ibm,smt-enabled",
-						     NULL);
-
-			if (smt_option) {
-				if (!strcmp(smt_option, "on"))
-					smt_enabled_at_boot = threads_per_core;
-				else if (!strcmp(smt_option, "off"))
-					smt_enabled_at_boot = 0;
-			}
-
-			of_node_put(dn);
+	dn = of_find_node_by_path("/options");
+	if (dn) {
+		smt_option = of_get_property(dn, "ibm,smt-enabled",
+					     NULL);
+
+		if (smt_option) {
+			if (!strcmp(smt_option, "on"))
+				smt_enabled_at_boot = threads_per_core;
+			else if (!strcmp(smt_option, "off"))
+				smt_enabled_at_boot = 0;
 		}
-	}
-}
 
-/* Look for smt-enabled= cmdline option */
-static int __init early_smt_enabled(char *p)
-{
-	smt_enabled_cmdline = p;
-	return 0;
+		of_node_put(dn);
+	}
 }
-early_param("smt-enabled", early_smt_enabled);
 
 #else
 #define check_smt_enabled()