linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zengtao (B)" <prime.zeng@hisilicon.com>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>,
	"sudeep.holla@arm.com" <sudeep.holla@arm.com>
Cc: Linuxarm <linuxarm@huawei.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] cpu-topology: Skip the exist but not possible cpu nodes
Date: Tue, 7 Jan 2020 01:35:55 +0000	[thread overview]
Message-ID: <678F3D1BB717D949B966B68EAEB446ED340B5552@dggemm526-mbx.china.huawei.com> (raw)
In-Reply-To: <14a39167-5704-f406-614d-4d25b8fe8c68@arm.com>

> -----Original Message-----
> From: Dietmar Eggemann [mailto:dietmar.eggemann@arm.com]
> Sent: Tuesday, January 07, 2020 2:42 AM
> To: Zengtao (B); sudeep.holla@arm.com
> Cc: Linuxarm; Greg Kroah-Hartman; Rafael J. Wysocki;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] cpu-topology: Skip the exist but not possible cpu
> nodes
> 
> On 02/01/2020 04:24, Zeng Tao wrote:
> > When CONFIG_NR_CPUS is smaller than the cpu nodes defined in the
> device
> > tree, the cpu node parsing will fail. And this is not reasonable for a
> > legal device tree configs.
> > In this patch, skip such cpu nodes rather than return an error.
> 
> Is this extra code really necessary?
> 
> Currently you get warnings indicating that CONFIG_NR_CPUS is too small
> so you could correct the setup issue easily.
>

Not only about warning messages, the problem is :
What we are expected to do if the CONFIG_NR_CPUS is too small? I think there
are two choices:
1. Keep the dts parsing result, but skip the the CPU nodes whose id exceeds the 
the CONFIG_NR_CPUS, and this is what this patch do.
2. Just abort all the CPU nodes parsing, and using MPIDR to guess the topology, 
and this is what the current code do.
And i think choice 1 is better because:
1. It's a legal dts, we should keep the same result whether CONFIG_NR_CPUS is
too small or not.
2. In the function of_parse_and_init_cpus, we just do the same way as choice 1.

But i am open for the issue, any suggestions are welcomed.

Thanks
Zengtao 
 
> Example: Arm64 Juno board
> 
> $ grep "cpu@" ./arch/arm64/boot/dts/arm/juno.dts
> 		A57_0: cpu@0 {
> 		A57_1: cpu@1 {
> 		A53_0: cpu@100 {
> 		A53_1: cpu@101 {
> 		A53_2: cpu@102 {
> 		A53_3: cpu@103 {
> 
> root@juno:~# uname -r
> 5.5.0-rc5
> 
> root@juno:~# zcat /proc/config.gz | grep CONFIG_NR_CPUS
> CONFIG_NR_CPUS=4
> 
> root@juno:~# cat /proc/cpuinfo | grep ^proc
> processor       : 0
> processor       : 1
> processor       : 2
> processor       : 3
> 
> root@juno:~# dmesg | grep "Unable\|Can't"
> [    0.085089] Unable to find CPU node for /cpus/cpu@102
> [    0.090179] /cpus/cpu-map/cluster1/core2: Can't get CPU for leaf core
> 
> [...]

  reply	other threads:[~2020-01-07  1:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02  3:24 [PATCH] cpu-topology: Skip the exist but not possible cpu nodes Zeng Tao
2020-01-06 18:42 ` Dietmar Eggemann
2020-01-07  1:35   ` Zengtao (B) [this message]
2020-01-07 13:12     ` Dietmar Eggemann
2020-01-08  2:01       ` Zengtao (B)
2020-01-07 14:49 ` Sudeep Holla
2020-01-08  1:57   ` Zengtao (B)
2020-01-10 11:16     ` Sudeep Holla
2020-01-11  2:03       ` Zengtao (B)

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=678F3D1BB717D949B966B68EAEB446ED340B5552@dggemm526-mbx.china.huawei.com \
    --to=prime.zeng@hisilicon.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    /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).