From: Dou Liyang <douly.fnst@cn.fujitsu.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<rjw@rjwysocki.net>, <lenb@kernel.org>, <rafael@kernel.org>,
<dedekind1@gmail.com>, Ming Lei <ming.lei@redhat.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [RFC PATCH v2] ACPI / processor: Fix possible CPUs map
Date: Fri, 16 Mar 2018 10:51:43 +0800 [thread overview]
Message-ID: <cb79c370-8c6f-2ef7-9a0a-ed33bd485113@cn.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1803151436200.1525@nanos.tec.linutronix.de>
Hi Thomas,
At 03/15/2018 09:45 PM, Thomas Gleixner wrote:
[...]
> I tested this on a machine which claims to have gazillion of hotplugable
> CPUs:
I really appreciate your test.
>
> smpboot: Allowing 152 CPUs, 120 hotplug CPUs
> setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:152 nr_node_ids:2
> smp: Brought up 2 nodes, 32 CPUs
>
> Now with your patch applied it's still saying:
>
> smpboot: Allowing 152 CPUs, 120 hotplug CPUs
> setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:152 nr_node_ids:2
> smp: Brought up 2 nodes, 32 CPUs
>
> and the above code runs later on and the result is:
>
> nr_unique_ids 1 nr_cpu_ids 152
> Allowing 1 possible CPU
>
> which subsequently causes the machine to die as we have already 32 CPUs
> online.
>
That is so interesting, it proofs that this strategy is risky.
I've been wondering how to determine the number of possible CPUs. Due to
the diversity of ACPI in different systems, that seems impossible. Why
don't I change my mind? Here is a new strategy and I think it is more
reasonable and minimally invasive.
As we all know, we reset possible CPUs in the prefill_possible_map(),
If CONFIG_HOTPLUG_CPU = y :
nr_possible_CPUs = num_processors + disabled_cpus.
Before the prefill_possible_map(), *Fix the inaccurate disabled_cpus*:
1) For each disabled CPUs, get it's processor id from ACPI MADT
2) Check whether this processor id is existed in ACPI namespace or not.
If false, disabled_cpus--;
I will show you the code and test it later. And IMO, the code logic in
prefill_possible_map() is a little mess, will try to sort it out first.
> So nr_unique_ids is not what it should be and even if it would be the code
> runs way too late. It needs to run _before_ setup_percpu() is invoked to
> scale everything correctly.
>
Yes, Got it.
Thanks,
dou
> Thanks,
>
> tglx
>
>
>
>
>
>
next prev parent reply other threads:[~2018-03-16 2:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 3:07 Dou Liyang
2018-03-15 13:45 ` Thomas Gleixner
2018-03-16 2:51 ` Dou Liyang [this message]
2018-03-19 6:28 ` [ACPI / processor] c1294b481b: WARNING:at_include/linux/cpumask.h:#invoke_rcu_core kernel test robot
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=cb79c370-8c6f-2ef7-9a0a-ed33bd485113@cn.fujitsu.com \
--to=douly.fnst@cn.fujitsu.com \
--cc=andy.shevchenko@gmail.com \
--cc=dedekind1@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®