Repository navigation
Add FUSE Passthrough Support in Stargz-Snapshotter #1867 - #1868
Conversation
Signed-off-by: abushwang <abushwangs@gmail.com>
Signed-off-by: abushwang <abushwangs@gmail.com>
ktock
left a comment
There was a problem hiding this comment.
Thanks. Could you fix linter errors? https://github.com/containerd/stargz-snapshotter/actions/runs/11906582478/job/33178914643?pr=1868
| EntryTimeout int64 `toml:"entry_timeout"` | ||
|
|
||
| // PassThrough indicates whether to enable FUSE passthrough mode to improve local file read performance. Default is false. | ||
| PassThrough bool `toml:"passthrough"` |
| b.Reset() | ||
| b.Grow(int(chunkSize)) | ||
| ip := b.Bytes()[:chunkSize] | ||
| if _, err := sf.fr.ReadAt(ip, chunkOffset); err != nil && err != io.EOF { |
There was a problem hiding this comment.
Can we check if the data can be read from the cache?
| type Reader interface { | ||
| io.ReaderAt | ||
| Close() error | ||
| GetReaderAt() io.ReaderAt |
There was a problem hiding this comment.
Can we add a comment like If a blob is backed by a file, it should return *os.File so that it can be used for FUSE passthrough.?
| n.fs.s.report(fmt.Errorf("node.Open: %v", err)) | ||
| return nil, 0, syscall.EIO |
There was a problem hiding this comment.
Can we continue opening this as a non-passthrough file, instead of returning EIO?
| type Reader interface { | ||
| io.ReaderAt | ||
| Close() error | ||
| GetReaderAt() io.ReaderAt |
There was a problem hiding this comment.
When FUSE passthrough is enabled, we should always set directoryCache.direct to true so that we can ensure that *directoryCache.Get always return *os.File (not a buffer).
3fd3113 to
5dba826
Compare
|
all done @ktock |
|
This is my benchmark I create three sets of files with sizes of 50, 75, and 100MB respectively. Subsequently, I used the default value for the --estargz-chunk-size parameter to create an estargz image. To ensure a clean environment for each test, I removed the local image and cache, and then restarted the containerd-stargz-grpc service. This is the report:
env: |
| // isFusePthEnable prevents users from enabling passthrough mode on unsupported kernel versions | ||
| func isFusePthEnable() (bool, error) { | ||
| cmd := exec.Command("sh", "-c", "grep 'CONFIG_FUSE_PASSTHROUGH=y' /boot/config-$(uname -r)") |
There was a problem hiding this comment.
nit: Let's try not to rely on the shell commands for now. Instead of having this check, let's put a document about how to check if passthrough is a supported on the node (maybe in the following PRs)
Signed-off-by: abushwang <abushwangs@gmail.com>
|
Does the kernel version need to be updated to 6.9 to test out passthrough? |
yes,or rebase this feature |
Here’s a proposed implementation plan for FUSE passthrough:
By following this approach, subsequent Read operations would not need to return to user space, and go-fuse would release the registered information when necessary.
for details,
#1867