netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netdev@vger.kernel.org>
Cc: pabeni@redhat.com, mathew.j.martineau@linux.intel.com,
	matthieu.baerts@tessares.net
Subject: [PATCH net-next 0/7] mptcp: do not block on subflow socket
Date: Sat, 16 May 2020 10:46:16 +0200	[thread overview]
Message-ID: <20200516084623.28453-1-fw@strlen.de> (raw)

This series reworks mptcp_sendmsg logic to avoid blocking on the subflow
socket.

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

In order to do that, it moves prerequisites that are currently
handled in mptcp_sendmsg_frag (and cause it to wait until they are
met, e.g. frag cache refill) into the callers.

The worker can just reschedule in case no subflow socket is ready,
since it can't wait -- doing so would block other work items and
doesn't make sense anyway because we should not (re)send data
in case resources are already low.

The sendmsg path can use the existing wait logic until memory
becomes available.

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 GFP_ATOMIC for extension allocation:
extend __skb_ext_alloc with gfp_t arg instead of hard-coded ATOMIC and
then relax the allocation constraints for mptcp case: those requests
occur in process context.

Florian Westphal (7):
      mptcp: move common nospace-pattern to a helper
      mptcp: break and restart in case mptcp sndbuf is full
      mptcp: avoid blocking in tcp_sendpages
      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   | 139 ++++++++++++++++++++++++++++++++++++-------------
 3 files changed, 109 insertions(+), 40 deletions(-)


             reply	other threads:[~2020-05-16  8:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16  8:46 Florian Westphal [this message]
2020-05-16  8:46 ` [PATCH net-next 1/7] mptcp: move common nospace-pattern to a helper Florian Westphal
2020-05-16  8:46 ` [PATCH net-next 2/7] mptcp: break and restart in case mptcp sndbuf is full Florian Westphal
2020-05-16  8:46 ` [PATCH net-next 3/7] mptcp: avoid blocking in tcp_sendpages Florian Westphal
2020-05-16  8:46 ` [PATCH net-next 4/7] mptcp: fill skb extension cache outside of mptcp_sendmsg_frag Florian Westphal
2020-05-16  8:46 ` [PATCH net-next 5/7] mptcp: fill skb page frag " Florian Westphal
2020-05-16  8:46 ` [PATCH net-next 6/7] mptcp: remove inner wait loop from mptcp_sendmsg_frag Florian Westphal
2020-05-16  8:46 ` [PATCH net-next 7/7] net: allow __skb_ext_alloc to sleep Florian Westphal
2020-05-17 19:36 ` [PATCH net-next 0/7] mptcp: do not block on subflow socket David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200516084623.28453-1-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).