public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Dylan Yudaken <[email protected]>,
	Pavel Begunkov <[email protected]>,
	[email protected]
Cc: [email protected]
Subject: Re: [PATCH] io_uring: allow async accept on O_NONBLOCK sockets
Date: Thu, 24 Mar 2022 08:42:00 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 3/24/22 8:34 AM, Dylan Yudaken wrote:
> Do not set REQ_F_NOWAIT if the socket is non blocking. When enabled this
> causes the accept to immediately post a CQE with EAGAIN, which means you
> cannot perform an accept SQE on a NONBLOCK socket asynchronously.
> 
> By removing the flag if there is no pending accept then poll is armed as
> usual and when a connection comes in the CQE is posted.
> 
> note: If multiple accepts are queued up, then when a single connection
> comes in they all complete, one with the connection, and the remaining
> with EAGAIN. This could be improved in the future but will require a lot
> of io_uring changes.

Not true - all you'd need to do is have behavior similar to
EPOLLEXCLUSIVE, which we already support for separate poll. Could be
done for internal poll quite easily, and _probably_ makes sense to do by
default for most cases in fact.

-- 
Jens Axboe


  reply	other threads:[~2022-03-24 14:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 14:34 [PATCH] io_uring: allow async accept on O_NONBLOCK sockets Dylan Yudaken
2022-03-24 14:42 ` Jens Axboe [this message]
2022-03-24 14:46   ` Jens Axboe
2022-03-24 14:52     ` Dylan Yudaken
2022-03-24 18:09 ` Jens Axboe

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 \
    [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