Skip to content

io_uring: add an opt-in for NO_IOWAIT accounting - #258

Open
bvolpato wants to merge 1 commit into
mitchellh:mainfrom
bvolpato:bvolpato/io-uring-no-iowait-opt-in
Open

bvolpato wants to merge 1 commit into
mitchellh:mainfrom
bvolpato:bvolpato/io-uring-no-iowait-opt-in

Conversation

@bvolpato

@bvolpato bvolpato commented Oct 28, 2026 •

Copy link
Copy Markdown

Summary

Let applications waiting on non-storage events opt out of Linux I/O-wait accounting for blocking io_uring waits. Keep the existing default policy.

Related to #216. The opt-in, feature-gated policy follows the existing reproductions and the October 21 proposal. This implements that policy on current Zig 0.17 main.

Impact

Blocking wait Before After
Default options GETEVENTS (0x1) Unchanged
Opt-in, kernel advertises support GETEVENTS (0x1) `GETEVENTS
Opt-in, feature bit absent GETEVENTS (0x1) Unchanged

Nonblocking paths keep their existing behavior. This changes accounting policy. Application latency, throughput, and power benefits have not been established.

Changes

Add the io_uring-specific no_iowait option, defaulting to false. Gate the flag on a positive wait and IORING_FEAT_NO_IOWAIT (Linux 6.15+), covering both combined submit/wait and waits after submission overflow. No Ghostty adoption or C API change is included.

Testing

  • zig build test -Demit-man-pages=false -j2 --summary all passed on Linux x86_64 with Zig 0.17.
  • Independently rebuilt eventfd fixtures and syscall traces confirmed the flag behavior above for ordinary/overflow waits. Static and dynamic epoll accept the shared option.
  • The committed regression covers feature gating and completion behavior. The separate trace checks observe syscall flags. Unsupported-kernel fallback was simulated by masking the feature bit. Older kernels and non-Linux runtimes remain untested.
  • Zig 0.17 requests the same preexisting enum-conversion migration at base and head. Scoped Zig 0.16 formatting passes.

Upstream CI awaits maintainer approval for this fork's workflow.

@bvolpato
bvolpato marked this pull request as ready for review October 28, 2026 23:59
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.

1 participant