Re: [PATCH v2] sched_ext: Update other_load_avgs on set_next_task_scx and idle entry
From: Tejun Heo
Date: Mon Nov 23 2026 - 04:47:09 EST
Hello, Peng.
On Sat, Nov 21, 2026 at 10:21:21PM -0800, Peng Huang wrote:
> If SCX_RQ_CAN_STOP_TICK stays unchanged (e.g., remaining set across an
> idle or RT interval on tickless CPUs, or remaining clear on finite-slice
> switches before a tick fires), or when an SCX task goes idle after an
> RT/DL interval without an intervening tick, stale RT/DL PELT values
> can remain elevated when consumers such as effective_cpu_util() or
> update_idle_rq_clock_pelt() read them.
I think this overstates the staleness. While the tick is running,
scx_tick() updates them on every tick, so they're at most a tick old,
at idle entry too. That's already a lot more often than fair, which
updates them at load balancing intervals.
> Refresh update_other_load_avgs() once at the entry of set_next_task_scx()
> (before SNT_REPICK early return and before ops.running() for SNT_PICK /
> SNT_NORMAL), and in put_prev_task_scx() when transitioning to the idle
> class.
update_other_load_avgs() isn't necessarily cheap and I don't think we
want to call it from scheduling hot paths. If anything, sched_ext is
already updating them too often and we should pace it down.
The actual hole is CPUs with the tick stopped, where nothing updates
them, and this patch doesn't address that.
Also, how was this tested? Is this from reading the code, or was the
effect observed or tested in some way?
Thanks.
--
tejun