tcp: fix behavior for epoll edge trigger
authorEric Dumazet <edumazet@google.com>
Fri, 15 May 2015 19:39:28 +0000 (12:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 May 2015 02:45:48 +0000 (22:45 -0400)
commit8e4d980ac21596a9b91d8e720c77ad081975a0a8
treedc700c270ee5120019b430d2a0d97f8a9c728c03
parentb8da51ebb1aa93908350f95efae73aecbc2e266c
tcp: fix behavior for epoll edge trigger

Under memory pressure, tcp_sendmsg() can fail to queue a packet
while no packet is present in write queue. If we return -EAGAIN
with no packet in write queue, no ACK packet will ever come
to raise EPOLLOUT.

We need to allow one skb per TCP socket, and make sure that
tcp sockets can release their forward allocations under pressure.

This is a followup to commit 790ba4566c1a ("tcp: set SOCK_NOSPACE
under memory pressure")

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