Merged
Conversation
Collaborator
ming1
commented
Sep 25, 2025
- convert compress target into async/.await
- use smol::unblock() for offloading compress io handling
- remove offload module
- convert to new polling & executor APIs
- depend on libublk 0.4.4 and io-uring 0.7.9
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
…vents - Update src/null.rs, src/loop.rs, src/vram.rs, and src/zoned.rs - Use new wait_and_handle_io_events() API for better async integration - Adopt cleaner pattern with Rc<LocalExecutor> for better memory management - Move async logic inside executor run block to eliminate borrow checker issues Signed-off-by: Ming Lei <tom.leiming@gmail.com>
- Remove all offload handler dependencies and sync IO handling - Convert all IO operations (read, write, flush, discard) to async functions - Simplify buffer management to use only IoBuf allocation - Remove support for user_copy, zero_copy, and AUTO_BUF_REG - Use clean async/await pattern similar to other targets like null.rs - Remove unused imports and simplify function signatures Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Add CompressQueue struct that contains UblkQueue reference and eventfd for cross-thread notification. Update handle_compress_io_cmd_async() to use CompressQueue instead of direct UblkQueue parameter. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Rename existing handle_read() to __handle_read() and implement new async handle_read() that: - Submits PollAdd SQE on eventfd for notification - Uses smol::unblock() to offload __handle_read() to thread pool - Writes to eventfd from closure to notify ublk queue thread Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Rename existing handle_flush() to __handle_flush() and implement new async handle_flush() that: - Submits PollAdd SQE on eventfd for notification - Uses smol::unblock() to offload __handle_flush() to thread pool - Writes to eventfd from closure to notify ublk queue thread Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Add notify_blocking_io_done() method to CompressQueue that encapsulates the eventfd write operation with proper error handling using anyhow::Result. Update handle_read() and handle_flush() to use the new method instead of direct eventfd writes. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Now smol::unblock() can work just fine, and not necessary to maintain the invented wheel any more. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
980d7a1 to
76384b5
Compare
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.