All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Tao Cui <cui.tao@linux.dev>
Cc: 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: Tue, 06 Oct 2026 09:31:13 -1000	[thread overview]
Message-ID: <4bc0c5e88d602dcbc886b1214c676c8d@kernel.org> (raw)
In-Reply-To: <20261006142834.2815197-1-cui.tao@linux.dev>

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.

Thanks.

--
tejun

  parent reply	other threads:[~2026-10-06 19:31 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 [this message]
2026-10-08  4:37   ` Tao Cui

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=4bc0c5e88d602dcbc886b1214c676c8d@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=cui.tao@linux.dev \
    --cc=cuitao@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --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.