From: Andrea Righi <andrea.righi@linux.dev>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
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>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched_ext: Always call put_prev_task() with scx enabled
Date: Mon, 14 Oct 2024 17:43:33 +0200 [thread overview]
Message-ID: <Zw08JUlsm7b8xZk8@gpd3> (raw)
In-Reply-To: <20241014083608.GU17263@noisy.programming.kicks-ass.net>
On Mon, Oct 14, 2024 at 10:36:08AM +0200, Peter Zijlstra wrote:
...
> > @@ -2523,6 +2508,21 @@ DECLARE_STATIC_KEY_FALSE(__scx_switched_all); /* all fair class tasks on SCX */
> > #define scx_switched_all() false
> > #endif /* !CONFIG_SCHED_CLASS_EXT */
> >
> > +static inline void put_prev_set_next_task(struct rq *rq,
> > + struct task_struct *prev,
> > + struct task_struct *next)
> > +{
> > + WARN_ON_ONCE(rq->curr != prev);
> > +
> > + __put_prev_set_next_dl_server(rq, prev, next);
> > +
> > + if (next == prev && !scx_enabled())
> > + return;
>
> Does that not also want to include a 'next->sched_class ==
> &ext_sched_class' clause ? And a comment?
>
> > +
> > + prev->sched_class->put_prev_task(rq, prev, next);
> > + next->sched_class->set_next_task(rq, next, true);
> > +}
>
> And is there really no way scx can infer this happened? We just did pick
> after all, that can see this coming a mile of.
Ah, I believe I understand better what's happening now.
When prev == next with the idle class we're not calling
->put_prev_task/set_next_task anymore, so we may skip calling
ops.update_idle() in scx.
I think that's the only special case that we need to handle, and we may
be able to solve the regression by calling scx_update_idle() from
pick_task_idle().
Will do some testing with this.
-Andrea
prev parent reply other threads:[~2024-10-14 15:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-13 17:39 [PATCH] sched_ext: Always call put_prev_task() with scx enabled Andrea Righi
2024-10-14 8:36 ` Peter Zijlstra
2024-10-14 15:00 ` Andrea Righi
2024-10-14 15:43 ` 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=Zw08JUlsm7b8xZk8@gpd3 \
--to=andrea.righi@linux.dev \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--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