Re: [PATCH v3] sched/fair: remove dead code on enqueue_task_fair()
From: Kayra Cizmeci
Date: Thu Oct 15 2026 - 03:46:29 EST
> > I'm not entirely sure I follow. With the above fix there is still only
> > one place_entity(), which is after enqueue_hierarchy() and has
> > ENQUEUE_QUEUED on.
> Exactly.
> >
> > Here enqueue_hierarchy() adds the entity to h_nr_queued, and
> > ENQUEUE_QUEUED tells place_entity() exactly this, so it can adjust.
> ... but place_entity(ENQUEUE_QUEUED) still does:
>
> load = cfs_rq->sum_weight;
> if (curr && curr->on_rq) // <-- this is true after enqueue_hierarchy()
> load += avg_vruntime_weight(cfs_rq, curr->h_load.weight);
>
> weight = avg_vruntime_weight(cfs_rq, se->h_load.weight); // <- this assumes se isn't already part of cfs_rq weight, but it is (still)
> lag *= load + weight;
> ...
> (in this concrete enqueue()->dequeue() due to unthrottling case)
Fixing this requiers bit of a revert I think. Or something really close to a revert.
Peter/Christian, would you be OK if I send a fix about this with a revert
(that I caused :<) and a comment or one of you guys want to fix it your way?
And is there any cleaner way to fix these without a revert?
I also need to rebase this: https://lore.kernel.org/lkml/20261014150251.30099-1-kayracizmeci@xxxxxxxxx/
Thanks,
Kayra