Repository navigation
Properly handle O_DIRECT in io-uring - #8833
Merged
Merged
Conversation
coszio
force-pushed
the
proper-odirect-uring
branch
from
April 28, 2026 21:23
db0afb0 to
a50e4e3
Compare
Closed
This comment was marked as low quality.
This comment was marked as low quality.
coszio
force-pushed
the
proper-odirect-uring
branch
from
April 29, 2026 13:43
3508b67 to
282dfc2
Compare
coszio
marked this pull request as ready for review
April 29, 2026 13:49
generall
reviewed
Apr 29, 2026
| use crate::maybe_uninit; | ||
|
|
||
| pub struct IoUringRuntime<'data, T, Meta = u64> { | ||
| const KERNEL_PAGE_SIZE: u64 = 4096; // 4 kB |
Member
There was a problem hiding this comment.
maybe
qdrant/lib/common/common/src/mmap/advice.rs
Line 311 in f321c9f
Contributor
Author
There was a problem hiding this comment.
Uring is for linux only, so I assumed 4kb to be fine.
If we want to make sure to use the right value which is checked at runtime, Claude says we'd need our own abstraction that uses std::alloc::Layout, with its own Drop impl, along with a bunch of unsafe code.
If we want to be sure without those shenanigans, we can increase the const to 16kb, which covers all cases. We'll use it at 16kb anyways for disk cache 🤷.
ffuugoo
reviewed
Apr 30, 2026
generall
approved these changes
May 5, 2026
ffuugoo
approved these changes
May 5, 2026
timvisee
pushed a commit
that referenced
this pull request
May 8, 2026
* handle o_direct with custom buffer * make separate impl * use correct inner offset * align buffer * codespell * review fixes * use o_direct in tests * clippy * fix simple read impl * simpler to_vec() * use router function * change todo comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of allowing short reads when using
O_DIRECT(see #8466, #8808), this PR properly handles the flag by generating an aligned buffer, and extracting the requested output from it after it has been filled.To do this, I added a new
IoUringRequest::ODirectReadvariant, which holds the extended buffer, and the information to extract the requested items from it.