From: Tao Cui <cui.tao@linux.dev>
To: Tejun Heo <tj@kernel.org>
Cc: cui.tao@linux.dev, Tao Cui <cuitao@kylinos.cn>,
Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>,
David Vernet <void@manifault.com>,
linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev
Subject: Re: [PATCH v2] sched_ext: Reset cpuperf_target when a sub loses SCX_CAP_PERF or dies
Date: Thu, 8 Oct 2026 12:37:21 +0800 [thread overview]
Message-ID: <0cca2cd5-b45d-4658-a690-40e54720b952@linux.dev> (raw)
In-Reply-To: <4bc0c5e88d602dcbc886b1214c676c8d@kernel.org>
Hello Tejun,
在 2026/10/7 03:31, Tejun Heo 写道:
> Hello, Tao.
>
> On Tue, Oct 06, 2026 at 10:28:34PM +0800, Tao Cui wrote:
>> Fix it by restoring the neutral base that the root scheduler establishes
>> at enable time, at every point where a writer loses the ability to
>> write:
>
> I don't think the kernel should be picking a value here. The cpuperf target
> is last-writer-wins state with no owner tracking, and the only value the
> kernel ever imposes is the initialization at enable. If a parent grants
> SCX_CAP_PERF to a child, it should expect the child to have changed the
> targets, and restoring them after a revoke or in ops.sub_detach() is the
> parent's responsibility. The root holds every cap and a sub-sched parent
> holds PERF wherever it could grant it, so the rewrite always has the cap.
>
> There is a gap on the kernel side which makes that unreliable right now.
> ops.sub_detach() runs before the child's ops.exit() and before the child
> loses kfunc access, so a child timer or its ops.exit() can still write
> after the parent has cleaned up. I'll post a patch which drops the dying
> child's caps before ops.sub_detach() so that the child is inert by the time
> the parent is notified.
>
Fair points. I conflated "the kernel can see a writer go away" with
"the kernel should fix the value". Treating the cpuperf target as
last-writer-wins with enable-time initialization as the only value the
kernel imposes is a cleaner contract, and whoever granted the cap is
the right owner for restoring targets after a revoke. I'm dropping my
patch.
Thanks.
--
Tao
> Thanks.
>
> --
> tejun
prev parent reply other threads:[~2026-10-08 4:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 14:28 [PATCH v2] sched_ext: Reset cpuperf_target when a sub loses SCX_CAP_PERF or dies Tao Cui
2026-10-06 14:48 ` sashiko-bot
2026-10-06 19:31 ` Tejun Heo
2026-10-08 4:37 ` Tao Cui [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=0cca2cd5-b45d-4658-a690-40e54720b952@linux.dev \
--to=cui.tao@linux.dev \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=cuitao@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.