Skip to content

[Async] Gracefully degrade io_uring slab registration on RLIMIT_MEMLOCK#23654

Merged
benvanik merged 1 commit intomainfrom
users/benvanik/rlimit
Mar 5, 2026
Merged

[Async] Gracefully degrade io_uring slab registration on RLIMIT_MEMLOCK#23654
benvanik merged 1 commit intomainfrom
users/benvanik/rlimit

Conversation

@benvanik
Copy link
Collaborator

@benvanik benvanik commented Mar 5, 2026

When IORING_REGISTER_BUFFERS[_UPDATE] fails with ENOMEM (kernel cannot pin pages due to RLIMIT_MEMLOCK), fall back to copy-based I/O instead of returning a hard error. The region is still created with full pool management support, but the send path uses regular sends instead of SEND_ZC with fixed buffer indices.

This fixes a flake on arm64 CI runners where RLIMIT_MEMLOCK is too low for the 1MB buffer registration in ZeroCopySendRegisteredLargeTransfer.

ci-extra: all

@benvanik benvanik added the runtime Relating to the IREE runtime library label Mar 5, 2026
When IORING_REGISTER_BUFFERS[_UPDATE] fails with ENOMEM (kernel cannot
pin pages due to RLIMIT_MEMLOCK), fall back to copy-based I/O instead
of returning a hard error. The region is still created with full pool
management support, but the send path uses regular sends instead of
SEND_ZC with fixed buffer indices.

This fixes a flake on arm64 CI runners where RLIMIT_MEMLOCK is too low
for the 1MB buffer registration in ZeroCopySendRegisteredLargeTransfer.

Changes:
- region.h: base_buffer_index changed from uint16_t to int16_t with -1
  sentinel (mirrors existing buffer_group_id pattern)
- proactor_registration.c: ENOMEM triggers a Tracy WARNING and returns
  ok instead of capturing a stack trace via iree_make_status; non-ENOMEM
  errors (EINVAL, EFAULT) still fail hard
- proactor_submit.c: send eligibility check bails on base_buffer_index
  < 0, falling back to copy-based send

ci-extra: all

Co-Authored-By: Claude <[email protected]>
@benvanik benvanik force-pushed the users/benvanik/rlimit branch from ba92a5e to ecb19da Compare March 5, 2026 00:47
@benvanik benvanik marked this pull request as ready for review March 5, 2026 02:05
@benvanik benvanik added the post-merge-review Ben's special place. People can pick these up and review them for forward fixes if interested. label Mar 5, 2026
@benvanik benvanik merged commit 92bbb28 into main Mar 5, 2026
66 checks passed
@benvanik benvanik deleted the users/benvanik/rlimit branch March 5, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

post-merge-review Ben's special place. People can pick these up and review them for forward fixes if interested. runtime Relating to the IREE runtime library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant