mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #79] [CLOSED] linux: make DirectFile reads actually asynchronous #2440
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2440
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/79
Author: @andrewcoul
Created: 9/28/2026
Status: ❌ Closed
Base:
main← Head:posix-async-ple-reads📝 Commits (1)
66dee5blinux: make DirectFile reads actually asynchronous📊 Changes
1 file changed (+78 additions, -6 deletions)
View changed files
📝
src/platform/direct_file.cpp(+78 -6)📄 Description
What
On Linux,
DirectFile::submit()ran a blockingpreadand queued the completion, so the PLE reader'smax_inflightwindow never had more than one read in flight: the reads ran back to back on the caller's thread. The Windows backend uses overlapped I/O, so it was already asynchronous there.submit()now queues the request and a pool of threads (STRATA_PLE_IO_THREADS, default 32) issues the preads.wait()andwake()keep their contract (wake()shows up as oneWAKE_TAGcompletion,wait(timeout)blocks up to the timeout). I removed the "Phase L replaces this with io_uring" comment; if io_uring is still planned, this is a stepping stone toward it.Measurements (one machine)
Ryzen 7 7800X3D, RTX 4080 SUPER, 32 GB RAM, NVMe, Linux, IQ3_XXS pack. These were measured together with the tiered-experts work (the follow-up PR), where cold experts also stream from the SSD:
Tests
ple_reader_test --selftestpasses: 3 plain runs, 1 under ThreadSanitizer (no reports), and withSTRATA_PLE_IO_THREADS=1and=128. I built it by hand (g++onple_reader_test.cpp,ple_reader.cpp,kernels/ngram.cpp,platform/direct_file.cpp) because-DSTRATA_BUILD_TESTS=ONdoes not configure onmain(thetests/directory and severalbench/microsources are not in the repo). Not run on Windows; that code is unchanged.Open
The thread count default (32) is a guess that worked here; happy to tie it to
max_inflightor change it.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.