-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateC-feature-requestCategory: A feature request.Category: A feature request.M-fsModule: tokio/fsModule: tokio/fs
Description
This proposal suggests adding support for io_uring in Tokio's file API. The following provides the details of this proposal.
Proposal: https://hackmd.io/@ScaowLCjTCGW9slfxHgVHw/SkRCb0zCkx
Summary
- This proposal suggests adding support for io_uring in Tokio's file API.
- Initially, the goal is to transparently replace the file API backend with io_uring from a thread pool. Advanced features such as registered fds or registered buffers will probably be addressed in separate proposal.
- The application of io_uring to network I/O is outside the scope of this proposal.
- The implementation will happen incrementally.
Current Status
-
Add initial infrastructure code (Changes to the driver, add cfg,
Opfuture, etc) -
Implementing actual io_uring operations
-
fs::OpenOptions(fs: add io_uringopenoperation #7321) -
fs::write( fs: support io_uring infs::write#7567) -
File::open()(fs: use FileOptions inside fs::File to support uring #7617)
comprehensive list of tokio::fs APIs
Tier 1: Important APIs that are also used by other APIs, or frequently used
OpenOptions::open()- Internally used by
File::open()andFile::create()
- Internally used by
File::open(),File::create()- Internally used by
fs::read()andfs::write()
- Internally used by
statx(2)(Hard to implementMetadada, see fs: support io_uring in fs::metadata (statx) #7616)- Required for determining buffer size in
fs::read()and for thefs::metadata()API
- Required for determining buffer size in
fs::write()- Frequently used API
- Can be supported once
openis implemented
fs::read()- Frequently used API
- Can be implemented once
openandfstatare supported
Tier 2: APIs that depend on Tier 1 APIs or are considered less frequently used
fs::copy()- Directory-related APIs (Unlike files, all directory operations seem to go through
DirBuilder)DirBuildercreate_dir()create_dir_all()fs::read_dir()
fs::set_permissions()- ... and other APIs
-
-
Further improvements, such as:
- Sharding rings in the multi-threaded runtime
- Smarter batching logic for submission
- Exploring the possibilities of using advanced features, such as registered buffers or registered files
Sagebati, eastspire, vlabel, ranger-ross, AdamGS and 20 more
Metadata
Metadata
Assignees
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateC-feature-requestCategory: A feature request.Category: A feature request.M-fsModule: tokio/fsModule: tokio/fs