]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: add a force_schedule argument to sk_stream_alloc_skb()
authorEric Dumazet <edumazet@google.com>
Tue, 19 May 2015 20:26:55 +0000 (13:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 May 2015 20:56:40 +0000 (16:56 -0400)
commit2f4e7da1b6e3c1e66edf5193e1829241a8d6158d
treef1924cedc2aa178d4a1bc953204fce035a6a4233
parentf212c635c30e3226bda330d6bbb5111d37a2cb6d
tcp: add a force_schedule argument to sk_stream_alloc_skb()

In commit a0229dae4d7a ("tcp: fix behavior for epoll edge trigger")
we fixed a possible hang of TCP sockets under memory pressure,
by allowing sk_stream_alloc_skb() to use sk_forced_mem_schedule()
if no packet is in socket write queue.

It turns out there are other cases where we want to force memory
schedule :

tcp_fragment() & tso_fragment() need to split a big TSO packet into
two smaller ones. If we block here because of TCP memory pressure,
we can effectively block TCP socket from sending new data.
If no further ACK is coming, this hang would be definitive, and socket
has no chance to effectively reduce its memory usage.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/ipv4/tcp.c
net/ipv4/tcp_output.c