Skip to content

Conversation

andresilva
Copy link
Collaborator

@andresilva andresilva commented Aug 24, 2025

Replaces timeout SQEs for force_poll and shutdown_timeout with submit_with_args with a timespec, which uses the kernel's EXT_ARG feature (5.11+) for bounded waits without the overhead of submitting and processing timeout operations.

See IORING_ENTER_EXT_ARG in https://man7.org/linux/man-pages/man2/io_uring_enter.2.html.

@patrick-ogrady
Copy link
Contributor

If you're aware of a better way to handle network-driven ops in iouring, we're all ears.

@andresilva
Copy link
Collaborator Author

I think the best way to go about it would be to gradually incorporate more of the features that io_uring provides: vectored reads/writes, multishot, registered buffers, zero-copy (thought might not be worth it for small messages), SQPOLL and FAST_POLL. In no particular order.

@patrick-ogrady
Copy link
Contributor

I think the best way to go about it would be to gradually incorporate more of the features that io_uring provides: vectored reads/writes, multishot, registered buffers, zero-copy (thought might not be worth it for small messages), SQPOLL and FAST_POLL. In no particular order.

I think monoio is probably the most advanced here. I suspect we can draw some inspiration from their work (to guide priority): https://github.com/bytedance/monoio

Copy link
Collaborator

@danlaine danlaine left a comment

Choose a reason for hiding this comment

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

2 nits otherwise LGTM!

@patrick-ogrady patrick-ogrady requested a review from Copilot August 25, 2025 18:11
Copy link
Contributor

@Copilot 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

This PR modernizes the io_uring runtime to use the EXT_ARG feature for bounded waits instead of submitting timeout SQEs. The change reduces overhead by leveraging kernel 5.11+ functionality that allows timeouts to be specified directly in the submission arguments.

  • Replaces timeout SQE submissions with submit_with_args using timespec for both force polling and shutdown timeouts
  • Removes special timeout work IDs and associated handling logic for force polling and shutdown
  • Simplifies the drain function by eliminating async timeout management

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@patrick-ogrady patrick-ogrady merged commit ce5341d into commonwarexyz:main Aug 25, 2025
34 checks passed
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.71%. Comparing base (8523459) to head (2148d8e).
⚠️ Report is 5 commits behind head on main.

@@            Coverage Diff             @@
##             main    #1467      +/-   ##
==========================================
+ Coverage   91.69%   91.71%   +0.01%     
==========================================
  Files         278      278              
  Lines       70326    70501     +175     
==========================================
+ Hits        64487    64658     +171     
- Misses       5839     5843       +4     

see 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8523459...2148d8e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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