Re: [PATCH 5/6] tools/sched_ext: scx_flatcg: Don't strand a cgroup on the ENQ_RACE path
From: Tejun Heo
Date: Thu Nov 12 2026 - 13:16:29 EST
Hello, Tao.
On Thu, Nov 12, 2026 at 09:09:33PM +0800, Tao Cui wrote:
> Instead of bailing out, wait for the picker to resolve and retry:
> grabbing the node when it's stashed back, or bailing out when the
> picker has re-added the cgroup to the rbtree. Exhausted retries mean
> the cgroup is in the common cases either going away with its node
> dropped or already back on the rbtree; a narrow window with the picker
> still holding the node in flight can strand the cgroup the same way
> the unpatched code does, at a rate orders of magnitude below stock.
This doesn't actually fix the race. I can still reproduce the stall with the
patch applied.
Maybe just add a comment noting the race? scx_flatcg isn't expected to be
used for actual usage anyway, and things like this can be done a lot better
now using arena data structures.
Thanks.
--
tejun