From: Srikar Dronamraju <srikar@linux.ibm.com>
To: Kayra Cizmeci <kayracizmeci@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Ben Segall <bsegall@google.com>,
Juri Lelli <juri.lelli@redhat.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
Mel Gorman <mgorman@suse.de>,
Steven Rostedt <rostedt@goodmis.org>,
Valentin Schneider <vschneid@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH] sched/fair: Skip sched-domain traversal when wake affine is disabled
Date: Tue, 10 Nov 2026 07:00:17 +0530 [thread overview]
Message-ID: <avJzqQEpKdU-GPrQ@linux.ibm.com> (raw)
In-Reply-To: <avH3rQ4W6d4jfny2@scheduler.schedules>
* Kayra Cizmeci <kayracizmeci@gmail.com> [2026-11-09 21:10:46]:
> On Mon, Nov 09, 2026 at 10:01:20PM +0530, Srikar Dronamraju wrote:
> > * Kayra Cizmeci <kayracizmeci@gmail.com> [2026-11-09 18:09:56]:
> >
> > Hi Kayra,
> >
> > >
> > > On Mon, Nov 09, 2026 at 05:35:22PM +0530, Srikar Dronamraju wrote:
> > > > In select_task_rq_fair(), TTWU wakeups for which wake_wide() returns
> > > > true, or where the waking CPU is not in the task's allowed CPU mask,
> > > > want_affine is set to false.
> > > >
> > >
> > >
> > > This just changes the behavior.
> > >
> > > Old Code WF_FORK 1, WF_TTWU 0:
> > >
> > > want_affine = 0, so we skip the first if block in the loop then leave
> > > once we find a domain without our flag. And go with slow path.
> > >
> > >
> > > New Code:
> > >
> > > want_affine is moved away and early exit is removed. So we enter the if
> > > block and try to find a domain with prev_cpu. Because WF_TTWU
> > > is 0, we just return new_cpu. Or if we can't fimd the domain with
> > > prev_cpu, slow path.
> > >
> >
> > When WF_TTWU is set, we are always suppose take the fast path.
> > slowpath is for WF_FORK and WF_EXEC.
>
> I know. And that is the exact problem with the above diff :-).
>
> Like let's say prev_cpu is in the first domain we are looking, the
> domain has SD_WAKE_AFFINE and SD_BALANCE_FORK set and next domain has
> only SD_WAKE_AFFINE set:
>
> Old Code:
>
> sd = first domain and we enter the slow path with the first domain.
>
> With your patch:
>
> sd = NULL and we return new_cpu
>
Oh thats a fair point, thanks for the reviewing it.
>
> Or am I missing something?
>
> Cheers,
>
> Kayra
--
Thanks and Regards
Srikar Dronamraju
prev parent reply other threads:[~2026-11-10 1:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 12:05 Srikar Dronamraju
2026-11-09 15:09 ` Kayra Cizmeci
2026-11-09 16:31 ` Srikar Dronamraju
2026-11-09 18:10 ` Kayra Cizmeci
2026-11-10 1:30 ` Srikar Dronamraju [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=avJzqQEpKdU-GPrQ@linux.ibm.com \
--to=srikar@linux.ibm.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kayracizmeci@gmail.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--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®