All of lore.kernel.org
 help / color / mirror / Atom feed
* Emulating epoll
@ 2021-04-20 16:37 Jesse Hughes
  2021-04-20 16:59 ` Pavel Begunkov
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Hughes @ 2021-04-20 16:37 UTC (permalink / raw)
  To: io-uring; +Cc: John

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.

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?

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

Cheers,
Jesse

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

* Re: Emulating epoll
  2021-04-20 16:37 Emulating epoll Jesse Hughes
@ 2021-04-20 16:59 ` Pavel Begunkov
  2021-04-20 17:48   ` Jesse Hughes
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Begunkov @ 2021-04-20 16:59 UTC (permalink / raw)
  To: Jesse Hughes, io-uring; +Cc: John

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

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

* Re: Emulating epoll
  2021-04-20 16:59 ` Pavel Begunkov
@ 2021-04-20 17:48   ` Jesse Hughes
  2021-04-23 14:07     ` Pavel Begunkov
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Hughes @ 2021-04-20 17:48 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring; +Cc: John

Awesome, thanks for the info and your hard work Pavel!

Cheers,
Jesse

________________________________________
From: Pavel Begunkov <asml.silence@gmail.com>
Sent: Tuesday, April 20, 2021 9:59 AM
To: Jesse Hughes; io-uring@vger.kernel.org
Cc: John
Subject: Re: Emulating epoll

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

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

* Re: Emulating epoll
  2021-04-20 17:48   ` Jesse Hughes
@ 2021-04-23 14:07     ` Pavel Begunkov
  0 siblings, 0 replies; 4+ messages in thread
From: Pavel Begunkov @ 2021-04-23 14:07 UTC (permalink / raw)
  To: Jesse Hughes, io-uring; +Cc: John

On 4/20/21 6:48 PM, Jesse Hughes wrote:
> Awesome, thanks for the info and your hard work Pavel!

fwiw, there are also specialised send[msg],recv[msg] requests
supported, not only read/write, see IORING_OP_* opcodes

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

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

end of thread, other threads:[~2021-04-23 14:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 16:37 Emulating epoll Jesse Hughes
2021-04-20 16:59 ` Pavel Begunkov
2021-04-20 17:48   ` Jesse Hughes
2021-04-23 14:07     ` Pavel Begunkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.