Commit 4c1c35c0 authored by Paolo Abeni's avatar Paolo Abeni Committed by Greg Kroah-Hartman

Revert "udp: do rmem bulk free even if the rx sk queue is empty"

[ Upstream commit d39ca259 ]

This reverts commit 0d4a6608.

Willem reported that after commit 0d4a6608 ("udp: do rmem bulk
free even if the rx sk queue is empty") the memory allocated by
an almost idle system with many UDP sockets can grow a lot.

For stable kernel keep the solution as simple as possible and revert
the offending commit.
Reported-by: default avatarWillem de Bruijn <willemdebruijn.kernel@gmail.com>
Diagnosed-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Fixes: 0d4a6608 ("udp: do rmem bulk free even if the rx sk queue is empty")
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Acked-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c74b3d12
......@@ -1305,7 +1305,8 @@ static void udp_rmem_release(struct sock *sk, int size, int partial,
if (likely(partial)) {
up->forward_deficit += size;
size = up->forward_deficit;
if (size < (sk->sk_rcvbuf >> 2))
if (size < (sk->sk_rcvbuf >> 2) &&
!skb_queue_empty(&up->reader_queue))
return;
} else {
size += up->forward_deficit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment