Re: [PATCH] io_uring: allow async accept on O_NONBLOCK sockets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux