Re: Emulating epoll

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

 



On 4/20/21 5:37 PM, Jesse Hughes wrote:
> Hello,
> 
> I want to start by saying thank-you for working on io_uring.  My experience using it thus far has been great.
> 
> I'm working on an open-source database product (KeyDB, a multi-threaded redis fork) and we're considering rewriting our IO to use io_uring.  Our current implementation uses epoll, and processes IO on (mainly) sockets as they become ready.

Wonderful, always interesting to learn about emerging use cases
and new apps using it.

> 
> If I'm understanding the literature correctly, to emulate epoll, we should be able to set up a uring, put in a read sqe for each incoming socket connection, then (using liburing) call io_uring_wait_sqe​.  Correct?  Is there a better way of doing that?

In general, the best way to do I/O is to issue a read/write/etc. sqe
directly as you've mentioned. io_uring will take care of doing polling
internally or finding a better way to execute it.

However, to simply emulate epoll IORING_OP_POLL_ADD requests can be
used There is support for multi-shot poll requests, which Jens added
for coming linux 5.13

> 
> Our end-goal is not to emulate epoll, but that seems like the quickest way of getting something working that we can do further experiments with.
> 
> For reference, if anyone's interested, our source repo is at : https://github.com/EQ-Alpha/KeyDB

-- 
Pavel Begunkov



[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