[core] Add IO URing based mmap prefetch for Linux #36899
Open
t-jankowski wants to merge 9 commits into
Open
Conversation
Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional Linux-only io_uring implementation for prefetching memory-mapped regions (MADV_POPULATE_READ), plus a benchmark to compare it against parallel page-touch prefetch, controlled by a new ENABLE_IO_URING CMake option.
Changes:
- Introduces
ENABLE_IO_URING(Linux-only, OFF by default) to gate io_uring support at build time. - Implements
ov::util::io_populate_mmapon Linux usingio_uring_prep_madvise(..., MADV_POPULATE_READ)with a madvise-based fallback. - Extends the file load benchmark to compare io_uring prefetch vs. thread-based page touching when io_uring is enabled.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cmake/features.cmake | Adds ENABLE_IO_URING build option (Linux-only). |
| src/common/util/CMakeLists.txt | Wires the option into util build (defines macro, links liburing). |
| src/common/util/src/os/lin/lin_io.cpp | Implements Linux io_populate_mmap via io_uring + fallback. |
| src/core/tests/CMakeLists.txt | Propagates ENABLE_IO_URING define to the benchmark target. |
| src/core/tests/file_load_benchmark.cpp | Adds an io_uring vs page-touch benchmark section gated by ENABLE_IO_URING. |
Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
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.
Details:
io_populate_mmapusing io_uring on Linux to prefetch memory-mapped file regions viaMADV_POPULATE_READ, replacing the previous stub.util::vm_prefetch.Changes
cmake/features.cmake: Adds a newENABLE_IO_URINGCMake option (Linux-only, off by default).src/common/util/CMakeLists.txt: Linksliburingand definesENABLE_IO_URINGwhen the option is enabled.src/common/util/src/os/lin/lin_io.cpp: Implementsio_populate_mmapusingio_uring_prep_madvisewithMADV_POPULATE_READto submit async prefetch requests in configurable-depth batches. Falls back tomadvise(MADV_SEQUENTIAL | MADV_WILLNEED)when io_uring is unavailable or queue init fails.src/core/tests/file_load_benchmark.cpp: Adds a benchmark that compares io_uring prefetch against page-touch (thread-based) prefetch across file sizes of 10 MB–1 GB and multiple queue depths.Notes
MADV_POPULATE_READsupport; falls back gracefully on older kernels.-DENABLE_IO_URING=ON; no runtime behavior change when disabled.Tickets:
AI Assistance:
problem analysis, code generation