Re: [PATCH] sched/pelt: Skip dormant cfs util_sum under scx_switched_all

From: Peng Huang

Date: Mon Nov 23 2026 - 15:14:27 EST


On Mon, 23 Nov 2026 at 18:07, Vincent Guittot
<vincent.guittot@xxxxxxxxxx> wrote:
>
> Yes this seems a better solution but It would be good to reuse
> __update_blocked_fair() which already does the work for pelt signal.
> Regarding your issue with util_avg == 0 whereas we still have a
> util_sum != 0, we can use delta_sum = gcfs_rq->avg.util_sum -
> se->avg.util_sum; in update_tg_cfs_util() instead. When util_avg == 0
> we will be sure to clear util_sum too

Thanks for the suggestions, Vincent!

One small detail in update_tg_cfs_util(): under CONFIG_CFS_BANDWIDTH,
gcfs_rq and its parent cfs_rq can have different period_contrib, so for
non-zero util_avg we still want new_sum = se->avg.util_avg * divider
using the parent cfs_rq's divider. Keeping that calculation while only
skipping the update when gcfs_rq->avg.util_avg != 0 or
se->avg.util_sum == 0 preserves period_contrib alignment and clears
residual _sum whenever util_avg reaches 0 (and similarly in
update_tg_cfs_{runnable,load}()).

I have sent out a 2-patch v2 series implementing this along with reusing
__sched_balance_update_blocked_averages() in scx_enable():
[PATCH v2 0/2] sched_ext, sched/fair: Drain blocked fair load on scx_switched_all

Thanks,
Peng