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

Direct IO #259

Open
Noah-Kennedy opened this issue Mar 16, 2023 · 2 comments
Open

Direct IO #259

Noah-Kennedy opened this issue Mar 16, 2023 · 2 comments

Comments

@Noah-Kennedy
Copy link
Contributor

Noah-Kennedy commented Mar 16, 2023

Async direct IO is a very useful feature of io_uring, and it would be awesome to have this capability in here.

This will probably need another abstracted buffer API for aligned buffers.

It may be useful to look at the APIs in glommio for prior art.

@shikhar
Copy link

shikhar commented May 31, 2023

Linking a previous attempt adding DIO support #73

@jumpnbrownweasel
Copy link

jumpnbrownweasel commented May 29, 2024

Hello!

I was looking at @ahrens comment in the earlier #73 issue here about being able to provide custom direct buffers by implementing traits.

This made me wonder whether it is possible today to use direct IO in tokio_uring by:

  1. providing custom buffers aligned to the file's page size, and
  2. opening the file using std with the clib::O_DIRECT flag, and then converting it using File::from_std.

This seems possible from what I understand about uring and what I've read in the tokio_uring docs.

Has anyone done this? Is there something I'm overlooking or a hidden gotcha I should be aware of, before I try it myself?

Direct IO is important for my database implementation, since I want to rely on my own cache instead of the OS buffer pool.

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

No branches or pull requests

3 participants