[blk-threaded - 2/5] block: add worker thread lifecycle - #6128
Merged
PierreBertholom merged 8 commits intoSep 30, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature/virtio-blk-threaded #6128 +/- ##
===============================================================
- Coverage 82.73% 82.43% -0.31%
===============================================================
Files 278 278
Lines 31562 31973 +411
===============================================================
+ Hits 26114 26356 +242
- Misses 5448 5617 +169
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PierreBertholom
force-pushed
the
pbertho/blk-threaded-04
branch
from
September 9, 2026 10:05
5209e74 to
de67812
Compare
PierreBertholom
requested review from
Manciukic,
marco-marangoni and
micz010
as code owners
September 9, 2026 10:06
PierreBertholom
removed this pull request from stack #6135
September 9, 2026 10:07
PierreBertholom
changed the base branch from
pbertho/blk-threaded-03
to
pbertho/blk-threaded-01
September 9, 2026 10:07
PierreBertholom
added this pull request to stack #6198
September 9, 2026 10:08
This was referenced Sep 9, 2026
PierreBertholom
force-pushed
the
pbertho/blk-threaded-04
branch
2 times, most recently
from
September 14, 2026 18:29
0f96cb0 to
5183429
Compare
PierreBertholom
force-pushed
the
pbertho/blk-threaded-04
branch
from
September 14, 2026 20:36
5183429 to
1dbb601
Compare
Base automatically changed from
pbertho/blk-threaded-01
to
feature/virtio-blk-threaded
September 15, 2026 14:35
PierreBertholom
force-pushed
the
pbertho/blk-threaded-04
branch
from
September 15, 2026 14:35
1dbb601 to
059e59a
Compare
ShadowCurse
reviewed
Sep 15, 2026
PierreBertholom
force-pushed
the
pbertho/blk-threaded-04
branch
3 times, most recently
from
September 16, 2026 15:57
96137d2 to
f28dcc4
Compare
ShadowCurse
reviewed
Sep 18, 2026
Use &str instead of String in DiskProperties::new because DiskProperties no longer stores the file path. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
PierreBertholom
force-pushed
the
pbertho/blk-threaded-04
branch
from
September 18, 2026 14:46
f28dcc4 to
dad9795
Compare
ShadowCurse
previously approved these changes
Sep 21, 2026
not4s
reviewed
Sep 22, 2026
not4s
reviewed
Sep 22, 2026
not4s
left a comment
Contributor
There was a problem hiding this comment.
Are there any tests coming in later? The tests should be included in the relevant commits ideally, but if they're coming in later I'm fine with it
Contributor
|
Overall looks great, just a few minor comments |
Add WorkerHandle and ThreadedWorker to manage a block worker thread and its event loop. Use a channel and eventfd to start and finish the worker. Treat control send and notification failures as invariants. Keep the structures disconnected from VirtioBlock until later commits add lifecycle wiring. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Add inline and threaded active states and transfer runtime resources to the worker thread during activation. Keep queue config and interrupt state on the VMM thread and register runtime events on the thread that owns the data path. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
A signal interrupting io_uring_enter makes it return early, with the submitted count if it also submitted, else with EINTR. Loop until the CQ holds every operation and retry on EINTR. Other errors are still returned to the caller. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Add a reset path that returns data-path resources to the VMM thread and parks the worker for reactivation. Move ownership transitions into `_reset()`. Drain and join an active worker thread when the device is dropped. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Forward disk image updates to the worker. Return the updated disk capacity required by the VMM to update config space. Wake the worker after the VMM handles a rate limiter timer event. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Only allow snapshots to be saved while the VM is paused. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Pause the worker and collect its queue state when saving a snapshot. Mark queue memory dirty after saving and use kick to resume the worker. Keep fsync failures non-fatal. Treat other drain failures as unrecoverable state. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
PierreBertholom
force-pushed
the
pbertho/blk-threaded-04
branch
from
September 29, 2026 14:18
dad9795 to
661c427
Compare
Contributor
Author
They come later in #6132 (4/5 PR) |
JackThomson2
approved these changes
Sep 30, 2026
ShadowCurse
approved these changes
Sep 30, 2026
PierreBertholom
merged commit Sep 30, 2026
8c0d752
into
feature/virtio-blk-threaded
8 of 9 checks passed
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.
[2/5] part of the PR stack starting with #6123
Add the complete lifecycle for an optional dedicated block worker thread.
Changes
WorkerHandleandThreadedWorker.A later pull request exposes threaded mode through the public API.