diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2023-05-21 23:31:22 +0100 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2023-06-09 10:34:14 +0200 |
commit | 96cb8ae28c652e7ef0633b1c0786eb0f529ed516 (patch) | |
tree | 3490ae910dca2655c0fd16b9ece2d4974dc9e886 /arch/mips/kernel/smp.c | |
parent | dfbd992e0ef2319b869bf69fe649d34d2dc49e4b (diff) |
MIPS: Rework smt cmdline parameters
Provide a generic smt parameters interface aligned with s390
to allow users to limit smt usage and threads per core.
It replaced previous undocumented "nothreads" parameter for
smp-cps which is ambiguous and does not cover smp-mt.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/kernel/smp.c')
-rw-r--r-- | arch/mips/kernel/smp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 1d93b85271ba..280251ea8319 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -73,6 +73,24 @@ static cpumask_t cpu_core_setup_map; cpumask_t cpu_coherent_mask; +unsigned int smp_max_threads __initdata = UINT_MAX; + +static int __init early_nosmt(char *s) +{ + smp_max_threads = 1; + return 0; +} +early_param("nosmt", early_nosmt); + +static int __init early_smt(char *s) +{ + get_option(&s, &smp_max_threads); + /* Ensure at least one thread is available */ + smp_max_threads = clamp_val(smp_max_threads, 1U, UINT_MAX); + return 0; +} +early_param("smt", early_smt); + #ifdef CONFIG_GENERIC_IRQ_IPI static struct irq_desc *call_desc; static struct irq_desc *sched_desc; |