Re: [PATCH v3] sched: Lift cgroup update locking to core to prevent CFS/SCX divergence

From: Tejun Heo

Date: Mon Aug 31 2026 - 20:23:19 EST


Hello,

On Mon, Aug 24, 2026 at 07:49:13AM +0000, Michal Blaszczyk wrote:
> Concurrent writes to cgroup control files (such as cpu.shares or
> cpu.weight) can lead to state divergence between CFS and SCX.
>
> For instance, in cpu_shares_write_u64(), the CFS update is serialized
> by shares_mutex (internal to fair.c), but this lock is dropped before
> scx_group_set_weight() is called. The latter only acquires a read
> semaphore (scx_cgroup_ops_rwsem), allowing multiple threads to evaluate
> and act on the sched_ext update concurrently.
...
> Fixes: 819513666966 ("sched_ext: Add cgroup support")
> Signed-off-by: Michal Blaszczyk <michalblk@xxxxxxxxxx>

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Peter, would you mind picking this up?

Thanks.

--
tejun