mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Chen Pei <cp0613@linux.alibaba.com>
Cc: sudeep.holla@kernel.org, alex@ghiti.fr, aou@eecs.berkeley.edu,
	atishp@rivosinc.com, conor.dooley@microchip.com,
	guoren@kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org, palmer@dabbelt.com,
	pjw@kernel.org
Subject: Re: [PATCH] riscv: Populate boot CPU topology on UP kernels
Date: Wed, 21 Oct 2026 10:13:18 +0100	[thread overview]
Message-ID: <20261021-dilute-arrive-f7633eed8556@spud> (raw)
In-Reply-To: <20261020142630.1680-1-cp0613@linux.alibaba.com>

[-- Attachment #1: Type: text/plain, Size: 2067 bytes --]

On Tue, Oct 20, 2026 at 10:26:26PM +0800, Chen Pei wrote:
> On Tue, Oct 20, 2026 at 01:24:00PM +0100, Sudeep Holla wrote:
> > Commit 4b3dc9679cf7 ("arm64: force CONFIG_SMP=y and remove redundant #ifdefs")
> > removed UP support and made SMP default enabled.

Ah yes, I forgot about this..

> Thanks. RISC-V still allows UP: CONFIG_SMP is a plain bool with no
> default, yet arch/riscv/Kconfig selects GENERIC_ARCH_TOPOLOGY
> unconditionally while the only callers of init_cpu_topology() and
> store_cpu_topology() sit in smpboot.c, which is built only for
> CONFIG_SMP. That mismatch is what this patch closes.
> 
> Gating that select on SMP instead does not work. UP would then fall back
> to the cpumask_of(cpu) defaults in include/linux/topology.h and report
> the same sysfs, but vmlinux no longer links: arch_freq_scale,
> capacity_freq_ref, topology_scale_freq_tick and topology_set_freq_scale
> all become undefined references.
> 
> arch/riscv/include/asm/topology.h binds the arch_scale_freq_* and
> arch_set_freq_scale hooks to symbols that only drivers/base/arch_topology.c
> provides, and those defines suppress the generic fallbacks in
> kernel/sched/sched.h and include/linux/sched/topology.h. Making the
> gating work needs extra conditionals at several Kconfig and Makefile
> gates, and gives up freq and capacity invariance on UP, which is a much
> larger change than the twelve lines here.
> 
> Conor, and RISC-V maintainers: would you rather force CONFIG_SMP=y on
> RISC-V as well and drop UP altogether, or keep UP buildable and take
> this fix? I would keep the current approach unless you prefer the
> former.

I think we probably should drop CONFIG_SMP=N, but this patch would be
needed as a fix regardless since making SMP mandatory would be for 7.5
or later whereas fixing this is 7.4-rc content and should probably be
backported to stable.

FWIW, the patch looks reasonable to me, I was just wondering why arm64
didn't need it.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-10-21  9:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 13:10 Chen Pei
2026-10-14  8:47 ` Guo Ren
2026-10-20 10:23 ` Conor Dooley
2026-10-20 12:24   ` Sudeep Holla
2026-10-20 14:26     ` Chen Pei
2026-10-21  9:13       ` 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=20261021-dilute-arrive-f7633eed8556@spud \
    --to=conor@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=atishp@rivosinc.com \
    --cc=conor.dooley@microchip.com \
    --cc=cp0613@linux.alibaba.com \
    --cc=guoren@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=sudeep.holla@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

all inboxes | Powered by JetHome®