From: Bradley Morgan <brads@mainlining.org>
To: salil.mehta@opnsrc.net
Cc: catalin.marinas@arm.com, corbet@lwn.net, gshan@redhat.com,
james.morse@arm.com, jic23@kernel.org,
linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, mark.rutland@arm.com,
peterz@infradead.org, ruanjinjie@huawei.com, tglx@kernel.org,
will@kernel.org, yangyicong@hisilicon.com
Subject: Re: [RFC PATCH 1/2] cpu/hotplug: Skip disabled CPUs in cpuhp_smt_enable
Date: Tue, 29 Sep 2026 21:16:08 +0100 [thread overview]
Message-ID: <133D63B7-B1DF-4DEB-92F6-B6D785D43457@mainlining.org> (raw)
In-Reply-To: <4ca071f1678acd1d3b8ecc0266938f59b45f629a.1790692295.git.salil.mehta@opnsrc.net>
On 29 September 2026 20:41:29 BST, salil.mehta@opnsrc.net wrote:
>From: Salil Mehta <salil.mehta@opnsrc.net>
>
>The CPU enabled mask describes whether a present CPU may currently be
>brought online. cpuhp_smt_enable() is an online operation, but currently
>walks all present CPUs and only filters CPUs that are already online or
>belong to offline NUMA nodes.
>
>This can make it attempt _cpu_up() for a present CPU which firmware has
>not enabled and which has not yet been registered as a CPU device.
>
>Use the enabled mask for the policy decision it was introduced to
>represent. This keeps present-but-disabled CPUs out of the SMT bring-up
>path while still allowing registered offline SMT threads to be brought
>back online.
>
>Present and enabled are separate generic CPU states, so callers which
>intend to bring CPUs online should not assume that every present CPU is
>enabled.
Ok.
>
>Signed-off-by: Salil Mehta <salil.mehta@opnsrc.net>
>---
> kernel/cpu.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/kernel/cpu.c b/kernel/cpu.c
>index b3c8553d7bd6..988b7a1e8298 100644
>--- a/kernel/cpu.c
>+++ b/kernel/cpu.c
>@@ -2706,8 +2706,9 @@ int cpuhp_smt_enable(void)
> cpu_maps_update_begin();
> cpu_smt_control = CPU_SMT_ENABLED;
> for_each_present_cpu(cpu) {
>- /* Skip online CPUs and CPUs on offline nodes */
>- if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
>+ /* Skip online/disabled CPUs and CPUs on offline nodes */
>+ if (cpu_online(cpu) || !cpu_enabled(cpu) ||
>+ !node_online(cpu_to_node(cpu)))
Ehh, have you had a issue with this code? Like something e.g: a splat.
> continue;
> if (!cpu_smt_thread_allowed(cpu) || !topology_is_core_online(cpu))
> continue;
>
--- Thanks!
"I'm not a very positive person" - Linus torvalds
next prev parent reply other threads:[~2026-09-29 20:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 19:41 [RFC PATCH 0/2] cpu/hotplug: use cpu_enabled_mask for SMT bringup salil.mehta
2026-09-29 19:41 ` [RFC PATCH 1/2] cpu/hotplug: Skip disabled CPUs in cpuhp_smt_enable salil.mehta
2026-09-29 20:16 ` Bradley Morgan [this message]
2026-09-30 8:42 ` Salil Mehta
2026-09-29 19:41 ` [RFC PATCH 2/2] Revert "cpu/hotplug: Fix NULL kobject warning in cpuhp_smt_enable()" salil.mehta
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=133D63B7-B1DF-4DEB-92F6-B6D785D43457@mainlining.org \
--to=brads@mainlining.org \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=gshan@redhat.com \
--cc=james.morse@arm.com \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=peterz@infradead.org \
--cc=ruanjinjie@huawei.com \
--cc=salil.mehta@opnsrc.net \
--cc=tglx@kernel.org \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.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