public inbox for [email protected]
 help / color / mirror / Atom feed
From: Dylan Yudaken <[email protected]>
To: "[email protected]" <[email protected]>,
	"[email protected]" <[email protected]>,
	"[email protected]" <[email protected]>,
	"[email protected]" <[email protected]>,
	"[email protected]" <[email protected]>,
	"[email protected]" <[email protected]>,
	"[email protected]" <[email protected]>,
	"[email protected]" <[email protected]>
Cc: Kernel Team <[email protected]>,
	"[email protected]" <[email protected]>
Subject: Re: [PATCH v2 for-next 3/3] io_uring: support multishot in recvmsg
Date: Thu, 14 Jul 2022 09:20:24 +0000	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On Thu, 2022-07-14 at 07:46 +0000, David Laight wrote:
> From: Dylan Yudaken
> > Sent: 13 July 2022 09:23
> > 
> > Similar to multishot recv, this will require provided buffers to be
> > used. However recvmsg is much more complex than recv as it has
> > multiple
> > outputs. Specifically flags, name, and control messages.
> ...
> 
> Why is this any different from adding several 'recvmsg' requests
> into the request ring?
> 
> IIUC the requests are all processed sequentially by a single thread.
> 

In practice it is mostly the same for UDP (apart from userspace having
to predict how many recvmsg requests it should add).  That approach
would also have a slight ordering race, which probably is not a problem
for protocols that don't guarantee ordering, but might be annoying.

For stream like TCP it would not be possible due to the ordering issues
(completions of separate SQEs have no guaranteed ordering). You would
have to link the SQE's to preserve ordering, but then you would still
have to wait for a batch to complete before submitting a new batch.

Apart from those practical reasons, performance wise it is better for a
few reasons
 * userspace doesn't have to submit new requests
 * the io_uring knows it's multishot, so doesn't teardown the poll each
time
 * io_uring can allocate the request and associated async data only
once and reuse it

Regards,
Dylan

>         David
> 
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes,
> MK1 1PT, UK
> Registration No: 1397386 (Wales)
> 


      reply	other threads:[~2022-07-14  9:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  8:23 [PATCH v2 for-next 0/3] io_uring: multishot recvmsg Dylan Yudaken
2022-07-13  8:23 ` [PATCH v2 for-next 1/3] net: copy from user before calling __copy_msghdr Dylan Yudaken
2022-07-13  8:23 ` [PATCH v2 for-next 2/3] net: copy from user before calling __get_compat_msghdr Dylan Yudaken
2022-07-13  8:23 ` [PATCH v2 for-next 3/3] io_uring: support multishot in recvmsg Dylan Yudaken
2022-07-13 12:48   ` Jens Axboe
2022-07-14  9:11     ` Dylan Yudaken
2022-07-14  7:46   ` David Laight
2022-07-14  9:20     ` Dylan Yudaken [this message]

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=bd096fecad204c2ecf831cf96ac84b1f82b853ce.camel@fb.com \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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