The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Kuba Piecuch <jpiecuch@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] sched_ext: Reenqueue IMMED tasks when a higher class wins the pick
Date: Mon, 30 Nov 2026 05:11:48 -1000	[thread overview]
Message-ID: <2c4bde68cd5b1ad1bbb7a3cc7d3e3139@kernel.org> (raw)
In-Reply-To: <20261130111711.2673199-1-jpiecuch@google.com>

Hello, Kuba.

On Mon, Nov 30, 2026 at 11:19:14AM +0000, Kuba Piecuch wrote:
> I kept it for latency. The wakeup-time reenqueue returns the IMMED tasks
> to the BPF scheduler right away through the deferred irq_work or balance
> callback, so they can be moved to another CPU while curr is still on its
> way to a preemption point. With only scx_settle_pick(), they wait on the
> local DSQ until curr actually schedules, which can take a while if curr
> is in a preempt-off or IRQ-off section.

This is just from reading the code and I could be wrong, but AFAICS there
are three cases where wakeup_preempt_scx() finds an IMMED task on the
local DSQ which doesn't already have a reenqueue scheduled:

1. The CPU is idle and hasn't picked the task which was just inserted.

2. The CPU is in dispatch.

3. The task was inserted with SCX_ENQ_PREEMPT or SCX_ENQ_PREEMPT_LAZY and
   curr hasn't scheduled out yet.

In the first two, the CPU looks to be already on its way to the pick, so
I don't think there's much difference. In the last one, triggering from
wakeup_preempt_scx() may be a bit sooner, but that doesn't seem that
significant to me, especially given that the task was already waiting for
curr to schedule out, which is the latency the preempt path already
accepts. Am I missing something?

Thanks.

--
tejun

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

Thread overview: 6+ 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-27 15:10   ` Tejun Heo
2026-11-30 11:19     ` Kuba Piecuch
2026-11-30 15:11       ` Tejun Heo [this message]
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=2c4bde68cd5b1ad1bbb7a3cc7d3e3139@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=jpiecuch@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox