fusedev: support splice to handle FUSE requests.#116
fusedev: support splice to handle FUSE requests.#116hhhhsdxxxx wants to merge 2 commits intocloud-hypervisor:masterfrom
Conversation
hhhhsdxxxx
commented
Apr 14, 2023
- Support enable splice_read/splice_write on FuseChannel.
- Add splice interface for ZeroCopyReader and ZeroCopyWriter.
- Add unit-test cases for splice interface.
0131745 to
80a4396
Compare
|
It seems that async-io is not a complete implementation now, so splice only supports sync-io in this PR. |
0d7f82b to
2dc412b
Compare
|
We test on network fs(based on fuse-backend-rs) using fio. (1 job, 128k bs, psync, randread) |
2dc412b to
e664683
Compare
|
We also test on write cases: |
140f5a8 to
6e3c298
Compare
d6a2fd5 to
3264e60
Compare
5166af9 to
81ede27
Compare
7ec265d to
f501838
Compare
2ecbefe to
6b3a95a
Compare
WeiZhang555
left a comment
There was a problem hiding this comment.
Is that possible to add splice() usage to tests/passthrough as example, or as smoke CI?
src/transport/mod.rs
Outdated
| if let ReaderInner::Pipe(p) = &mut self.inner { | ||
| p.splice_to(fd, count) | ||
| } else { | ||
| let mut file = unsafe { std::fs::File::from_raw_fd(f.as_raw_fd()) }; |
There was a problem hiding this comment.
Should we return an error here? Since only Pipe can be splice().
There was a problem hiding this comment.
good idea.
I have already done it.
| /// // after handle init request, we know whether kernel support splice read | ||
| /// if fs.is_support_splice_read() { | ||
| /// ch.enable_splice_read(); | ||
| /// } |
There was a problem hiding this comment.
If splice improves performance obviously, can we enable splice read/write automatically according to MyFs's FsOptions? In this way, we can still disable it by not passing SPLICE_READ/SPLICE_WRITE/SPLICE_MOVE.
Will splice bring problem if set as default?
There was a problem hiding this comment.
splice improve performance of read/write operation.
but have overhead for those meta operations, for example lookup, getattr ...
7aa0491 to
44f56b6
Compare
I'll do it right now. |
8646133 to
48edd73
Compare
|
smoke test of splice is ready now. |
WeiZhang555
left a comment
There was a problem hiding this comment.
Some comments, other parts LGTM
c2e1eb0 to
3687acc
Compare
1. Support enable splice_read/splice_write on FuseChannel. 2. Add splice interface for ZeroCopyReader and ZeroCopyWriter. 3. Add unit-test cases for splice interface. Signed-off-by: Henry Huang <henry.hj@antgroup.com>
add a smoke testcase for splice Signed-off-by: Henry Huang <henry.hj@antgroup.com>
3687acc to
ef49e30
Compare