Commit d39ca259 authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller

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

This reverts commit 0d4a6608.

Williem 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>
parent bda6a355
...@@ -1368,7 +1368,8 @@ static void udp_rmem_release(struct sock *sk, int size, int partial, ...@@ -1368,7 +1368,8 @@ static void udp_rmem_release(struct sock *sk, int size, int partial,
if (likely(partial)) { if (likely(partial)) {
up->forward_deficit += size; up->forward_deficit += size;
size = up->forward_deficit; size = up->forward_deficit;
if (size < (sk->sk_rcvbuf >> 2)) if (size < (sk->sk_rcvbuf >> 2) &&
!skb_queue_empty(&up->reader_queue))
return; return;
} else { } else {
size += up->forward_deficit; 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