Skip to content

mptcp: don't sleep on ssk with msk lock held

Florian Westphal mptcp 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7mptcp: avoid blocking in tcp_sendpagesnet/mptcp/protocol.c+20 -31 reply
2/7mptcp: make sure timer is inited/started once data is pending for transmissionnet/mptcp/protocol.c+5 -20 replies
3/7mptcp: avoid blocking in tcp_sendpages due to skb allocnet/mptcp/protocol.c+28 -15 replies
4/7mptcp: fill skb extension cache outside of mptcp_sendmsg_fragnet/mptcp/protocol.c+14 -40 replies
5/7mptcp: fill skb page frag cache outside of mptcp_sendmsg_fragnet/mptcp/protocol.c+6 -10 replies
6/7mptcp: remove inner wait loop from mptcp_sendmsg_fragnet/mptcp/protocol.c+0 -140 replies
7/7net: allow __skb_ext_alloc to sleepinclude/linux/skbuff.h net/core/skbuff.c net/mptcp/protocol.c+9 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [MPTCP] [PATCH mptcp-next 0/7] mptcp: don't sleep on ssk with msk lock held

This series reworks mptcp_sendmsg logic to avoid blocking on the subflow socket in an attempt to address/resolve:
https://github.com/multipath-tcp/mptcp_net-next/issues/7

It does so by removing the wait loop from mptcp_sendmsg_frag helper.

In order to do that, it moves prerequisites into the callers.

The worker can just reschedule in case no subflow socket is ready.

The sendmsg path can use the existing wait logic.

Because large send requests can result in multiple mptcp_sendmsg_frag calls from mptcp_sendmsg, we may need to restart the socket lookup in case subflow can't accept more data or memory is low.

Doing so blocks on the mptcp socket, and existing wait handling releases the msk lock while blocking.

Lastly, no need to use ATOMIC allocations for extension allocation, so allow to pass gfp_t arg to the helper instead of hard-coded ATOMIC in the core.

Comments welcome.

Florian Westphal (7):
mptcp: avoid blocking in tcp_sendpages
mptcp: make sure timer is inited/started once data is pending for transmission
mptcp: avoid blocking in tcp_sendpages due to skb alloc
mptcp: fill skb extension cache outside of mptcp_sendmsg_frag
mptcp: fill skb page frag cache outside of mptcp_sendmsg_frag
mptcp: remove inner wait loop from mptcp_sendmsg_frag
net: allow __skb_ext_alloc to sleep

 include/linux/skbuff.h |   2 +-
 net/core/skbuff.c      |   8 ++--
 net/mptcp/protocol.c   | 100 ++++++++++++++++++++++++++++++++++++-------------
 3 files changed, 81 insertions(+), 29 deletions(-)