net: add skb_queue_empty_lockless()
authorEric Dumazet <edumazet@google.com>
Thu, 24 Oct 2019 05:44:48 +0000 (22:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Nov 2019 10:27:46 +0000 (11:27 +0100)
commitd5ac4232c376c5785549be561e863b7f3c007827
treeefa22faea0064e3dc1a049aa04435a1c3073cd17
parent83532eb4804964463a36b6f31ce595f202525094
net: add skb_queue_empty_lockless()

[ Upstream commit d7d16a89350ab263484c0aa2b523dd3a234e4a80 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/skbuff.h