[PATCH v2] arm64: Support hard limit of cpu count by nr_cpus
From: Suzuki.Poulose@arm.com (Suzuki K Poulose)
Date: 2016-08-08 10:50:51
On 08/08/16 07:05, Kefeng Wang wrote:
quoted hunk ↗ jump to hunk
Enable the hard limit of cpu count by set boot options nr_cpus=x on arm64, and show a better warning when cpu number exceeds the limit. Reported-by: Shiyuan Hu <redacted> Signed-off-by: Kefeng Wang <redacted> --- Changed since v1: - clip cpu number in smp_init_cpus suggested-by Will and Suzuki, and update the warning. arch/arm64/kernel/smp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 76a6d92..cbfc31c 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c@@ -661,9 +661,9 @@ void __init smp_init_cpus(void) acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT, acpi_parse_gic_cpu_interface, 0); - if (cpu_count > NR_CPUS) - pr_warn("no. of cores (%d) greater than configured maximum of %d - clipping\n", - cpu_count, NR_CPUS); + if (cpu_count > nr_cpu_ids) + pr_warn("%d cores exceeds configured maximum of %d - clipping\n", + cpu_count, nr_cpu_ids);
I think we should leave the message as it was, and is better than what you have changed it to. With that change, Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>