Skip to content

Posix AIO Integration #18

Open
janjurca wants to merge 2 commits into
develfrom
feature/posixaio
Open

Posix AIO Integration #18
janjurca wants to merge 2 commits into
develfrom
feature/posixaio

Conversation

@janjurca
Copy link
Copy Markdown
Owner

No description provided.

@janjurca janjurca changed the base branch from master to devel May 14, 2025 13:39
@janjurca janjurca requested a review from Copilot June 4, 2025 11:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new POSIX AIO I/O engine to support asynchronous file operations with configurable depth.

  • Introduces POSIXAIOEngine with read, write, and complete methods managing aiocb structures.
  • Registers a CLI parameter --iodepth to 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) {
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
}
}

Copilot uses AI. Check for mistakes.
Comment thread source/ioengines/engines/posixaio.cpp
Comment thread source/ioengines/engines/posixaio.cpp Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants