mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
net: sock_dequeue_err_skb() optimization
Exit early if the list is empty. Some applications using TCP zerocopy are calling recvmsg( ... MSG_ERRQUEUE) and hit this case quite often, probably because busy polling only deals with sk_receive_queue. Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/20231005114504.642589-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a1fb841f9d
commit
48533eca60
@ -5162,6 +5162,9 @@ struct sk_buff *sock_dequeue_err_skb(struct sock *sk)
|
||||
bool icmp_next = false;
|
||||
unsigned long flags;
|
||||
|
||||
if (skb_queue_empty_lockless(q))
|
||||
return NULL;
|
||||
|
||||
spin_lock_irqsave(&q->lock, flags);
|
||||
skb = __skb_dequeue(q);
|
||||
if (skb && (skb_next = skb_peek(q))) {
|
||||
|
Loading…
Reference in New Issue
Block a user