pub struct Builder<S: EntryMarker = Entry, C: EntryMarker = Entry> { /* private fields */ }
Expand description
IoUring build params
Implementations§
source§impl<S: EntryMarker, C: EntryMarker> Builder<S, C>
impl<S: EntryMarker, C: EntryMarker> Builder<S, C>
sourcepub fn dontfork(&mut self) -> &mut Self
pub fn dontfork(&mut self) -> &mut Self
Do not make this io_uring instance accessible by child processes after a fork.
sourcepub fn setup_iopoll(&mut self) -> &mut Self
pub fn setup_iopoll(&mut self) -> &mut Self
Perform busy-waiting for I/O completion events, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request). This will reduce latency, but increases CPU usage.
This is only usable on file systems that support polling and files opened with O_DIRECT
.
sourcepub fn setup_sqpoll(&mut self, idle: u32) -> &mut Self
pub fn setup_sqpoll(&mut self, idle: u32) -> &mut Self
Use a kernel thread to perform submission queue polling. This allows your application to issue I/O without ever context switching into the kernel, however it does use up a lot more CPU. You should use it when you are expecting very large amounts of I/O.
After idle
milliseconds, the kernel thread will go to sleep and you will have to wake it up
again with a system call (this is handled by Submitter::submit
and
Submitter::submit_and_wait
automatically).
When using this, you must register all file descriptors with the Submitter
via
Submitter::register_files
.
This requires root priviliges.
sourcepub fn setup_sqpoll_cpu(&mut self, cpu: u32) -> &mut Self
pub fn setup_sqpoll_cpu(&mut self, cpu: u32) -> &mut Self
Bind the kernel’s poll thread to the specified cpu. This flag is only meaningful when
Builder::setup_sqpoll
is enabled.
sourcepub fn setup_cqsize(&mut self, entries: u32) -> &mut Self
pub fn setup_cqsize(&mut self, entries: u32) -> &mut Self
Create the completion queue with the specified number of entries. The value must be greater
than entries
, and may be rounded up to the next power-of-two.
sourcepub fn setup_clamp(&mut self) -> &mut Self
pub fn setup_clamp(&mut self) -> &mut Self
Clamp the sizes of the submission queue and completion queue at their maximum values instead of returning an error when you attempt to resize them beyond their maximum values.
sourcepub fn setup_attach_wq(&mut self, fd: RawFd) -> &mut Self
pub fn setup_attach_wq(&mut self, fd: RawFd) -> &mut Self
Share the asynchronous worker thread backend of this io_uring with the specified io_uring file descriptor instead of creating a new thread pool.
sourcepub fn setup_r_disabled(&mut self) -> &mut Self
pub fn setup_r_disabled(&mut self) -> &mut Self
Start the io_uring instance with all its rings disabled. This allows you to register
restrictions, buffers and files before the kernel starts processing submission queue
events. You are only able to register restrictions when
the rings are disabled due to concurrency issues. You can enable the rings with
Submitter::register_enable_rings
.