All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcp: ensure epoll edge trigger wakeup when out of memory
@ 2015-05-15 21:17 Jason Baron
  2015-05-18  2:50 ` Eric Dumazet
  2015-05-19  4:09 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Jason Baron @ 2015-05-15 21:17 UTC (permalink / raw)
  To: edumazet, davem; +Cc: netdev, ncardwell, ycheng

From: Jason Baron <jbaron@akamai.com>

If we really can't get an skb allocated, make sure that we let
userspace know. This at least gives us a chance to re-try or abort.

Signed-off-by: Jason Baron <jbaron@akamai.com>
---
 net/ipv4/tcp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ecccfdc..d7d85e8 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -986,6 +986,9 @@ do_error:
 	if (copied)
 		goto out;
 out_err:
+	/* make sure we wake any epoll edge trigger waiter */
+	if (unlikely(sk->sk_write_queue == 0 && err == -EAGAIN))
+		sk->sk_write_space(sk);
 	return sk_stream_error(sk, flags, err);
 }
 
@@ -1274,6 +1277,9 @@ do_error:
 		goto out;
 out_err:
 	err = sk_stream_error(sk, flags, err);
+	/* make sure we wake any epoll edge trigger waiter */
+	if (unlikely(sk->sk_write_queue == 0 && err == -EAGAIN))
+		sk->sk_write_space(sk);
 	release_sock(sk);
 	return err;
 }
-- 
1.8.2.rc2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-19 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15 21:17 [PATCH] tcp: ensure epoll edge trigger wakeup when out of memory Jason Baron
2015-05-18  2:50 ` Eric Dumazet
2015-05-19  4:09 ` David Miller
2015-05-19  4:10   ` David Miller
2015-05-19 14:10     ` Jason Baron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.