All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuba Piecuch <jpiecuch@google.com>
To: sashiko-reviews@lists.linux.dev
Cc: sched-ext@lists.linux.dev
Subject: Re: [RFC PATCH 1/2] sched_ext: Reenqueue IMMED tasks when a higher class wins the pick
Date: Mon, 30 Nov 2026 11:19:15 +0000	[thread overview]
Message-ID: <20261130111711.2673199-2-jpiecuch@google.com> (raw)
In-Reply-To: <sashiko-outbox-233340@kernel.org>

On Wed, 25 Nov 2026 12:16, sashiko-bot@kernel.org wrote:
> With CONFIG_SCHED_CORE, can a sibling CPU miss scx_settle_pick() and leave
> SCX_ENQ_IMMED tasks stranded on its local DSQ when cookie matching falls
> back to its currently running higher-class task?

[...]

> Because rq_i never enters __schedule(), rq_i->next_class is not restored to
> rq_i->curr->sched_class and scx_settle_pick(rq_i) never runs, leaving the
> IMMED task on rq_i->scx.local_dsq while the higher-class task continues
> running and causing subsequent rq_is_open(rq_i, ...) checks to see
> rq_i->next_class == &ext_sched_class.

This looks real, although narrow. With a higher class task current on
rq_i, the core-wide pick only gets to do_pick_task_scx() on rq_i through
the ext dl_server, so the IMMED task competes with deadline priority.
Another sibling's task only wins max if it's a stop or deadline task, or
a dl_server pick with an earlier deadline.

It also predates this patch, since nothing reenqueued the task before
either. Still, the patch says core-sched siblings are covered, and they
aren't when the core pick for the sibling is its current task and it never
goes through __schedule(). The stale next_class is a problem on its own
too: rq_is_open() would accept a PREEMPT|IMMED insertion on rq_i while
the RT task keeps running.

One way to fix it is to have pick_next_task() restore rq_i->next_class
from the core pick when it skips resched_curr() for rq_i because
rq_i->curr == rq_i->core_pick, and run the same check as
scx_settle_pick() there. I'll look into it for v2.

  reply	other threads:[~2026-11-30 11:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 11:50 [RFC PATCHSET sched_ext/for-7.4-fixes] sched_ext: Reenqueue IMMED tasks when a higher class wins the pick Kuba Piecuch
2026-11-25 11:50 ` [RFC PATCH 1/2] " Kuba Piecuch
2026-11-25 12:16   ` sashiko-bot
2026-11-30 11:19     ` Kuba Piecuch [this message]
2026-11-27 15:10   ` Tejun Heo
2026-11-30 11:19     ` Kuba Piecuch
2026-11-30 15:11       ` Tejun Heo
2026-11-30 16:26         ` Kuba Piecuch
2026-11-25 11:50 ` [RFC PATCH 2/2] selftests/sched_ext: Add immed_strand test Kuba Piecuch

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=20261130111711.2673199-2-jpiecuch@google.com \
    --to=jpiecuch@google.com \
    --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 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.