mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
udp: use skb_attempt_defer_free()
Move skb freeing from udp recvmsg() path to the cpu which allocated/received it, as TCP did in linux-5.17. This increases max thoughput by 20% to 30%, depending on number of BH producers. Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Reviewed-by: David Ahern <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
This commit is contained in:
1 parent
3cd04c8f4a
commit
6471658dc6
1 file changed
+7
@@ -1825,6 +1825,13 @@ void skb_consume_udp(struct sock *sk, struct sk_buff *skb, int len)
|
||||
if (unlikely(READ_ONCE(udp_sk(sk)->peeking_with_offset)))
|
||||
sk_peek_offset_bwd(sk, len);
|
||||
|
||||
if (!skb_shared(skb)) {
|
||||
if (unlikely(udp_skb_has_head_state(skb)))
|
||||
skb_release_head_state(skb);
|
||||
skb_attempt_defer_free(skb);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!skb_unref(skb))
|
||||
return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user