Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net] mptcp: free acked data before waiting for more memory
@ 2020-08-25 23:31 Florian Westphal
2020-08-26 22:49 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2020-08-25 23:31 UTC (permalink / raw)
To: netdev; +Cc: Florian Westphal
After subflow lock is dropped, more wmem might have been made available.
This fixes a deadlock in mptcp_connect.sh 'mmap' mode: wmem is exhausted.
But as the mptcp socket holds on to already-acked data (for retransmit)
no wakeup will occur.
Using 'goto restart' calls mptcp_clean_una(sk) which will free pages
that have been acked completely in the mean time.
Fixes: fb529e62d3f3 ("mptcp: break and restart in case mptcp sndbuf is full")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
net/mptcp/protocol.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 1aad411a0e46..8ccd4a151dcb 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -892,7 +892,6 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
goto out;
}
-wait_for_sndbuf:
__mptcp_flush_join_list(msk);
ssk = mptcp_subflow_get_send(msk);
while (!sk_stream_memory_free(sk) ||
@@ -982,7 +981,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
*/
mptcp_set_timeout(sk, ssk);
release_sock(ssk);
- goto wait_for_sndbuf;
+ goto restart;
}
}
}
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] mptcp: free acked data before waiting for more memory
2020-08-25 23:31 [PATCH net] mptcp: free acked data before waiting for more memory Florian Westphal
@ 2020-08-26 22:49 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-08-26 22:49 UTC (permalink / raw)
To: fw; +Cc: netdev
From: Florian Westphal <fw@strlen.de>
Date: Wed, 26 Aug 2020 01:31:05 +0200
> After subflow lock is dropped, more wmem might have been made available.
>
> This fixes a deadlock in mptcp_connect.sh 'mmap' mode: wmem is exhausted.
> But as the mptcp socket holds on to already-acked data (for retransmit)
> no wakeup will occur.
>
> Using 'goto restart' calls mptcp_clean_una(sk) which will free pages
> that have been acked completely in the mean time.
>
> Fixes: fb529e62d3f3 ("mptcp: break and restart in case mptcp sndbuf is full")
> Signed-off-by: Florian Westphal <fw@strlen.de>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-26 22:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 23:31 [PATCH net] mptcp: free acked data before waiting for more memory Florian Westphal
2020-08-26 22:49 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).