netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 net-next 0/7] RDS: zerocopy support
@ 2018-02-14 10:28 Sowmini Varadhan
  2018-02-14 10:28 ` [PATCH V2 net-next 1/7] skbuff: export mm_[un]account_pinned_pages for other modules Sowmini Varadhan
                   ` (7 more replies)
  0 siblings, 8 replies; 31+ messages in thread
From: Sowmini Varadhan @ 2018-02-14 10:28 UTC (permalink / raw)
  To: netdev, willemdebruijn.kernel
  Cc: davem, rds-devel, sowmini.varadhan, santosh.shilimkar

This is version 2 of the series at 
  https://www.mail-archive.com/netdev@vger.kernel.org/msg213829.html

Review comments addressed
Patch 4: 
  - make sure to always sock_put m_rs even if there is no znotifier.
  - major rewrite of notification, resulting in much simplification.

Patch 5:
  - remove unused data_len argument to rds_rm_size; 
  - unmap as necessary if we fail in the middle of zerocopy setup

Patch 7:
  - restructured do_recv_completion to avoid excessive code re-indent
  - on-stack allocation of cmsghdr for cookie in do_sendmsg
  - Additional verification: Verify ncookies <= MAX_.., verify ret ==
    ncookies * sizeof(uint32_t)

A brief overview of this feature follows.

This patch series provides support for MSG_ZERCOCOPY
on a PF_RDS socket based on the APIs and infrastructure added
by f214f915e7db ("tcp: enable MSG_ZEROCOPY")

For single threaded rds-stress testing using rds-tcp with the
ixgbe driver using 1M message sizes (-a 1M -q 1M) preliminary
results show that  there is a significant reduction in latency: about
90 usec with zerocopy, compared with 200 usec without zerocopy.

This patchset modifies the above for zerocopy in the following manner.
- if the MSG_ZEROCOPY flag is specified with rds_sendmsg(), and,
- if the SO_ZEROCOPY  socket option has been set on the PF_RDS socket,
application pages sent down with rds_sendmsg are pinned. The pinning
uses the accounting infrastructure added by a91dbff551a6 ("sock: ulimit 
on MSG_ZEROCOPY pages"). The message is unpinned when all references
to the message go down to 0, and the message is freed by rds_message_purge.

A multithreaded application using this infrastructure must send down 
a unique 32 bit cookie as ancillary data with each sendmsg invocation.
The format of this ancillary data is described in Patch 5 of the series.
The cookie is passed up to the application on the sk_error_queue when 
the message is unpinned, indicating to the application that it is now
safe to free/reuse the message buffer. The details of the completion
notifiction are provided in Patch 4 of this series.


Sowmini Varadhan (7):
  skbuff: export mm_[un]account_pinned_pages for other modules
  rds: hold a sock ref from rds_message to the rds_sock
  sock: permit SO_ZEROCOPY on PF_RDS socket
  rds: support for zcopy completion notification
  rds: zerocopy Tx support.
  selftests/net: add support for PF_RDS sockets
  selftests/net: add zerocopy support for PF_RDS test case

 include/linux/skbuff.h                     |    3 +
 include/uapi/linux/errqueue.h              |    2 +
 include/uapi/linux/rds.h                   |    1 +
 net/core/skbuff.c                          |    6 +-
 net/core/sock.c                            |   25 +++---
 net/rds/af_rds.c                           |    2 +
 net/rds/message.c                          |  132 ++++++++++++++++++++++++++-
 net/rds/rds.h                              |   17 ++++-
 net/rds/recv.c                             |    2 +
 net/rds/send.c                             |   51 ++++++++---
 tools/testing/selftests/net/msg_zerocopy.c |  133 ++++++++++++++++++++++++++-
 11 files changed, 339 insertions(+), 35 deletions(-)

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2018-02-15 16:44 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14 10:28 [PATCH V2 net-next 0/7] RDS: zerocopy support Sowmini Varadhan
2018-02-14 10:28 ` [PATCH V2 net-next 1/7] skbuff: export mm_[un]account_pinned_pages for other modules Sowmini Varadhan
2018-02-14 10:28 ` [PATCH V2 net-next 2/7] rds: hold a sock ref from rds_message to the rds_sock Sowmini Varadhan
2018-02-14 18:38   ` Santosh Shilimkar
2018-02-14 10:28 ` [PATCH V2 net-next 3/7] sock: permit SO_ZEROCOPY on PF_RDS socket Sowmini Varadhan
2018-02-14 10:28 ` [PATCH V2 net-next 4/7] rds: support for zcopy completion notification Sowmini Varadhan
2018-02-14 18:50   ` Santosh Shilimkar
2018-02-14 19:01     ` Sowmini Varadhan
2018-02-14 19:02       ` David Miller
2018-02-14 21:10         ` Santosh Shilimkar
2018-02-14 21:25           ` Sowmini Varadhan
2018-02-14 21:39             ` Santosh Shilimkar
2018-02-14 22:08             ` Santosh Shilimkar
2018-02-14 19:17       ` Santosh Shilimkar
2018-02-14 22:26     ` Willem de Bruijn
2018-02-15  0:19       ` Santosh Shilimkar
2018-02-15  0:12   ` Willem de Bruijn
2018-02-15  0:41   ` Willem de Bruijn
2018-02-15 12:03     ` Sowmini Varadhan
2018-02-15 16:35       ` Willem de Bruijn
2018-02-15 16:43         ` Sowmini Varadhan
2018-02-14 10:28 ` [PATCH V2 net-next 5/7] rds: zerocopy Tx support Sowmini Varadhan
2018-02-14 19:10   ` Santosh Shilimkar
2018-02-14 19:49     ` Sowmini Varadhan
2018-02-14 21:14       ` Santosh Shilimkar
2018-02-14 23:48   ` Willem de Bruijn
2018-02-15  0:09     ` Sowmini Varadhan
2018-02-15  0:15       ` Willem de Bruijn
2018-02-14 10:28 ` [PATCH V2 net-next 6/7] selftests/net: add support for PF_RDS sockets Sowmini Varadhan
2018-02-14 10:28 ` [PATCH V2 net-next 7/7] selftests/net: add zerocopy support for PF_RDS test case Sowmini Varadhan
2018-02-15  0:19 ` [PATCH V2 net-next 0/7] RDS: zerocopy support Willem de Bruijn

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).