Re: [PATCH] sched_ext: Use READ_ONCE() for the read side of dsq->seq update

From: Tejun Heo

Date: Sat Mar 07 2026 - 19:17:54 EST


On Sat, Mar 07, 2026 at 11:32:04PM +0000, David Carlier wrote:
> - WRITE_ONCE(dsq->seq, dsq->seq + 1);
> - p->scx.dsq_seq = dsq->seq;
> + nseq = READ_ONCE(dsq->seq) + 1;
> + WRITE_ONCE(dsq->seq, nseq);
> + p->scx.dsq_seq = nseq;

Does this actually trigger KCSAN or wsa this just generated by AI? dsq->seq
is protected by dsq lock. I don't see how dsq->seq load can become a racy
read.

--
tejun