]> git.baikalelectronics.ru Git - kernel.git/commit
net: add skb_queue_empty_lockless()
authorEric Dumazet <edumazet@google.com>
Thu, 24 Oct 2019 05:44:48 +0000 (22:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Oct 2019 20:33:41 +0000 (13:33 -0700)
commitbed44d2faf142a3ce614fcd31f441c75d008c254
tree177005e5dd42ea6ca09fa54035b4de01b48e3cb1
parentaac33667969167fd9b9d6b1919b8c2a89e9b6925
net: add skb_queue_empty_lockless()

Some paths call skb_queue_empty() without holding
the queue lock. We must use a barrier in order
to not let the compiler do strange things, and avoid
KCSAN splats.

Adding a barrier in skb_queue_empty() might be overkill,
I prefer adding a new helper to clearly identify
points where the callers might be lockless. This might
help us finding real bugs.

The corresponding WRITE_ONCE() should add zero cost
for current compilers.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h