Repository navigation
core: a direct read the file system refuses goes through the page cache - #916
Open
plotarmordev wants to merge 1 commit into
Open
plotarmordev wants to merge 1 commit into
plotarmordev wants to merge 1 commit into
Conversation
Some file systems accept an O_DIRECT open and then fail the aligned read with EINVAL. The reader now clears O_DIRECT on that descriptor and reads again through the page cache instead of failing the load; a test injects the refusal.
This was referenced Oct 16, 2026
Open
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.
What this changes
When a file system accepts an
O_DIRECTopen but fails the aligned read withEINVAL,core.direct_ionow clearsO_DIRECTon that descriptor and reads through the page cache instead of failing the load (part of #914).Nemotron's CUDA loader already reads through
direct_io.Receipt
6bb9daaca25a, on mainc7137bb3. No MLX or PyTorch.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: not run. Notoken path is touched. The new test checks that the bytes read are the file's bytes.
tools/bench_openai.py: not run. Decode does no file reads.ttft_sfromtools/bench_cache.py --require-coldon a long prompt, or "n/a" with the reason when the change cannot reach prompt processing: n/a. Only checkpointloading reads files, and loading on file systems that serve
O_DIRECTreads takes the unchanged path.CUDA_VISIBLE_DEVICES= zig build test-cuda-host --summary allfrom an empty local cache: 27/27 steps, 466 passed, 0 failed, 0 skipped.EINVALthrough the reader's
preadhook.ReadFailed("read of 102400 bytes at 12288 failed: INVAL").Command:
CUDA_VISIBLE_DEVICES= zig build test-cuda-hostonc7137bb3plus only this test and itsRefusehelper.
zig build native -Dnvcc=/usr/local/cuda/bin/nvcc --summary all: 42/42 steps.python3 tools/zig/lean_check.py: 527 problems, the same as main's 527 (tools/zig/lean_new.py: 0 new).zig fmt --check build.zig zig: clean.O_DIRECTreads was not available, so the refusal is injected.Checklist
path is touched.)
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Notrun; no output path is touched.)
arithmetic changes.)
Linux or without
O_DIRECT.)