From: Tejun Heo <tj@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: sashiko-bot@kernel.org, sched-ext@lists.linux.dev
Subject: Re: [PATCH 5/6] sched_ext: Report the ecaps loss when a cpu goes offline
Date: Sat, 17 Oct 2026 08:43:47 -1000 [thread overview]
Message-ID: <6ee796c005fe3cf9d5c3d29aecde0079@kernel.org> (raw)
In-Reply-To: <sashiko-outbox-175737@kernel.org>
Hello,
On Sat, Oct 17, 2026 at 06:14:02PM +0000, sashiko-bot@kernel.org wrote:
> The comment notes that scx_enabled() cannot change during hotplug, and that
> without a live root the ext class will not be picked and the wait would never
> end. However, static_branch_disable(&__scx_enabled) in scx_root_disable() runs
> before cpus_read_lock() is acquired.
static_branch_disable() takes cpus_read_lock() itself in
static_key_disable(), so the flip waits until the cpu down releases
cpus_write_lock(). scx_enabled() stays true across the down.
> If the offline CPU had not yet picked ext_sched_class before __scx_enabled was
> disabled and ext_server was detached (for instance, while a fair or RT task
> was running during ext_server's dl_defer window), __scx_process_sync_ecaps()
> will never be called on that rq.
The drain doesn't depend on the ext server. scx_offline_ecaps() runs
from sched_cpu_deactivate() after balance_push_set(), so once the
hotplug thread sleeps in the wait, balance_push() moves every task but
per-cpu kthreads and migration-disabled ones off the cpu. With
scx_enabled() still true, the cpu's first pick with no fair task left
runs the ext pick, whose dispatch_one() processes the marked sync.
Only a per-cpu kthread or a migration-disabled task that never sleeps
could hold it off after the ext server is detached, and that would be a
bug of its own.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-10-17 18:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 16:45 [PATCHSET v2 sched_ext/for-7.4] sched_ext: Report a sub-scheduler's ecaps on attach, detach and cpu hotplug Tejun Heo
2026-10-17 16:45 ` [PATCH 1/6] sched_ext: Factor out cid_pshard() Tejun Heo
2026-10-17 16:45 ` [PATCH 2/6] sched_ext: Free a sub-scheduler a grace period after discarding its ecaps syncs Tejun Heo
2026-10-17 16:45 ` [PATCH 3/6] sched_ext: Report a sub-scheduler's ecaps on attach and detach Tejun Heo
2026-10-17 17:29 ` sashiko-bot
2026-10-17 16:45 ` [PATCH 4/6] sched_ext: Deliver ecaps only while the root has the cpu online Tejun Heo
2026-10-17 16:45 ` [PATCH 5/6] sched_ext: Report the ecaps loss when a cpu goes offline Tejun Heo
2026-10-17 18:14 ` sashiko-bot
2026-10-17 18:43 ` Tejun Heo [this message]
2026-10-17 16:45 ` [PATCH 6/6] sched_ext: Leave suspend and hibernation out of the ecaps reports Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2026-10-18 1:59 [PATCHSET v3 sched_ext/for-7.4] sched_ext: Report a sub-scheduler's ecaps on attach, detach and cpu hotplug Tejun Heo
2026-10-18 1:59 ` [PATCH 5/6] sched_ext: Report the ecaps loss when a cpu goes offline Tejun Heo
2026-10-18 6:49 ` Andrea Righi
2026-10-18 8:15 ` Tejun Heo
2026-10-18 7:01 ` Andrea Righi
2026-10-18 8:16 ` Tejun Heo
2026-10-18 9:18 ` Andrea Righi
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=6ee796c005fe3cf9d5c3d29aecde0079@kernel.org \
--to=tj@kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
/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