net: use skb_queue_empty_lockless() in busy poll contexts
Busy polling usually runs without locks. Let's use skb_queue_empty_lockless() instead of skb_queue_empty() Also uses READ_ONCE() in __skb_try_recv_datagram() to address a similar potential problem. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
3ef7cf57c7
commit
3f926af3f4
@@ -8871,7 +8871,7 @@ struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags,
|
||||
if (sk_can_busy_loop(sk)) {
|
||||
sk_busy_loop(sk, noblock);
|
||||
|
||||
if (!skb_queue_empty(&sk->sk_receive_queue))
|
||||
if (!skb_queue_empty_lockless(&sk->sk_receive_queue))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user