register buffers sparse on ring initiate to support fixed operations

This commit is contained in:
PThorpe92
2025-08-01 14:56:43 -04:00
parent 9289dd7e9a
commit b8ed4358f1

View File

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