[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240626082848.GZ31592@noisy.programming.kicks-ass.net>
Date: Wed, 26 Jun 2024 10:28:48 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Tejun Heo <tj@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>, mingo@...hat.com,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, bristot@...hat.com, vschneid@...hat.com,
ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
martin.lau@...nel.org, joshdon@...gle.com, brho@...gle.com,
pjt@...gle.com, derkling@...gle.com, haoluo@...gle.com,
dvernet@...a.com, dschatzberg@...a.com, dskarlat@...cmu.edu,
riel@...riel.com, changwoo@...lia.com, himadrics@...ia.fr,
memxor@...il.com, andrea.righi@...onical.com,
joel@...lfernandes.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org, kernel-team@...a.com
Subject: Re: [PATCH sched_ext/for-6.11] sched, sched_ext: Replace
scx_next_task_picked() with sched_class->switch_class()
On Tue, Jun 25, 2024 at 01:30:05PM -1000, Tejun Heo wrote:
> Hello,
>
> On Tue, Jun 25, 2024 at 09:49:35AM +0200, Peter Zijlstra wrote:
> > > Imagine a case where a sched_ext task was running but then a RT task wakes
> > > up on the CPU. We'd enter the scheduling path, RT's pick_next_task() would
> > > return the new RT task to run. We now need to tell the BPF scheduler that we
> > > lost the CPU to the RT task but haven't called its pick_next_task() yet.
> >
> > Bah, I got it backwards indeed. But in this case, don't you also need
> > something in pick_task() -- the whole core scheduling thing does much
> > the same.
>
> Yes, indeed we do, but because we're dispatching from the balance path, the
> cpu_acquire method is being called from there. Because who was running on
> the CPU before us is less interesting, @prev is not passed into
> cpu_acquire() but if that becomes necessary, it's already available there
> too.
I suppose I need to read more, because I'm not knowing what cpu_acquire
is :/ I do know I don't much like the asymmetry here, but maybe it makes
sense, dunno.
Powered by blists - more mailing lists