public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH for-next 0/8] io_uring: multishot recv
@ 2022-06-28 15:02 Dylan Yudaken
  2022-06-28 15:02 ` [PATCH for-next 1/8] io_uring: allow 0 length for buffer select Dylan Yudaken
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Dylan Yudaken @ 2022-06-28 15:02 UTC (permalink / raw)
  To: Jens Axboe, Pavel Begunkov, io-uring
  Cc: Kernel-team, linux-kernel, Dylan Yudaken

This series adds support for multishot recv/recvmsg to io_uring.

The idea is that generally socket applications will be continually
enqueuing a new recv() when the previous one completes. This can be
improved on by allowing the application to queue a multishot receive,
which will post completions as and when data is available. It uses the
provided buffers feature to receive new data into a pool provided by
the application.

This is more performant in a few ways:
* Subsequent receives are queued up straight away without requiring the
  application to finish a processing loop.
* If there are more data in the socket (sat the provided buffer
  size is smaller than the socket buffer) then the data is immediately
  returned, improving batching.
*  Poll is only armed once and reused, saving CPU cycles

Running a small network benchmark [1] shows improved QPS of ~6-8% over a range of loads.

[1]: https://github.com/DylanZA/netbench/tree/multishot_recv

Dylan Yudaken (8):
  io_uring: allow 0 length for buffer select
  io_uring: restore bgid in io_put_kbuf
  io_uring: allow iov_len = 0 for recvmsg and buffer select
  io_uring: recycle buffers on error
  io_uring: clean up io_poll_check_events return values
  io_uring: add IOU_STOP_MULTISHOT return code
  io_uring: add IORING_RECV_MULTISHOT flag
  io_uring: multishot recv

 include/uapi/linux/io_uring.h |   5 ++
 io_uring/io_uring.h           |   7 ++
 io_uring/kbuf.c               |   4 +-
 io_uring/kbuf.h               |   8 ++-
 io_uring/net.c                | 119 ++++++++++++++++++++++++++++------
 io_uring/poll.c               |  30 ++++++---
 6 files changed, 140 insertions(+), 33 deletions(-)


base-commit: 755441b9029317d981269da0256e0a7e5a7fe2cc
-- 
2.30.2



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

end of thread, other threads:[~2022-06-28 15:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-28 15:02 [PATCH for-next 0/8] io_uring: multishot recv Dylan Yudaken
2022-06-28 15:02 ` [PATCH for-next 1/8] io_uring: allow 0 length for buffer select Dylan Yudaken
2022-06-28 15:02 ` [PATCH for-next 2/8] io_uring: restore bgid in io_put_kbuf Dylan Yudaken
2022-06-28 15:12   ` Jens Axboe
2022-06-28 15:02 ` [PATCH for-next 3/8] io_uring: allow iov_len = 0 for recvmsg and buffer select Dylan Yudaken
2022-06-28 15:02 ` [PATCH for-next 4/8] io_uring: recycle buffers on error Dylan Yudaken
2022-06-28 15:02 ` [PATCH for-next 5/8] io_uring: clean up io_poll_check_events return values Dylan Yudaken
2022-06-28 15:02 ` [PATCH for-next 6/8] io_uring: add IOU_STOP_MULTISHOT return code Dylan Yudaken
2022-06-28 15:02 ` [PATCH for-next 7/8] io_uring: add IORING_RECV_MULTISHOT flag Dylan Yudaken
2022-06-28 15:12   ` Jens Axboe
2022-06-28 15:02 ` [PATCH for-next 8/8] io_uring: multishot recv Dylan Yudaken
2022-06-28 15:17   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox