mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tejun Heo <tj@kernel.org>
Cc: sched-ext@lists.linux.dev, David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	David Dai <david.dai@linux.dev>, Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	Hang Zhengyang <hang.zhengyang1010@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCHSET sched_ext/for-7.5] sched_ext: Start ext_server from the tick
Date: Wed, 25 Nov 2026 14:57:23 +0100	[thread overview]
Message-ID: <20261125135723.GD2668804@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20261125103420.2785659-1-tj@kernel.org>

On Wed, Nov 25, 2026 at 12:34:18AM -1000, Tejun Heo wrote:
> Hello,
> 
> ext_server starts when the first task is enqueued on a CPU's rq and stops
> when its pick finds no task. As the BPF scheduler can run a task on any CPU
> whichever rq it is queued on, tasks can wait for a CPU whose ext_server has
> stopped with no enqueue to start it again, and a higher class task which
> keeps the CPU starves them until the watchdog fires. scx_central with a
> SCHED_FIFO task spinning on a CPU shows it.
> 
> Peter pointed out the problem when ext_server was being added [1]. Hang's
> recent patch which starts ext_server on every enqueue [2] helps but leaves
> cases like the above.
> 
> This patchset also starts ext_server from the tick, while a higher class
> task is running on the CPU:
> 
> - If the local DSQ has a task, right away. This covers a task which another
>   CPU inserts after the pick came up empty.
> 
> - Otherwise, if any task is runnable on SCX, at most once a server period.
>   Only ops.dispatch() can tell whether the BPF scheduler has a task for the
>   CPU, and the server's pick calls it.
> 
> Whether any task is runnable comes from per-node counts of rqs which have
> tasks, which a per-node timer lowers lazily, and a global count of such
> nodes, which is all the tick reads.
> 
> This is a departure from how dl servers are usually driven and there may be
> better ways to go about it, but it does seem to solve the problem properly
> without adding much overhead.

This is all pretty awful; at the same time I don't really know if I
have a better solution at hand either :(

Could you perhaps punt the responsibility to the DSQ? Each DSQ has both:

 - a count of how many tasks it has
 - a sense of what CPUs it targets

Right? So can it make sure nr_tasks CPUs of its destination are running
ext_server?

That might avoid all this extra accounting and timers you're adding just
to keep stuff 'running.

      parent reply	other threads:[~2026-11-25 13:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 10:34 Tejun Heo
2026-11-25 10:34 ` [PATCH 1/2] sched_ext: Start ext_server from the tick while a higher class holds the CPU Tejun Heo
2026-11-25 10:34 ` [PATCH 2/2] sched_ext: Start ext_server from the remote tick on nohz_full CPUs Tejun Heo
2026-11-25 13:57 ` Peter Zijlstra [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=20261125135723.GD2668804@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=arighi@nvidia.com \
    --cc=bsegall@google.com \
    --cc=changwoo@igalia.com \
    --cc=david.dai@linux.dev \
    --cc=dietmar.eggemann@arm.com \
    --cc=emil@etsalapatis.com \
    --cc=hang.zhengyang1010@gmail.com \
    --cc=joelagnelf@nvidia.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=void@manifault.com \
    --cc=vschneid@redhat.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®