The smt-enabled kernel parameter basically leaves unwanted cpus executing
in firmware or wherever they happen to be. The very same applies to the
ibm,smt-enabled DT property which is no more used by anything known. These
are hacks that shoudn't be used in a production environment.

Quoting mpe, "there are better ways for firmware to disable SMT".

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 on powernv when
trying to limit the number of hw threads at boot time (e.g. smt-enabled to
anything but 8 on POWER8).

This patch simply removes both the smt-enabled kernel parameter and the
ibm,smt-enabled property for all platforms. The new default is to start
all hw threads. That leaves /sys the only supported API to change SMT
settings.

Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com>
---

v2: also drop ibm,smt-enabled

 arch/powerpc/kernel/setup_64.c |   46 ----------------------------------------
 1 file changed, 46 deletions(-)

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 49f553b..29c1845 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -131,57 +131,11 @@ 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)
 {
-       struct device_node *dn;
-       const char *smt_option;
-
        /* 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);
-               }
-       }
-}
-
-/* Look for smt-enabled= cmdline option */
-static int __init early_smt_enabled(char *p)
-{
-       smt_enabled_cmdline = p;
-       return 0;
 }
-early_param("smt-enabled", early_smt_enabled);
 
 #else
 #define check_smt_enabled()

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to