The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	sched-ext@lists.linux.dev, David Vernet <void@manifault.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: Sat, 28 Nov 2026 20:45:54 +0100	[thread overview]
Message-ID: <awsvcv8karmimVyB@gpd4> (raw)
In-Reply-To: <awmlUc3KmK8uSQoz@slm.duckdns.org>

Hi Tejun,

On Fri, Nov 27, 2026 at 05:44:17AM -1000, Tejun Heo wrote:
> On Wed, Nov 25, 2026 at 06:56:14AM -1000, Tejun Heo wrote:
> > Hello, Peter.
> > 
> > On Wed, Nov 25, 2026 at 02:57:23PM +0100, Peter Zijlstra wrote:
> > > 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?
> > 
> > The problem is that runnable tasks may not be on any DSQ. The BPF scheduler
> > can hold tasks in its own data structures between ops.enqueue() and
> > ops.dispatch(), and the newer schedulers do. Also, only local DSQs have
> > target CPUs. Any CPU's ops.dispatch() can consume from a user DSQ. So, all
> > the kernel can tell is that something is runnable, and only ops.dispatch()
> > knows which CPU it is for.
> 
> Any thoughts on this?

How about starting the ext_server on local DSQ insertion and when BPF
kicks a target CPU (including SCX_KICK_IDLE)?

For local DSQs, rq_owned_post_enq() already holds the destination rq
lock. For shared DSQs or BPF-held tasks, BPF can identify a consumer
by kicking it after publishing the work. Most scx schedulers already
request an SCX_KICK_IDLE after shared-DSQ insertion, so they would be
covered.

We would need to start the server rather than discard the kick when a
higher-class task is running, including in the idle-kick skip path. The
DL reservation would govern when SCX actually gets to dispatch.

This would avoid the global accounting and periodic probing of unrelated
CPUs and wouldn't depend on a running tick. Would that be an acceptable
tradeoff?

Thanks,
-Andrea

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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 10:34 [PATCHSET sched_ext/for-7.5] sched_ext: Start ext_server from the tick 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 ` [PATCHSET sched_ext/for-7.5] sched_ext: Start ext_server from the tick Peter Zijlstra
2026-11-25 16:56   ` Tejun Heo
2026-11-27 15:44     ` Tejun Heo
2026-11-28 19:45       ` 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=awsvcv8karmimVyB@gpd4 \
    --to=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=peterz@infradead.org \
    --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