compio-rs / compio-rs/compio

Support of registered file descriptors

Open
#28 20 comments 0 reactions 1 assignee Claimed by @DXist View on GitHub
driver: io-uring enhancement help wanted
Dominant language
Rust
Stars
1.9k
Forks
133
Avg merge
1d 4h
Merged PRs (30d)
20

Description

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:

1. 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.
2. define common registration interface. For platforms that don't support registration driver could maintain indirection array in userspace.
1. separate operations for regular/registered fds, no runtime overhead (branching) at operation construction time, more duplicate code
2. generic interface with enum and 2 newtype wrappers like in `tokio-uring` - [regular/registered enum](https://github.com/tokio-rs/io-uring/blob/master/src/types.rs#L8), [macro enum handling](https://github.com/tokio-rs/io-uring/blob/master/src/opcode.rs#L14), [macro param with implicit type that wraps either regular or registered fd](https://github.com/tokio-rs/io-uring/blob/master/src/opcode.rs#L126) - less duplication, but more complex macro-based code, branching runtime overhead

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.