From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH sched_ext/for-7.4-fixes] sched_ext: Avoid unnecessary IMMED reenqueues on idle CPUs
Date: Wed, 28 Oct 2026 09:21:32 -1000 [thread overview]
Message-ID: <019648c2b11a3aa6a9b14723df813d65@kernel.org> (raw)
In-Reply-To: <20261028165258.3723153-1-arighi@nvidia.com>
Hello, Andrea.
On Wed, Oct 28, 2026 at 05:52:58PM +0100, Andrea Righi wrote:
> + /*
> + * A local insertion can raise next_class to ext while the donor is
> + * still idle, including after proxy_resched_idle(). The local DSQ head
> + * is next to run if its cookie matches, so keep it through IMMED reenq.
> + */
> + if (rq->donor == rq->idle) {
> + struct task_struct *first = first_local_task(rq);
> +
> + if (first && sched_cpu_cookie_match(rq, first))
> + return true;
> + }
Can you leave the core-sched cookie check out of this patch? IMMED
doesn't handle core scheduling correctly in other places either, e.g.
when core scheduling forces a CPU idle, nothing reenqueues the IMMED
tasks left on its local DSQ. Core sched should be addressed in its own
patch.
Also, the check as written doesn't work on an idle core.
sched_cpu_cookie_match() compares the task's cookie against
rq->core->core_cookie, which the core-wide pick sets from the
max-priority pick, so it's 0 when the whole core is idle. A task with a
cookie that wakes on an idle core fails the check and still gets
reenqueued even though the next core-wide pick would run it.
> - if (p->migration_pending)
> + if (p->migration_pending) {
> + reenq_flags |= SCX_REENQ_TSR_NOT_FIRST;
> continue;
> + }
>
> - if (!scx_is_descendant(task_sch, sch))
> + if (!scx_is_descendant(task_sch, sch)) {
> + reenq_flags |= SCX_REENQ_TSR_NOT_FIRST;
> continue;
> + }
Can you split this out into a separate patch? Skipped tasks not taking
the first position is a gap that has existed since the IMMED
implementation and is independent of the rq_is_open() change.
Thanks.
--
tejun
prev parent reply other threads:[~2026-10-28 19:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 16:52 [PATCH sched_ext/for-7.4-fixes] sched_ext: Avoid unnecessary IMMED reenqueues on idle CPUs Andrea Righi
2026-10-28 19:21 ` Tejun Heo [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=019648c2b11a3aa6a9b14723df813d65@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--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.