[blk-threaded - 5/12] block: add worker thread activation - #6126
Closed
PierreBertholom wants to merge 6 commits into
Closed
PierreBertholom wants to merge 6 commits into
PierreBertholom wants to merge 6 commits into
Conversation
Virtio queues previously bundled transport configuration and runtime state. The transport only needs to read/modify queue config, not the full queues, and exposing queues as `&[Queue]` slices assumes all queues live contiguously in one owner which breaks once queues are owned by separate per-queue worker threads. Split out a transport-visible `QueueConfig` and replace the slice-returning trait methods with per-index accessors. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Keep block configuration in VirtioBlockConfig and remove duplicated fields. Move queues, eventfds, disk, and rate-limiter state to BlockResources. Keep configuration synchronized across runtime updates and snapshot restore. This prepares runtime resources to move to a worker thread. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Rate limiter will be shared between worker threads of a same device. Wrap rate limiter in mutex. Extract rate limiter registration to allow both inline and threaded paths to register timer_fd on the VMM event manager. Make `timer_active` flag an `Arc<AtomicBool>` for fast lookup by workers without acquiring the rate limiter mutex. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Move queue and completion processing into BlockWorker while keeping execution on the VMM thread. Transfer runtime resources to the worker on activation and return them on deactivation. This prepares the data path for worker thread support. Signed-off-by: Pierre Bertholom <pbertho@amazon.com>
Add WorkerHandle and ThreadedWorker to manage a block worker thread and its event loop. Use a channel+eventfd to start and finish the worker. Keep the structures disconnected from VirtioBlock until next 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>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## pbertho/blk-threaded-04 #6126 +/- ##
===========================================================
- Coverage 82.11% 81.95% -0.16%
===========================================================
Files 278 278
Lines 31225 31314 +89
===========================================================
+ Hits 25639 25663 +24
- Misses 5586 5651 +65
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
removed this pull request from stack #6135
September 9, 2026 10:07
Contributor
Author
|
Folded under #6128 after stack rework |
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.
[5/12] part of the PR stack starting with #6123
Changes
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.