[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150515211707.D9FC480066@prod-mail-relay07.akamai.com>
Date: Fri, 15 May 2015 21:17:07 +0000 (GMT)
From: Jason Baron <jbaron@...mai.com>
To: edumazet@...gle.com, davem@...emloft.net
Cc: netdev@...r.kernel.org, ncardwell@...gle.com, ycheng@...gle.com
Subject: [PATCH] tcp: ensure epoll edge trigger wakeup when out of memory
From: Jason Baron <jbaron@...mai.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@...mai.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists