Re: [PATCH] sched_ext: Use READ_ONCE() for the read side of dsq->seq update
From: David CARLIER
Date: Sat Mar 07 2026 - 23:22:26 EST
I missed that both reads are under dsq->lock ... it was a wrong
analysis on my part. Sorry for the noise.
On Sun, 8 Mar 2026 at 00:17, Tejun Heo <tj@xxxxxxxxxx> wrote:
>
> 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