mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
tcp: fix SO_RCVLOWAT possible hangs under high mem pressure
Whenever tcp_try_rmem_schedule() returns an error, we are under
trouble and should make sure to wakeup readers so that they
can drain socket queues and eventually make room.
Fixes: 03f45c883c
("tcp: avoid extra wakeups for SO_RCVLOWAT users")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0da7536fb4
commit
ba3bb0e76c
1 changed files with 2 additions and 0 deletions
|
@ -4582,6 +4582,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
|
||||||
|
|
||||||
if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
|
if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
|
||||||
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP);
|
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP);
|
||||||
|
sk->sk_data_ready(sk);
|
||||||
tcp_drop(sk, skb);
|
tcp_drop(sk, skb);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4828,6 +4829,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
|
||||||
sk_forced_mem_schedule(sk, skb->truesize);
|
sk_forced_mem_schedule(sk, skb->truesize);
|
||||||
else if (tcp_try_rmem_schedule(sk, skb, skb->truesize)) {
|
else if (tcp_try_rmem_schedule(sk, skb, skb->truesize)) {
|
||||||
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVQDROP);
|
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVQDROP);
|
||||||
|
sk->sk_data_ready(sk);
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue