From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Vincent Guittot <vincent.guittot@linaro.org>, <mingo@redhat.com>,
<peterz@infradead.org>, <juri.lelli@redhat.com>,
<dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
<bsegall@google.com>, <mgorman@suse.de>, <vschneid@redhat.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched/eevdf: fix rb augmented with multi fields
Date: Wed, 9 Sep 2026 02:07:38 +0530 [thread overview]
Message-ID: <88404fc2-22e5-4792-9de3-ffce55e98055@amd.com> (raw)
In-Reply-To: <20260908135526.2783039-1-vincent.guittot@linaro.org>
Hello Vincent,
On 9/8/2026 7:25 PM, Vincent Guittot wrote:
> The eevdf rb tree maintains 3 augmented fields but only one is currently
> copied when balancing the tree.
>
> Add a more generic define that can be used when there are several augmented
> fields. In this case, we provide a function that takes care of copying all
> fields.
>
> Fixes: aef6987d8954 ("sched/eevdf: Propagate min_slice up the cgroup hierarchy")
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
I remember stumbling on this in
https://lore.kernel.org/lkml/20250220093257.9380-22-kprateek.nayak@amd.com/
but working around the problem in the scheduler layer instead.
Generic rb-tree layer extension makes more sense. Feel free to include:
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
[..snip.]
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index db5937d7e46e..019812c4fe32 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -1037,6 +1037,16 @@ static inline void __max_slice_update(struct sched_entity *se, struct rb_node *n
> }
> }
>
> +/*
> + * se->min_vruntime = min(se->vruntime, {left,right}->min_vruntime)
> + */
nit. Do we need this comment? It doesn't really describe the copy
callback.
> +static inline void min_vruntime_copy(struct sched_entity *new, struct sched_entity *old)
> +{
> + new->min_vruntime = old->min_vruntime;
> + new->min_slice = old->min_slice;
> + new->max_slice = old->max_slice;
> +}
> +
> /*
> * se->min_vruntime = min(se->vruntime, {left,right}->min_vruntime)
> */
The one over here above min_vruntime_update() makes sense and should
suffice IMO.
> @@ -1064,8 +1074,9 @@ static inline bool min_vruntime_update(struct sched_entity *se, bool exit)
> se->max_slice == old_max_slice;
> }
>
> -RB_DECLARE_CALLBACKS(static, min_vruntime_cb, struct sched_entity,
> - run_node, min_vruntime, min_vruntime_update);
> +
> +RB_DECLARE_CALLBACKS_MULTI(static, min_vruntime_cb, struct sched_entity,
> + run_node, min_vruntime_copy, min_vruntime_update);
>
> /*
> * Enqueue an entity into the rb-tree:
--
Thanks and Regards,
Prateek
next prev parent reply other threads:[~2026-09-08 20:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 13:55 Vincent Guittot
2026-09-08 20:37 ` K Prateek Nayak [this message]
2026-09-09 13:20 ` Vincent Guittot
2026-09-09 18:58 ` Kayra Cizmeci
2026-09-09 21:58 ` Peter Zijlstra
2026-09-10 5:59 ` Kayra Cizmeci
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=88404fc2-22e5-4792-9de3-ffce55e98055@amd.com \
--to=kprateek.nayak@amd.com \
--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=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®