[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1431917454.621.21.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Sun, 17 May 2015 19:50:54 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jason Baron <jbaron@...mai.com>
Cc: edumazet@...gle.com, davem@...emloft.net, netdev@...r.kernel.org,
ncardwell@...gle.com, ycheng@...gle.com
Subject: Re: [PATCH] tcp: ensure epoll edge trigger wakeup when out of memory
On Fri, 2015-05-15 at 21:17 +0000, Jason Baron wrote:
> 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;
> }
I wonder if we should return ENOMEM here, otherwise application has no
way to avoid to spin forever ?
--
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