提交 1e338694 编写于 作者: P Paolo Abeni 提交者: Yang Yingliang

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

stable inclusion
from linux-4.19.100
commit 4c1c35c01531cda945cd1e0ae994a6c91c88de81

--------------------------------

[ 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: NWillem de Bruijn <willemdebruijn.kernel@gmail.com>
Diagnosed-by: NEric Dumazet <eric.dumazet@gmail.com>
Fixes: 0d4a6608 ("udp: do rmem bulk free even if the rx sk queue is empty")
Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
Acked-by: NWillem de Bruijn <willemb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NLi Aichun <liaichun@huawei.com>
Reviewed-by: Nguodeqing <geffrey.guo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ce29e8b1
...@@ -1302,7 +1302,8 @@ static void udp_rmem_release(struct sock *sk, int size, int partial, ...@@ -1302,7 +1302,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册