Re: [PATCH sched_ext/for-7.3-fixes 4/4] sched_ext: scx_qmap: Place only on cids whose caps are in effect

From: Andrea Righi

Date: Sat Sep 05 2026 - 15:26:27 EST


On Sat, Sep 05, 2026 at 06:40:32AM -1000, Tejun Heo wrote:
> Hello,
>
> > This is a pre-existing issue, but can lockless readers observe a transiently
> > zeroed qa.self_cids.mask here and incorrectly fall through to the rescue block?
>
> Yes, but scx_qmap is an example scheduler and the result is a spurious rescue
> insert, which isn't critical. The race is acceptable.

BTW, while looking at this I noticed another potential different race in
qmap_sub_ecaps_updated() busy/pending handoff.

CPU0 CPU1
holds part_busy
refresh_usable() using old avail
update avail_cids
part_try_start() fails
sees part_pending == 0
part_end()
returns
sets part_pending = 1

IIUC, there's no owner left to consume part_pending immediately at this point,
so usable_cids can remain stale until the next rr_advance() or redistribute()
pass. It should self-correct, but a task may remain queued until another
dispatch event.

This is likely not a big problem either, just wanted to point it out as a
separate one from the transient self_cids issue reported by Sashiko.

Thanks,
-Andrea