From: Sudeep Holla <sudeep.holla@arm.com>
To: Zeng Tao <prime.zeng@hisilicon.com>
Cc: linuxarm@huawei.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] cpu-topology: Skip the exist but not possible cpu nodes
Date: Thu, 16 Jan 2020 12:24:31 +0000 [thread overview]
Message-ID: <20200116122420.GA40666@bogus> (raw)
In-Reply-To: <1579139255-29262-1-git-send-email-prime.zeng@hisilicon.com>
Sorry for being pedantic and not mentioning this earlier. Can you improve
the $subject. I prefer:
cpu-topology: Don't error on more than CONFIG_NR_CPUS CPUs in device tree
On Thu, Jan 16, 2020 at 09:47:35AM +0800, Zeng Tao wrote:
> When CONFIG_NR_CPUS is smaller than the cpu nodes defined in the device
> tree, all the cpu nodes 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.
>
Also the commit log to be:
"
When the kernel is configured with CONFIG_NR_CPUS smaller than the
number of CPU nodes in the device tree(DT), all the CPU nodes parsing
done to fetch topology information will fail. This is not reasonable
as it is legal to have all the physical CPUs in the system in the DT.
Let us just skip such CPU DT nodes that are not used in the kernel
rather than returning an error.
"
> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
> ---
> Changelog:
> v2->v3:
> -Fix the Review comments by sudeep, including fix typo, remove redundant check
> logic, change the warning print level etc.
> v1->v2:
> -Remove redundant -ENODEV assignment in get_cpu_for_node
> -Add comment to describe the get_cpu_for_node return values
> -Add skip process for cpu threads
> -Update the commit log with more detail
> ---
> drivers/base/arch_topology.c | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 5fe44b3..d4302a1 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -248,6 +248,16 @@ core_initcall(free_raw_capacity);
> #endif
>
> #if defined(CONFIG_ARM64) || defined(CONFIG_RISCV)
> +/*
> + * This function returns the logic cpu number of the node.
> + * There are basically three kinds of return values:
> + * (1) logic cpu number which is > 0.
> + * (2) -ENODEV when the node is valid one which can be found in the device tree
> + * but there is no possible cpu nodes to match, when the CONFIG_NR_CPUS is
> + * smaller than cpus node numbers in device tree, this will happen. It's
> + * suggested to just ignore this case.
I prefer (2) to be reword as below:
"
-ENODEV when the device tree(DT) node is valid and found in the DT but
there is no possible logical CPU in the kernel to match. This happens
when CONFIG_NR_CPUS is configure to be smaller than the number of CPU
nodes in DT. We need to just ignore this case.
"
With all these changes you can stick:
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
next prev parent reply other threads:[~2020-01-16 12:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 1:47 [PATCH v3] cpu-topology: Skip the exist but not possible cpu nodes Zeng Tao
2020-01-16 12:24 ` Sudeep Holla [this message]
2020-01-17 1:32 ` 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=20200116122420.GA40666@bogus \
--to=sudeep.holla@arm.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=prime.zeng@hisilicon.com \
--cc=rafael@kernel.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