linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wangkefeng.wang@huawei.com (Kefeng Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Support hard limit of cpu count by nr_cpus
Date: Mon, 8 Aug 2016 13:29:50 +0800	[thread overview]
Message-ID: <f0f9af57-4150-dce7-5bb7-aa7fcfe77aee@huawei.com> (raw)
In-Reply-To: <02d77415-9eb0-92f4-7cb6-9b941cda9a4d@arm.com>



On 2016/8/5 18:19, Suzuki K Poulose wrote:
> On 05/08/16 10:58, Kefeng Wang wrote:
>>
>>
>> On 2016/8/5 16:32, Will Deacon wrote:
>>> On Fri, Aug 05, 2016 at 02:03:55PM +0800, Kefeng Wang wrote:
>>>> Enable the hard limit of cpu count by nr_cpus on arm64.
>>>> The code is borrowed from MIPS.
>>>>
[...]
> 
> Or is this even better ?

Agree, and let's show a better warning.

> 
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 490db85..dbd6a5e 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -659,9 +659,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)
> +       if (cpu_count > nr_cpu_ids)
>                 pr_warn("no. of cores (%d) greater than configured maximum of %d - clipping\n",

  change to 	  pr_warn("%d cores exceeds configured maximum of %d - clipping\n",

Thanks,
Kefeng

> -                       cpu_count, NR_CPUS);
> +                       cpu_count, nr_cpu_ids);
>  
>         if (!bootcpu_valid) {
>                 pr_err("missing boot CPU MPIDR, not enabling secondaries\n");
> @@ -675,7 +675,7 @@ void __init smp_init_cpus(void)
>          * with entries in cpu_logical_map while initializing the cpus.
>          * If the cpu set-up fails, invalidate the cpu_logical_map entry.
>          */
> -       for (i = 1; i < NR_CPUS; i++) {
> +       for (i = 1; i < nr_cpu_ids; i++) {
>                 if (cpu_logical_map(i) != INVALID_HWID) {
>                         if (smp_cpu_setup(i))
>                                 cpu_logical_map(i) = INVALID_HWID;
> 
> 
> Cheers
> Suzuki
> 
> .
> 

  reply	other threads:[~2016-08-08  5:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05  6:03 [PATCH] arm64: Support hard limit of cpu count by nr_cpus Kefeng Wang
2016-08-05  8:32 ` Will Deacon
2016-08-05  9:58   ` Kefeng Wang
2016-08-05 10:19     ` Suzuki K Poulose
2016-08-08  5:29       ` Kefeng Wang [this message]
2016-08-08  6:05       ` [PATCH v2] " Kefeng Wang
2016-08-08 10:50         ` Suzuki K Poulose
2016-08-08 11:28           ` Kefeng Wang
2016-08-08 12:52             ` Suzuki K Poulose
2016-08-09  1:15               ` Kefeng Wang
2016-08-09  2:30               ` [PATCH v3] " Kefeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f0f9af57-4150-dce7-5bb7-aa7fcfe77aee@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).