Re: [PATCH v2] sched_ext: don't deliver duplicate ops.cgroup_set_idle() for same value

From: Tejun Heo

Date: Wed Sep 02 2026 - 14:54:32 EST


> ops.cgroup_set_idle() is documented to be invoked when a cgroup
> transitions between idle and non-idle states, and scx_group_set_weight()
> already skips value-preserving writes. scx_group_set_idle() delivers
> every write unconditionally, so rewriting an already-correct cpu.idle
> value feeds the BPF scheduler a transition callback each time, which
> toggle- or accounting-based schedulers miscount. Mirror the weight
> guard and only deliver on an actual change.

Applied to sched_ext/for-7.3-fixes with the subject capitalized and the
new comparison changed to tg->scx.idle, which is the field's name there:

- tg->scx.sched_idle != idle)
+ tg->scx.idle != idle)

The rename to tg->scx.sched_idle is on for-7.4 and the for-next merge
switches the comparison back.

Thanks.

--
tejun