compio-rs/compio

Support of registered file descriptors

开放

#28 创建于 2023年9月8日

 (20 条评论) (0 个反应) (1 位负责人)Rust (120 个派生)github user discovery
driver: io-uringenhancementhelp wanted

仓库指标

星标
 (1,732 个星标)
PR 合并指标
 (平均合并 2天 3小时) (30 天内合并 14 个 PR)

描述

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, 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

贡献者指南