zhidao su
9adfcef334
sched_ext: Use READ_ONCE() for the read side of dsq->nr update
...
scx_bpf_dsq_nr_queued() reads dsq->nr via READ_ONCE() without holding
any lock, making dsq->nr a lock-free concurrently accessed variable.
However, dsq_mod_nr(), the sole writer of dsq->nr, only uses
WRITE_ONCE() on the write side without the matching READ_ONCE() on the
read side:
WRITE_ONCE(dsq->nr, dsq->nr + delta);
^^^^^^^
plain read -- KCSAN data race
The KCSAN documentation requires that if one accessor uses READ_ONCE()
or WRITE_ONCE() on a variable to annotate lock-free access, all other
accesses must also use the appropriate accessor. A plain read on the
right-hand side of WRITE_ONCE() leaves the pair incomplete and will
trigger KCSAN warnings.
Fix by using READ_ONCE() for the read side of the update:
WRITE_ONCE(dsq->nr, READ_ONCE(dsq->nr) + delta);
This is consistent with scx_bpf_dsq_nr_queued() and makes the
concurrent access annotation complete and KCSAN-clean.
Signed-off-by: zhidao su <suzhidao@xiaomi.com >
Signed-off-by: Tejun Heo <tj@kernel.org >
2026-03-02 07:23:00 -10:00
..
2026-02-06 14:47:59 -08:00
2026-02-11 13:20:50 -08:00
2025-11-12 10:00:14 -08:00
2025-10-24 12:56:20 +02:00
2026-02-10 21:46:12 -08:00
2026-01-30 15:40:05 +01:00
2026-02-10 12:00:46 -08:00
2025-12-10 17:21:30 +09:00
2025-11-09 21:19:44 -08:00
2026-02-11 17:20:38 -08:00
2026-01-05 16:43:35 +01:00
2026-02-05 08:00:44 -08:00
2026-02-02 18:43:55 -08:00
2025-12-18 10:45:23 +01:00
2026-02-10 09:49:18 -08:00
2026-02-04 20:52:09 +01:00
2026-02-11 19:31:52 -08:00
2026-01-23 11:15:36 -08:00
2026-03-02 07:23:00 -10:00
2026-02-10 16:41:59 -08:00
2026-02-10 11:26:21 -08:00
2025-12-17 13:31:07 +01:00
2025-06-24 20:30:37 +09:00
2026-01-13 15:18:08 -05:00
2025-09-23 12:37:35 +02:00
2025-10-03 10:19:44 -07:00
2025-09-23 12:37:35 +02:00
2025-12-16 11:04:14 -05:00
2025-10-22 19:28:06 -04:00
2025-11-07 16:38:34 -05:00
2026-01-13 15:18:07 -05:00
2025-12-03 16:53:19 +01:00
2025-03-07 22:03:09 -06:00
2025-07-31 18:23:53 -07:00
2026-01-01 16:39:46 +08:00
2025-11-14 10:01:52 +01:00
2026-02-03 15:23:33 +01:00
2025-09-13 17:32:55 -07:00
2025-11-15 10:52:01 -08:00
2025-05-21 10:48:21 -07:00
2025-11-12 10:00:15 -08:00
2026-01-06 20:52:57 -05:00
2025-05-27 19:40:33 -07:00
2025-12-06 14:01:20 -08:00
2026-02-09 17:31:17 -08:00
2025-10-30 20:10:27 +01:00
2025-08-06 10:23:36 +09:00
2025-11-20 14:03:43 -08:00
2025-02-21 15:05:38 +01:00
2025-01-13 22:40:36 -08:00
2025-03-10 11:54:46 +01:00
2026-01-22 15:58:22 -07:00
2025-09-28 11:36:14 -07:00
2026-01-22 15:58:22 -07:00
2025-02-21 10:25:33 +01:00
2025-02-21 09:20:30 +01:00
2025-11-27 14:24:33 -08:00
2026-01-08 12:43:57 +01:00
2026-01-28 20:45:24 +01:00
2025-12-23 11:23:14 -08:00
2025-03-16 22:30:47 -07:00
2025-09-13 17:32:43 -07:00
2025-08-02 12:01:38 -07:00
2025-08-02 12:01:38 -07:00
2024-12-24 09:46:49 +01:00
2025-07-15 18:45:34 +09:00
2025-11-27 15:44:53 +01:00
2025-11-27 14:24:42 -08:00
2026-02-09 19:57:30 -08:00
2025-01-28 13:48:37 +01:00
2026-01-05 16:43:34 +01:00
2024-11-05 17:12:31 -08:00
2025-11-11 10:01:31 +01:00
2025-11-14 13:10:38 +01:00
2025-11-14 13:10:38 +01:00
2026-01-23 13:48:44 +08:00
2026-01-19 12:30:01 -08:00
2025-12-22 16:35:53 +00:00
2025-11-11 10:01:32 +01:00
2025-01-28 13:48:37 +01:00
2025-12-15 14:33:38 +01:00
2025-11-04 08:30:50 +01:00
2025-04-01 10:06:52 -07:00
2025-11-16 17:28:11 -08:00
2024-10-09 12:47:19 -07:00
2026-01-27 16:36:51 -06:00
2026-01-22 11:11:20 +01:00
2024-11-14 16:09:51 -08:00
2025-11-12 10:00:13 -08:00
2025-09-30 11:11:21 -07:00
2026-01-05 16:43:33 +01:00
2025-11-19 18:06:50 +01:00
2025-06-13 08:47:20 +02:00
2025-09-17 16:25:41 +02:00
2025-03-30 15:44:36 -07:00
2025-07-01 15:02:03 +02:00
2026-01-22 11:11:17 +01:00
2026-02-10 17:02:23 -08:00
2025-04-14 14:13:41 +02:00
2025-11-27 15:45:38 +01:00
2025-10-29 10:29:54 +01:00
2024-11-03 01:28:06 -05:00
2025-08-14 15:26:30 -07:00
2025-03-21 15:30:10 -04:00
2025-08-19 13:38:20 +02:00
2025-08-02 12:01:38 -07:00
2025-01-28 13:48:37 +01:00
2025-09-25 09:23:54 +02:00
2025-11-11 10:01:32 +01:00
2025-01-28 13:48:37 +01:00
2025-09-29 11:20:29 -07:00
2025-09-21 17:44:20 -04:00
2026-02-11 13:40:35 -08:00
2025-11-19 12:17:28 +01:00
2025-07-31 11:28:03 -04:00
2025-09-13 17:32:53 -07:00
2026-01-14 22:16:22 -08:00
2026-02-11 13:13:32 -08:00