Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io_uring support #39

Open
dvc94ch opened this issue Oct 10, 2020 · 8 comments
Open

io_uring support #39

dvc94ch opened this issue Oct 10, 2020 · 8 comments

Comments

@dvc94ch
Copy link
Contributor

dvc94ch commented Oct 10, 2020

Mostly for tech porn reasons, it's new and shiny. Apparently it's also faster. Not sure if it fits in async-io, because it works very different from epoll from what I understand by reading withoutboats blog.

@ghost
Copy link

ghost commented Oct 10, 2020

I think io_uring would fit in async-io. We can keep using epoll and then only use io_uring inside AsyncRead and AsyncWrite implementations. So epoll would still be the primary mechanism for checking if a FD is readable or writable, while io_uring would be an optimization for fast reads and writes.

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Oct 10, 2020

Getting async file reads and writes, random numbers and stdin/stdout would be cool... These things require a thread pool using epoll.

@tinywombat765
Copy link

Has there any progress or further work on this?

@notgull
Copy link
Member

notgull commented Aug 17, 2022

Is there still an interest in this? I feel like we could do this pretty easily now using the io_uring crate.

@sehz
Copy link

sehz commented Aug 17, 2022

Would prefer to using: https://docs.rs/rustix/latest/rustix/io_uring/index.html. Benefits:

  • Safe system call
  • I/O Safety

@notgull
Copy link
Member

notgull commented Aug 17, 2022

Would prefer to using: https://docs.rs/rustix/latest/rustix/io_uring/index.html. Benefits:

* Safe system call

* I/O Safety

I feel like the io_uring crate provides a more comprehensive API that makes it easier to not dip your hands in unions. Since io_uring deals in raw pointers anyhow, I doubt that I/O safety will matter much as well.

@notgull
Copy link
Member

notgull commented Nov 26, 2023

I tried integrating io_uring into async-io, but when it comes to the syscalls that async-io uses (for polling for reads and writes), epoll ends up being faster.

However it might be more useful for higher level crates, like async-net and async-fs (rel: smol-rs/async-fs#24). In this case we can just call the operations themselves rather than needing to go through polling.

Of course, setting all of this up would be a lot of work I don't have time for. So unless someone sponsors me to do this, I'll wait for someone else to put in the elbow grease.

@gaykitty
Copy link

I did something similar for my grad project and came to the same conclusion. Using io_uring while trying to emulate the APIs of something as low level as async-io has no benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

5 participants