Re: [PATCH 4/4] sched/fair: Rework/fix task_h_load()

From: Peter Zijlstra

Date: Mon Aug 31 2026 - 09:10:22 EST


On Mon, Aug 31, 2026 at 02:06:14PM +0200, Vincent Guittot wrote:
> On Mon, 31 Aug 2026 at 12:37, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > On Mon, Aug 31, 2026 at 12:10:42PM +0200, Vincent Guittot wrote:
> > > > +static inline void __update_cfs_rq_h_load(struct cfs_rq *cfs_rq,
> > > > + struct sched_entity *se,
> > > > + struct cfs_rq *p_cfs_rq)
> > > > +{
> > > > + unsigned long load = cfs_rq->avg.load_avg;
> > > > +
> > > > + if (cfs_rq != &cfs_rq->rq->cfs) {
> > >
> > > A comment explaining that the 2 belows are used for the case where
> > > for_each_sched_entity has not been called to set backlink would be
> > > helpful
> >
> > Fair enough; something like so?
>
> yes, looks good
>
> >
> > /*
> > * These last two arguments can be NULL then used outside of
> s/then/when/ ?

Just so, typing hard :/

> > * the for_each_sched_entity() hierarchy iteration. Like in
> > * __update_blocked_fair() where leaf_cfs_rq_list is iterated
> > * instead.
> > */