From: Peter Zijlstra <peterz@infradead.org>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Valentin Schneider <vschneid@redhat.com>,
Chris Mason <clm@meta.com>,
Madadi Vineeth Reddy <vineethr@linux.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] sched/fair: Reimplement NEXT_BUDDY to align with EEVDF goals
Date: Fri, 14 Nov 2025 13:13:49 +0100 [thread overview]
Message-ID: <20251114121349.GG4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <q3krlyukweyfrabk2soxryx74mjl6yljqfm7nhfrhudbv47q4p@62unggrnbydk>
On Thu, Nov 13, 2025 at 09:04:38AM +0000, Mel Gorman wrote:
> On Wed, Nov 12, 2025 at 03:48:23PM +0100, Peter Zijlstra wrote:
> > On Wed, Nov 12, 2025 at 12:25:21PM +0000, Mel Gorman wrote:
> >
> > > + /* Prefer picking wakee soon if appropriate. */
> > > + if (sched_feat(NEXT_BUDDY) &&
> > > + set_preempt_buddy(cfs_rq, wake_flags, pse, se)) {
> > > +
> > > + /*
> > > + * Decide whether to obey WF_SYNC hint for a new buddy. Old
> > > + * buddies are ignored as they may not be relevant to the
> > > + * waker and less likely to be cache hot.
> > > + */
> > > + if (wake_flags & WF_SYNC)
> > > + preempt_action = preempt_sync(rq, wake_flags, pse, se);
> > > + }
> >
> > Why only do preempt_sync() when NEXT_BUDDY? Nothing there seems to
> > depend on buddies.
>
> There isn't a direct relation, but there is an indirect one. I know from
> your previous review that you separated out the WF_SYNC but after a while,
> I did not find a good reason to separate it completely from NEXT_BUDDY.
>
> NEXT_BUDDY updates cfs_rq->next if appropriate to indicate there is a waker
> relationship between two tasks and potentially share data that may still
> be cache resident after a context switch. WF_SYNC indicates there may be
> a strict relationship between those two tasks that the waker may need the
> wakee to do some work before it can make progress. If NEXT_BUDDY does not
> set cfs_rq->next in the current waking context then the wakee may only be
> picked next by coincidence under normal EEVDF rules.
Aah, fair enough. Perhaps the comment could've been clearer but
whatever.
next prev parent reply other threads:[~2025-11-14 12:13 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 12:25 [PATCH 0/2 v5] Reintroduce NEXT_BUDDY for EEVDF Mel Gorman
2025-11-12 12:25 ` [PATCH 1/2] sched/fair: Enable scheduler feature NEXT_BUDDY Mel Gorman
2025-11-14 12:19 ` [tip: sched/core] " tip-bot2 for Mel Gorman
2025-11-17 16:23 ` tip-bot2 for Mel Gorman
[not found] ` <20251112122521.1331238-3-mgorman@techsingularity.net>
2025-11-12 14:48 ` [PATCH 2/2] sched/fair: Reimplement NEXT_BUDDY to align with EEVDF goals Peter Zijlstra
2025-11-13 8:26 ` Madadi Vineeth Reddy
2025-11-13 9:04 ` Mel Gorman
2025-11-14 12:13 ` Peter Zijlstra [this message]
2025-11-14 12:19 ` [tip: sched/core] " tip-bot2 for Mel Gorman
2025-11-17 16:23 ` tip-bot2 for Mel Gorman
2025-12-22 10:57 ` [REGRESSION] " Ryan Roberts
2026-01-02 12:38 ` Ryan Roberts
2026-01-02 15:52 ` Dietmar Eggemann
2026-01-05 11:45 ` Ryan Roberts
2026-01-05 14:38 ` Shrikanth Hegde
2026-01-05 16:33 ` Ryan Roberts
2026-01-07 15:30 ` Dietmar Eggemann
2026-01-08 8:50 ` Mel Gorman
2026-01-08 13:15 ` Ryan Roberts
2026-01-09 10:15 ` Ryan Roberts
2026-01-12 7:47 ` Peter Zijlstra
2026-01-12 8:52 ` Ryan Roberts
2026-01-12 9:57 ` Peter Zijlstra
2026-01-12 10:27 ` Ryan Roberts
2026-01-13 6:31 ` K Prateek Nayak
2026-01-15 10:16 ` Mel Gorman
2026-01-08 10:01 ` [REGRESSION] [PATCH 0/2 v5] Reintroduce NEXT_BUDDY for EEVDF Madadi Vineeth Reddy
-- strict thread matches above, loose matches on Subject: below --
2025-11-03 11:04 [PATCH 0/2 v4] " Mel Gorman
2025-11-03 11:04 ` [PATCH 2/2] sched/fair: Reimplement NEXT_BUDDY to align with EEVDF goals Mel Gorman
2025-11-03 14:07 ` Peter Zijlstra
2025-11-03 14:14 ` Peter Zijlstra
2025-11-05 21:48 ` Madadi Vineeth Reddy
2025-11-07 8:53 ` Mel Gorman
[not found] <20251027133915.4103633-1-mgorman@techsingularity.net>
2025-10-27 13:39 ` Mel Gorman
2025-10-28 15:05 ` Peter Zijlstra
2025-10-31 9:46 ` Mel Gorman
2025-10-28 15:09 ` Peter Zijlstra
2025-10-31 9:48 ` Mel Gorman
2025-10-28 15:33 ` Peter Zijlstra
2025-10-28 15:47 ` Peter Zijlstra
2025-10-30 9:10 ` Peter Zijlstra
2025-10-31 10:27 ` Mel Gorman
2025-10-21 14:28 [RFC PATCH 0/2] Reintroduce NEXT_BUDDY for EEVDF v2 Mel Gorman
2025-10-21 14:28 ` [PATCH 2/2] sched/fair: Reimplement NEXT_BUDDY to align with EEVDF goals Mel Gorman
2025-10-23 6:29 ` K Prateek Nayak
[not found] <20250714134429.19624-1-mgorman@techsingularity.net>
2025-07-14 13:44 ` Mel Gorman
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=20251114121349.GG4067720@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=clm@meta.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=mingo@redhat.com \
--cc=vineethr@linux.ibm.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