From: sashiko-bot@kernel.org
To: "Cheng-Yang Chou" <yphbchou0911@gmail.com>, sched-ext@lists.linux.dev
Subject: Re: [PATCH sched_ext/for-7.5] sched_ext/idle: Skip nodes without CPUs
Date: Sun, 29 Nov 2026 16:47:48 +0000 [thread overview]
Message-ID: <sashiko-outbox-239803@kernel.org> (raw)
In-Reply-To: <20261129163536.15478-1-yphbchou0911@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] sched_ext: missed update_idle_cpu_nodes() on hotplug during
enable
--
commit 49bd96c9c4b1ca8a5782568b9a5893b41d485588
Author: Cheng-Yang Chou <yphbchou0911@gmail.com>
sched_ext/idle: Skip nodes without CPUs
This commit maintains a nodemask of NUMA nodes that have at least one
active CPU (scx_idle_cpu_nodes) and restricts cross-node idle CPU
searches in pick_idle_cpu_from_online_nodes() to those nodes instead of
all online nodes.
> diff --git a/kernel/sched/ext/idle.c b/kernel/sched/ext/idle.c
> index 922fbc3065ccf..73af83231f747 100644
> --- a/kernel/sched/ext/idle.c
> +++ b/kernel/sched/ext/idle.c
[ ... ]
> @@ -414,6 +434,8 @@ void scx_idle_update_selcpu_topology(struct sched_ext_ops *ops)
> static_branch_enable_cpuslocked(&scx_selcpu_topo_numa);
> else
> static_branch_disable_cpuslocked(&scx_selcpu_topo_numa);
> +
> + update_idle_cpu_nodes();
> }
>
> /*
[Severity: Medium]
Can scx_idle_cpu_nodes become stale if a CPU hotplug event occurs while
a scheduler is being enabled?
scx_root_enable_workfn() calls scx_idle_update_selcpu_topology() right
before cpus_read_unlock(), well before enabling __scx_enabled:
kernel/sched/ext/ext.c:scx_root_enable_workfn() {
...
for (i = SCX_OPI_CPU_HOTPLUG_BEGIN; i < SCX_OPI_CPU_HOTPLUG_END; i++)
if (((void (**)(void))ops)[i])
set_bit(i, sch->has_op);
ret = check_hotplug_seq(sch, ops);
if (ret) {
cpus_read_unlock();
goto err_disable;
}
scx_idle_update_selcpu_topology(ops);
cpus_read_unlock();
...
}
If a CPU comes online or goes offline after cpus_read_unlock() and
before static_branch_enable(&__scx_enabled) (while tasks are being
initialized), handle_hotplug() skips scx_idle_update_selcpu_topology()
because scx_enabled() is still false:
kernel/sched/ext/ext.c:handle_hotplug() {
...
if (unlikely(!sch))
return;
if (scx_enabled())
scx_idle_update_selcpu_topology(&sch->ops);
...
}
When the scheduler has ops.cpu_online or ops.cpu_offline defined, the
hotplug transition is accepted without aborting enablement, leaving
scx_idle_cpu_nodes out of sync with cpu_active_mask once the scheduler
goes live. If the first active CPU on a node came online during that
window, pick_idle_cpu_from_online_nodes() will skip that node until the
next hotplug event.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261129163536.15478-1-yphbchou0911@gmail.com?part=1
next prev parent reply other threads:[~2026-11-29 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 16:35 [PATCH sched_ext/for-7.5] sched_ext/idle: Skip nodes without CPUs Cheng-Yang Chou
2026-11-29 16:47 ` sashiko-bot [this message]
2026-11-29 16:59 ` Tejun Heo
2026-11-30 18:03 ` Cheng-Yang Chou
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=sashiko-outbox-239803@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
--cc=yphbchou0911@gmail.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