[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190819.130837.1772205052483949360.davem@davemloft.net>
Date: Mon, 19 Aug 2019 13:08:37 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: edumazet@...gle.com
Cc: netdev@...r.kernel.org, soheil@...gle.com, ncardwell@...gle.com,
eric.dumazet@...il.com, jbaron@...mai.com, rutsky@...gle.com
Subject: Re: [PATCH net] tcp: make sure EPOLLOUT wont be missed
From: Eric Dumazet <edumazet@...gle.com>
Date: Fri, 16 Aug 2019 21:26:22 -0700
> As Jason Baron explained in commit 790ba4566c1a ("tcp: set SOCK_NOSPACE
> under memory pressure"), it is crucial we properly set SOCK_NOSPACE
> when needed.
>
> However, Jason patch had a bug, because the 'nonblocking' status
> as far as sk_stream_wait_memory() is concerned is governed
> by MSG_DONTWAIT flag passed at sendmsg() time :
>
> long timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
>
> So it is very possible that tcp sendmsg() calls sk_stream_wait_memory(),
> and that sk_stream_wait_memory() returns -EAGAIN with SOCK_NOSPACE
> cleared, if sk->sk_sndtimeo has been set to a small (but not zero)
> value.
>
> This patch removes the 'noblock' variable since we must always
> set SOCK_NOSPACE if -EAGAIN is returned.
>
> It also renames the do_nonblock label since we might reach this
> code path even if we were in blocking mode.
>
> Fixes: 790ba4566c1a ("tcp: set SOCK_NOSPACE under memory pressure")
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Jason Baron <jbaron@...mai.com>
> Reported-by: Vladimir Rutsky <rutsky@...gle.com>
Applied and queued up for -stable.
Powered by blists - more mailing lists