All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [RFC mptcp-next 0/3] mptcp: rework poll+nospace handling
@ 2020-09-05 10:33 Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2020-09-05 10:33 UTC (permalink / raw
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]

A while back I had a discussion with Paolo on how mptcp handles the
'is mptcp socket writeable' handling in the sendmsg path, rather than
the poll one.

There are only two cases:
1. Blocking IO, where userspace calls send/read.
   In this scenario, maintaining the MPTCP_SEND_SPACE bit in sendmsg
   path is useless extra work -- userspace will block at send time if
   no more wmem is available.

2. Nonblocking IO.
   If userspace calls sendmsg without checking poll first, it has
   to cope with -EAGAIN.
   If userspace does call poll first, then mptcp can do the 'is
   mptcp socket writeable' check in mptcp_poll.

Consequently, patch #2 removes ssk_check_wmem().  A similar test
is added to mptcp_poll().

Furthermore, the MPTCP_SEND_SPACE bit has its meaning inverted and
gets renamed to MPTCP_NOSPACE.  Its only function is to let the
mptcp_data_acked() path know if the mptcp worker needs to be scheduled
or not.

IOW, when sendmsg path is going to sleep, or when poll path finds
socket isn't writeable, this bit makes sure that the next data ack
will wake userspace.

For the unlikely case that the mptcp socket is writeable but subflow
sockets are not, this will still enable tcp-level callbacks via the
SOCK_NOSPACE machinery.

Sending as RFC for now as I'm not sure others consider this approach
better or easier to follow then what we currently have.

First patch might be useful in its own right even if #2 is rejected.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-05 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-05 10:33 [MPTCP] [RFC mptcp-next 0/3] mptcp: rework poll+nospace handling Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.