IO Uring supports registration of file descriptors. Instead of maintaining reference counts for each IO operation Linux constructs user provided indirection array for each thread.
Registration is beneficial for long lived descriptors. Refcounting overhead is relatively significant for small submit batches.
I'm personally interested in driver-level support of registered file descriptors.
I see the following approaches:
- define driver specific operations with registered fds. User either prefers a single platform or writes 2 IO data paths for regular and registered file descriptors. IO Uring could expose tokio-uring Fd or FixedFd, platform independent ops code wraps RawFd into Fd.
- define common registration interface. For platforms that don't support registration driver could maintain indirection array in userspace.
- separate operations for regular/registered fds, no runtime overhead (branching) at operation construction time, more duplicate code
- generic interface with enum and 2 newtype wrappers like in
tokio-uring - regular/registered enum, macro enum handling, macro param with implicit type that wraps either regular or registered fd - less duplication, but more complex macro-based code, branching runtime overhead
IO Uring supports registration of file descriptors. Instead of maintaining reference counts for each IO operation Linux constructs user provided indirection array for each thread.
Registration is beneficial for long lived descriptors. Refcounting overhead is relatively significant for small submit batches.
I'm personally interested in driver-level support of registered file descriptors.
I see the following approaches:
tokio-uring- regular/registered enum, macro enum handling, macro param with implicit type that wraps either regular or registered fd - less duplication, but more complex macro-based code, branching runtime overhead