Skip to content

[core] Add IO URing based mmap prefetch for Linux #36899

Open
t-jankowski wants to merge 9 commits into
openvinotoolkit:masterfrom
t-jankowski:tj/core/io-uring-lin
Open

[core] Add IO URing based mmap prefetch for Linux #36899
t-jankowski wants to merge 9 commits into
openvinotoolkit:masterfrom
t-jankowski:tj/core/io-uring-lin

Conversation

@t-jankowski

@t-jankowski t-jankowski commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Details:

  • Implements io_populate_mmap using io_uring on Linux to prefetch memory-mapped file regions via MADV_POPULATE_READ, replacing the previous stub.
  • Adds benchmark comparing io uring with parallel page touch via util::vm_prefetch.

Changes

  • cmake/features.cmake: Adds a new ENABLE_IO_URING CMake option (Linux-only, off by default).
  • src/common/util/CMakeLists.txt: Links liburing and defines ENABLE_IO_URING when the option is enabled.
  • src/common/util/src/os/lin/lin_io.cpp: Implements io_populate_mmap using io_uring_prep_madvise with MADV_POPULATE_READ to submit async prefetch requests in configurable-depth batches. Falls back to madvise(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

  • Requires Linux kernel ≥ 5.14 for MADV_POPULATE_READ support; falls back gracefully on older kernels.
  • Controlled at build time via -DENABLE_IO_URING=ON; no runtime behavior change when disabled.

Tickets:

AI Assistance:

  • *AI assistance used: yes
    problem analysis, code generation

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>
@github-actions github-actions Bot added category: Core OpenVINO Core (aka ngraph) category: build OpenVINO cmake script / infra labels Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_mmap on Linux using io_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.

Comment thread src/common/util/src/os/lin/lin_io.cpp Outdated
Comment thread src/common/util/src/os/lin/lin_io.cpp Outdated
Comment thread src/common/util/CMakeLists.txt
@t-jankowski t-jankowski marked this pull request as ready for review July 16, 2026 13:41
@t-jankowski t-jankowski requested review from a team as code owners July 16, 2026 13:41
@t-jankowski t-jankowski requested a review from Copilot July 16, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread src/common/util/src/os/lin/lin_io.cpp Outdated
Comment thread src/common/util/src/os/lin/lin_io.cpp
Comment thread src/common/util/src/os/lin/lin_io.cpp Outdated
Comment thread cmake/features.cmake Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: build OpenVINO cmake script / infra category: Core OpenVINO Core (aka ngraph)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants