]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
codel: annotate data-races in codel_dump_stats()
authorEric Dumazet <edumazet@google.com>
Tue, 7 Apr 2026 14:30:53 +0000 (14:30 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 9 Apr 2026 02:18:52 +0000 (19:18 -0700)
commitea25e03da7a79e0413f1606d4a407a97ed41628a
tree74eed613fced494ff0348915a73972a8e2e1f06f
parentdbc2bb4e8742068d3d3dc8ebb46d874e5fd953b8
codel: annotate data-races in codel_dump_stats()

codel_dump_stats() only runs with RTNL held,
reading fields that can be changed in qdisc fast path.

Add READ_ONCE()/WRITE_ONCE() annotations.

Alternative would be to acquire the qdisc spinlock, but our long-term
goal is to make qdisc dump operations lockless as much as we can.

tc_codel_xstats fields don't need to be latched atomically,
otherwise this bug would have been caught earlier.

No change in kernel size:

$ scripts/bloat-o-meter -t vmlinux.0 vmlinux
add/remove: 0/0 grow/shrink: 1/1 up/down: 3/-1 (2)
Function                                     old     new   delta
codel_qdisc_dequeue                         2462    2465      +3
codel_dump_stats                             250     249      -1
Total: Before=29739919, After=29739921, chg +0.00%

Fixes: 76e3cc126bb2 ("codel: Controlled Delay AQM")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260407143053.1570620-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/codel_impl.h
net/sched/sch_codel.c