From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
John Stultz <jstultz@google.com>,
sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH sched_ext/for-7.4] sched_ext: Keep proxy donors with slice left on the local DSQ
Date: Fri, 2 Oct 2026 21:38:08 +0200 [thread overview]
Message-ID: <asAIIDSdSjwEjir9@gpd4> (raw)
In-Reply-To: <59be0f173a7bc73a5a7eb6927f635605@kernel.org>
Hi Tejun,
On Fri, Oct 02, 2026 at 07:30:16AM -1000, Tejun Heo wrote:
> Hello, Andrea.
>
> On Thu, Oct 01, 2026 at 09:12:16PM +0200, Andrea Righi wrote:
> > + if ((p->scx.flags & SCX_TASK_IMMED) && !proxy_put) {
> > p->scx.flags |= SCX_TASK_REENQ_PREEMPTED;
> > scx_do_enqueue_task(rq, p, SCX_ENQ_REENQ, -1);
>
> I wonder whether IMMED should matter for a blocked donor at all. IMMED
> should trigger a reenqueue iff the task is not being serviced by a CPU. A
> donor under proxy execution is being serviced. The CPU is working on its
> behalf and there's nothing the scheduler can do to make it go faster by
> placing it elsewhere. If so, a donor with slice left can stay on the local
> DSQ regardless of IMMED and of which put this is, and
> SCX_RQ_PROXY_PICK_PENDING isn't needed. The deferred local check would need
> the same exemption as the task stays SCX_TASK_IMMED.
I think you're right, the donor's progress depends on its mutex owner, so
re-enqueuing the donor alone can't make it run sooner. Therefore we can just
keep it local, remove SCX_RQ_PROXY_PICK_PENDING and simplify the code.
>
> > + /* Delegate retained donor admission to its owning BPF scheduler. */
> > + if (p->is_blocked) {
> > + if (WARN_ON_ONCE(!sch))
> > + goto switch_class;
> > + WARN_ON_ONCE(!(sch->ops.flags & SCX_OPS_ENQ_BLOCKED));
> > + scx_do_enqueue_task(rq, p, 0, -1);
> > + goto switch_class;
> > + }
>
> Can this be folded into the following block? scx_do_enqueue_task() already
> adds SCX_ENQ_BLOCKED, so a !p->is_blocked test on the ENQ_LAST condition
> would route donors to the plain enqueue.
Agreed.
Thanks!
-Andrea
prev parent reply other threads:[~2026-10-02 19:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 19:12 Andrea Righi
2026-10-02 17:30 ` Tejun Heo
2026-10-02 19:38 ` Andrea Righi [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=asAIIDSdSjwEjir9@gpd4 \
--to=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=jstultz@google.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®