From b8ed4358f1cb97fa23255e003e5f5a789eceb2a3 Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Fri, 1 Aug 2025 14:56:43 -0400 Subject: [PATCH] register buffers sparse on ring initiate to support fixed operations --- core/io/io_uring.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/io/io_uring.rs b/core/io/io_uring.rs index 1fc74cf1e..ff0c7c793 100644 --- a/core/io/io_uring.rs +++ b/core/io/io_uring.rs @@ -105,6 +105,10 @@ impl UringIO { }; // we only ever have 2 files open at a time for the moment ring.submitter().register_files_sparse(FILES)?; + // RL_MEMLOCK cap is typically 8MB, the current design is to have one large arena + // registered at startup and therefore we can simply use the zero index, falling back + // to similar logic as the existing buffer pool for cases where it is over capacity. + ring.submitter().register_buffers_sparse(1)?; let inner = InnerUringIO { ring: WrappedIOUring { ring, @@ -469,9 +473,6 @@ impl IO for UringIO { let inner = self.inner.borrow_mut(); let default_id = 0; unsafe { - // RL_MEMLOCK cap is typically 8MB, the current design is to have one large arena - // registered at startup and therefore we can simply use the zero index, falling back - // to similar logic as the existing buffer pool for cases where it is over capacity. inner.ring.ring.submitter().register_buffers_update( default_id, &[libc::iovec {