-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fusedev: support splice to handle FUSE requests. #116
base: master
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we return an error here? Since only Pipe can be splice().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM