Thread (3 messages) 3 messages, 2 authors, 2023-06-26

Re: [PATCH net-next] net: tcp: support to probe tcp receiver OOM

From: Eric Dumazet <edumazet@google.com>
Date: 2023-06-26 13:27:17
Also in: linux-doc, lkml

On Mon, Jun 26, 2023 at 12:01 PM [off-list ref] wrote:
From: Menglong Dong <redacted>

For now, skb will be dropped directly if rmem schedule fails, which means
tcp_try_rmem_schedule() returns an error. This can happen on following
cases:

1. The total memory allocated for TCP protocol is up to tcp_mem[2], and
   the receive queue of the tcp socket is not empty.
2. The receive buffer of the tcp socket is full, which can happen on small
   packet cases.

If the user hangs and doesn't take away the packet in the receive queue
with recv() or read() for a long time, the sender will keep
retransmitting until timeout, and the tcp connection will break.

In order to handle such case, we introduce the tcp protocol OOM detection
in following steps, as Neal Cardwell suggested:
net-next is closed.

I think I suggested something much simpler, and not intrusive like your patch.
(Your patch adds code in the fast path, and yet another sysctl)

If we can not queue an incoming packet because we are under memory stress,
simply send an ACK with WIN 0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help