Skip to content

io_uring pipelinemaxxing - #8897

Merged
ffuugoo merged 1 commit into
devfrom
io_uring-max-pipeline-utilization
May 5, 2026
Merged

ffuugoo merged 1 commit into
devfrom
io_uring-max-pipeline-utilization

Conversation

@ffuugoo

@ffuugoo ffuugoo commented May 4, 2026

Copy link
Copy Markdown
Contributor

Restructure IoUringPipeline::wait so that we submit operations more aggressively for better potential parallelism utilization.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --workspace --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@ffuugoo
ffuugoo requested review from generall and xzfc May 4, 2026 22:29
@ffuugoo

ffuugoo commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Maaaybe worth adding some comments... 😅

@coderabbitai

This comment was marked as resolved.

if !has_pending && self.runtime.in_progress == 0 {
return Ok(None);
}
let next = self.runtime.completed().next();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

First, check if any operations completed already

Comment on lines +186 to +187
if next.is_some() && enqueued > 0 {
self.runtime.submit_and_wait(0)?;

@ffuugoo ffuugoo May 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If some operation completed already, we don't need to wait for any more operations... but we can submit more operations to be processed in the background (so that they may be completed by the time we call wait again)

Comment on lines +188 to 189
} else if next.is_none() && enqueued + self.runtime.in_progress > 0 {
self.runtime.submit_and_wait(1)?;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If there are no completed operations available, but there are some operations pending (either enqueued but not yet submitted, or submitted but not yet completed), we submit all enqueued operations and wait for 1 operation to complete

Comment on lines +192 to +194
let Some(result) = next.or_else(|| self.runtime.completed().next()) else {
return Ok(None);
};

@ffuugoo ffuugoo May 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • Take already completed operation (if one was available at the top of wait)
  • Or take newly completed operation (if there were pending operations, and we waited for some operation to complete)
  • Or simply return None (if no operations, pending or completed, were available)

@ffuugoo
ffuugoo merged commit 4ef7b1e into dev May 5, 2026
15 checks passed
@ffuugoo
ffuugoo deleted the io_uring-max-pipeline-utilization branch May 5, 2026 09:18
timvisee pushed a commit that referenced this pull request May 8, 2026
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.

3 participants