Posix AIO Integration #18
Open
janjurca wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a new POSIX AIO I/O engine to support asynchronous file operations with configurable depth.
- Introduces
POSIXAIOEnginewithread,write, andcompletemethods managingaiocbstructures. - Registers a CLI parameter
--iodepthto control concurrent I/O depth. - Implements polling-based completion via
wait_for_some_completions.
Comments suppressed due to low confidence (1)
source/ioengines/engines/posixaio.cpp:31
- [nitpick] Consider renaming 'submitted_cbs' to 'submitted_cbs_' to match the member naming convention using a trailing underscore.
unsigned submitted_cbs = 0;
|
|
||
| ssize_t POSIXAIOEngine::complete() { | ||
| ssize_t total_bytes = 0; | ||
| while (submitted_cbs > 0) { |
There was a problem hiding this comment.
The loop in complete() busy-waits without blocking when no operations complete, which can cause high CPU usage. Consider using aio_suspend or adding a short sleep/delay to avoid spinning.
Suggested change
| while (submitted_cbs > 0) { | |
| while (submitted_cbs > 0) { | |
| if (!io_requests_.empty()) { | |
| const struct aiocb* const requests[io_requests_.size()]; | |
| std::copy(io_requests_.begin(), io_requests_.end(), const_cast<struct aiocb**>(requests)); | |
| int ret = aio_suspend(requests, io_requests_.size(), nullptr); | |
| if (ret < 0) { | |
| throw std::runtime_error(std::string("aio_suspend failed: ") + std::strerror(errno)); | |
| } | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.