From: <Conor.Dooley@microchip.com>
To: <sudeep.holla@arm.com>, <mail@conchuod.ie>
Cc: <paul.walmsley@sifive.com>, <palmer@dabbelt.com>,
<palmer@rivosinc.com>, <aou@eecs.berkeley.edu>,
<catalin.marinas@arm.com>, <will@kernel.org>,
<gregkh@linuxfoundation.org>, <rafael@kernel.org>,
<Daire.McNamara@microchip.com>, <niklas.cassel@wdc.com>,
<damien.lemoal@opensource.wdc.com>, <geert@linux-m68k.org>,
<zong.li@sifive.com>, <kernel@esmil.dk>, <hahnjo@hahnjo.de>,
<guoren@kernel.org>, <anup@brainfault.org>,
<atishp@atishpatra.org>, <heiko@sntech.de>,
<philipp.tomsich@vrull.eu>, <robh@kernel.org>, <maz@kernel.org>,
<viresh.kumar@linaro.org>, <linux-riscv@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <Brice.Goglin@inria.fr>
Subject: Re: [PATCH v3 2/2] riscv: topology: fix default topology reporting
Date: Mon, 11 Jul 2022 16:28:28 +0000 [thread overview]
Message-ID: <6f96ad4b-6901-d5fd-9d55-2da9bdc925c3@microchip.com> (raw)
In-Reply-To: <20220711145941.q5rdrtavstjkp3km@bogus>
On 11/07/2022 15:59, Sudeep Holla wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On Sat, Jul 09, 2022 at 04:23:55PM +0100, Conor Dooley wrote:
>> From: Conor Dooley <conor.dooley@microchip.com>
>>
>> RISC-V has no sane defaults to fall back on where there is no cpu-map
>> in the devicetree.
>> Without sane defaults, the package, core and thread IDs are all set to
>> -1. This causes user-visible inaccuracies for tools like hwloc/lstopo
>> which rely on the sysfs cpu topology files to detect a system's
>> topology.
>>
>> On a PolarFire SoC, which should have 4 harts with a thread each,
>> lstopo currently reports:
>>
>> Machine (793MB total)
>> Package L#0
>> NUMANode L#0 (P#0 793MB)
>> Core L#0
>> L1d L#0 (32KB) + L1i L#0 (32KB) + PU L#0 (P#0)
>> L1d L#1 (32KB) + L1i L#1 (32KB) + PU L#1 (P#1)
>> L1d L#2 (32KB) + L1i L#2 (32KB) + PU L#2 (P#2)
>> L1d L#3 (32KB) + L1i L#3 (32KB) + PU L#3 (P#3)
>>
>> Adding calls to store_cpu_topology() in {boot,smp} hart bringup code
>> results in the correct topolgy being reported:
>>
>> Machine (793MB total)
>> Package L#0
>> NUMANode L#0 (P#0 793MB)
>> L1d L#0 (32KB) + L1i L#0 (32KB) + Core L#0 + PU L#0 (P#0)
>> L1d L#1 (32KB) + L1i L#1 (32KB) + Core L#1 + PU L#1 (P#1)
>> L1d L#2 (32KB) + L1i L#2 (32KB) + Core L#2 + PU L#2 (P#2)
>> L1d L#3 (32KB) + L1i L#3 (32KB) + Core L#3 + PU L#3 (P#3)
>>
>> CC: stable@vger.kernel.org
>> Fixes: 03f11f03dbfe ("RISC-V: Parse cpu topology during boot.")
>> Reported-by: Brice Goglin <Brice.Goglin@inria.fr>
>> Link: https://github.com/open-mpi/hwloc/issues/536
>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>> ---
>> ---
>> arch/riscv/Kconfig | 2 +-
>> arch/riscv/kernel/smpboot.c | 4 +++-
>> 2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> index 2af0701b7518..4b6c2fdbb57c 100644
>> --- a/arch/riscv/Kconfig
>> +++ b/arch/riscv/Kconfig
>> @@ -52,7 +52,7 @@ config RISCV
>> select COMMON_CLK
>> select CPU_PM if CPU_IDLE
>> select EDAC_SUPPORT
>> - select GENERIC_ARCH_TOPOLOGY if SMP
>> + select GENERIC_ARCH_TOPOLOGY
>
> I am not sure of !SMP as ARM64 is default SMP only. I have never reviewed
> the arch topology code with !SMP considered. I will leave that part to
> RISC-V developers.
>
I checked it on a D1 which is !SMP - no trouble booting and
the topology reporting seemed fine.
Thanks for the reviews,
Conor.
prev parent reply other threads:[~2022-07-11 16:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-09 15:23 [PATCH v3 0/2] Fix RISC-V's arch-topology reporting Conor Dooley
2022-07-09 15:23 ` [PATCH v3 1/2] arm64: topology: move store_cpu_topology() to shared code Conor Dooley
2022-07-11 14:35 ` Sudeep Holla
2022-07-11 14:50 ` Greg Kroah-Hartman
2022-07-11 15:24 ` Sudeep Holla
2022-07-11 16:39 ` Conor.Dooley
2022-07-09 15:23 ` [PATCH v3 2/2] riscv: topology: fix default topology reporting Conor Dooley
2022-07-11 14:59 ` Sudeep Holla
2022-07-11 16:28 ` Conor.Dooley [this message]
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=6f96ad4b-6901-d5fd-9d55-2da9bdc925c3@microchip.com \
--to=conor.dooley@microchip.com \
--cc=Brice.Goglin@inria.fr \
--cc=Daire.McNamara@microchip.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atishp@atishpatra.org \
--cc=catalin.marinas@arm.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=guoren@kernel.org \
--cc=hahnjo@hahnjo.de \
--cc=heiko@sntech.de \
--cc=kernel@esmil.dk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mail@conchuod.ie \
--cc=maz@kernel.org \
--cc=niklas.cassel@wdc.com \
--cc=palmer@dabbelt.com \
--cc=palmer@rivosinc.com \
--cc=paul.walmsley@sifive.com \
--cc=philipp.tomsich@vrull.eu \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=viresh.kumar@linaro.org \
--cc=will@kernel.org \
--cc=zong.li@sifive.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