Skip to content

fix(fast_io): skip criterion io_uring bench on RLIMIT_MEMLOCK failure - #3572

Merged
oferchen merged 1 commit into
masterfrom
fix/criterion-io-uring-resilience
May 3, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/criterion-io-uring-resilience

Conversation

@oferchen

@oferchen oferchen commented May 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Sentinel-allocate one io_uring ring before each bench_with_input call. If the allocation fails (e.g. ENOMEM from RLIMIT_MEMLOCK on CI runners), skip the io_uring sub-benchmark with a clear log message and keep the standard_io baseline running.
  • The kernel-level is_io_uring_available() probe only checks the io_uring_register syscall surface; it does not catch per-ring allocation failures imposed by ulimit -l. The previous unwrap() inside b.iter panicked mid-iteration and killed the whole criterion process.
  • Surfaced by the Criterion Benchmarks workflow on tag v0.6.1:

    io_uring init failed: Cannot allocate memory (os error 12) at crates/fast_io/benches/io_optimizations.rs:198

Test plan

  • CI: fmt + clippy
  • CI: nextest stable (Linux)
  • CI: Windows stable
  • CI: macOS stable
  • CI: Linux musl stable

The kernel-level `is_io_uring_available()` probe does not catch ring
allocation failures from RLIMIT_MEMLOCK, which GitHub Actions runners
impose. When the limit is too low, `IoUringReader::open` /
`IoUringWriter::create` fail mid-iteration with ENOMEM and the entire
benchmark process panics, taking down the rest of the suite.

Sentinel-allocate one ring up front (outside `b.iter`). If allocation
succeeds, run the io_uring sub-benchmark; if it fails, log a clear
skip message and continue. The standard_io baseline still runs, and
the rest of the criterion suite remains usable.

Surfaced by Criterion Benchmarks workflow on tag v0.6.1:
> io_uring init failed: Cannot allocate memory (os error 12)
@github-actions github-actions Bot added the bug Something isn't working label May 3, 2026
@oferchen
oferchen merged commit 0449234 into master May 3, 2026
38 checks passed
@oferchen
oferchen deleted the fix/criterion-io-uring-resilience branch May 3, 2026 10:40
oferchen added a commit that referenced this pull request May 5, 2026
…#3572)

The kernel-level `is_io_uring_available()` probe does not catch ring
allocation failures from RLIMIT_MEMLOCK, which GitHub Actions runners
impose. When the limit is too low, `IoUringReader::open` /
`IoUringWriter::create` fail mid-iteration with ENOMEM and the entire
benchmark process panics, taking down the rest of the suite.

Sentinel-allocate one ring up front (outside `b.iter`). If allocation
succeeds, run the io_uring sub-benchmark; if it fails, log a clear
skip message and continue. The standard_io baseline still runs, and
the rest of the criterion suite remains usable.

Surfaced by Criterion Benchmarks workflow on tag v0.6.1:
> io_uring init failed: Cannot allocate memory (os error 12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant