mptcp: free acked data before waiting for more memory
Subsystems (2)
Florian Westphal
PATCH 1/1 mptcp: free acked data before waiting for more memory
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.
---
I suspect Paolos recent sndbuf tracking changes made this bug trigger more frequently. Afaics net-next is just more lucky so it might make sense to pass this via net-next. Let me know.
net/mptcp/protocol.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/mptcp/protocol.c +1 -2
@@ -1178,7 +1178,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, &sndbuf); while (!sk_stream_memory_free(sk) ||
@@ -1282,7 +1281,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; } } }
Signature · 1 line
2.26.2
Matthieu Baerts
Hi Florian, Mat,
Quoted 11 lines · 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(a)strlen.de>
Thank you for the patch and the review!
Applied at the beginning of the series because it was already applied in -net.
Tests + export are in progress!
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net