Repository navigation
Conversation
added 2 commits
October 20, 2026 00:13
The writable layer's datafile now honors the global ioEngine so it can use libaio (O_DIRECT, wrapped in a 4K aligned adaptor) instead of always going through psync. turboOCI target/gzip files and posixaio fall back to psync. LSMT appends use positioned writes so the aligned adaptor stays in the I/O path, and both TCMU and ublk photon envs init libaio. Signed-off-by: Yifan Yuan <tuji.yyf@outlook.com>
Each ublk queue caches a fixed 32 photon I/O threads; with a deeper queue every I/O beyond that creates and destroys its own thread. Expose the size as ublkThreadPoolSize in overlaybd.json, default 32. Signed-off-by: Yifan Yuan <tuji.yyf@outlook.com>
BigVan
requested review from
liulanzheng
and
a balanced review from Copilot
and removed request for
Copilot
October 19, 2026 16:16
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Direct-I/O opening needs correction, and alignment-sensitive sealing needs regression validation before human approval.
1 open issue
What changed in this PR
This PR makes ublk queue thread caching configurable and extends configured I/O-engine support to writable upper data files.
Changes:
- Adds
ublkThreadPoolSize, defaulting to 32, with configuration documentation. - Enables libaio initialization and aligned upper-file I/O.
- Updates positioned LSMT writes and adds upper-engine regression tests.
| File | Description |
|---|---|
| src/ublk/ublk_device.cpp | Configures queue thread pools and initializes libaio. |
| src/test/image_service_test.cpp | Tests upper-file engines, concurrent writes, and reopening. |
| src/overlaybd/lsmt/file.cpp | Uses positioned writes for data, indexes, and trailers. |
| src/main.cpp | Enables libaio in shared I/O workers. |
| src/image_file.cpp | Selects upper-file engines and adds alignment handling. |
| src/example_config/overlaybd.json | Adds the thread-pool setting. |
| src/config.h | Defines the setting and default. |
| README.md | Documents per-queue thread caching. |
Review effort: Balanced
| auto engine = image_service.global_conf.ioEngine(); | ||
| if (!upper.target().empty() || engine == ioengine_posixaio) | ||
| engine = ioengine_psync; | ||
| data_file = open_localfile_adaptor(upper.data().c_str(), O_RDWR, 0644, engine); |
This branch has not been deployed
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 PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Please check the following list: