frevib / io_uring-echo-server

io_uring echo server
MIT License
365 stars 55 forks source link

IORING_FEAT_FAST_POLL question #5

Closed romange closed 4 years ago

romange commented 4 years ago

Hi,

I do not see anything in your code that does something differently. what IORING_FEAT_FAST_POLL does and where exactly you use it? (besides testing it in the features)

frevib commented 4 years ago

Hi Roman, have a look at this brach: https://github.com/frevib/io_uring-echo-server/tree/io-uring-feat-fast-poll

With IORING_FEAT_FAST_POLL you don’t have to poll a socket for ready data. So you can just call a recv (io_uring_prep_recv) on a socket and the moment there’s data ready it will complete and return as acqe on your ring. Because you don’t have to poll, you save a sys call. This can result in much better performance: https://github.com/frevib/io_uring-echo-server/blob/io-uring-feat-fast-poll/benchmarks/benchmarks.md

romange commented 4 years ago

Thanks for the explanation. Will wait untill 5.7 is out to test it!

On Mon, Apr 6, 2020, 22:26 Hielke de Vries notifications@github.com wrote:

Hi Roman, have a look at this brach: https://github.com/frevib/io_uring-echo-server/tree/io-uring-feat-fast-poll

With IORING_FEAT_FAST_POLL you don’t have to poll a socket for ready data. So you can just call a recv (io_uring_prep_recv) on a socket and the moment there’s data ready it will complete and return as acqe on your ring. Because you don’t have to poll, you save a sys call. This can result in much better performance: https://github.com/frevib/io_uring-echo-server/blob/io-uring-feat-fast-poll/benchmarks/benchmarks.md

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/frevib/io_uring-echo-server/issues/5#issuecomment-609990464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4BFCCT6G2VWBOWR25EEPLRLIUHJANCNFSM4MCQ5SRQ .

Sherlock-Holo commented 3 years ago

@frevib That makes me confuse, when the fast poll doesn't exist in old kernel, I still can readv the tcp socket directly through io_uring, so what fast poll actually do in the new kernel?

eecheng87 commented 3 years ago

Hi, @frevib In io_uring-echo-server example, I only saw you check whether IORING_FEAT_FAST_POLL is supported.

Don't we set the flag before io_uring_queue_init_params? Is this feature is default?

Thanks in advance.

frevib commented 3 years ago

Hi,

This echo server was built a two years ago when io_uring was not very well known and didn’t have many features. So maybe things have changed and we need so set io_uring_queue_init_params like you say, but I don’t know.