]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Revert "sched_ext: Use READ_ONCE() for the read side of dsq->nr update"
authorTejun Heo <tj@kernel.org>
Sun, 8 Mar 2026 07:42:12 +0000 (21:42 -1000)
committerTejun Heo <tj@kernel.org>
Sun, 8 Mar 2026 07:42:12 +0000 (21:42 -1000)
This reverts commit 9adfcef334bf9c6ef68eaecfca5f45d18614efe0.

dsq->nr is protected by dsq->lock and reading while holding the lock doesn't
constitute a racy read.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: zhidao su <suzhidao@xiaomi.com>
kernel/sched/ext.c

index f6bafcfe0b93f2a1e8bb611774056cb5d65aced7..d6d80733701305beeb5a87a19247d137b578959e 100644 (file)
@@ -1296,12 +1296,8 @@ static bool scx_dsq_priq_less(struct rb_node *node_a,
 
 static void dsq_mod_nr(struct scx_dispatch_q *dsq, s32 delta)
 {
-       /*
-        * scx_bpf_dsq_nr_queued() reads ->nr without locking. Use READ_ONCE()
-        * on the read side and WRITE_ONCE() on the write side to properly
-        * annotate the concurrent lockless access and avoid KCSAN warnings.
-        */
-       WRITE_ONCE(dsq->nr, READ_ONCE(dsq->nr) + delta);
+       /* scx_bpf_dsq_nr_queued() reads ->nr without locking, use WRITE_ONCE() */
+       WRITE_ONCE(dsq->nr, dsq->nr + delta);
 }
 
 static void refill_task_slice_dfl(struct scx_sched *sch, struct task_struct *p)