From: Peter Zijlstra <peterz@infradead.org>
To: Chuyi Zhou <zhouchuyi@bytedance.com>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
vschneid@redhat.com, kprateek.nayak@amd.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Use the task's cfs_rq for PELT on delayed wakeup
Date: Sat, 5 Dec 2026 00:33:13 +0100 [thread overview]
Message-ID: <20261204233313.GP2883950@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20261204122046.2745532-1-zhouchuyi@bytedance.com>
On Fri, Dec 04, 2026 at 08:20:46PM +0800, Chuyi Zhou wrote:
> A task's PELT averages are tracked on its group's cfs_rq. With CFS
> bandwidth control, that runqueue's PELT clock excludes time spent
> throttled.
>
> When a task marked for delayed dequeue wakes up, requeue_delayed_entity()
> uses the root cfs_rq for EEVDF placement and also passes it to
> update_load_avg(). If the group was previously throttled, the root clock
> can advance the task's last_update_time past the group clock. The next
> update on the group clock can then see a negative delta and reset the
> timestamp without accumulating load.
>
> Pass the task's cfs_rq to update_load_avg() on delayed wakeup.
>
> Fixes: 85570f10a4c6 ("sched/eevdf: Move to a single runqueue")
> Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 2d9d3d686261..40b8f96b6b4a 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8142,7 +8142,7 @@ requeue_delayed_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
> cfs_rq->h_nr_queued++;
> }
>
> - update_load_avg(cfs_rq, se, 0);
> + update_load_avg(cfs_rq_of(se), se, 0);
> clear_delayed(se);
> }
>
Right, so update_load_avg() is normally done by _entity functions on the
hierarchy part -- since we track load in the hierarchy.
However, this function *should* now be called requeue_delayed_task(),
and as you note the root cfs_rq and the task se are given.
So yes; this seems right. I'll apply the patch and munge in the rename
while there.
prev parent reply other threads:[~2026-12-04 23:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 12:20 [PATCH] sched/fair: Use the task's cfs_rq for PELT on delayed wakeup Chuyi Zhou
2026-12-04 18:02 ` Kayra Cizmeci
2026-12-04 23:33 ` Peter Zijlstra [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=20261204233313.GP2883950@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=zhouchuyi@bytedance.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.