perf(virtiofs): reuse create handles for atomic open#2120
Merged
fslongjin merged 1 commit intoJul 14, 2026
Conversation
FUSE_CREATE already returns an opened file handle, but the VFS create path discarded it with FUSE_RELEASE and constructed the file through a second FUSE_OPEN. This added two protocol requests for every created file and amplified metadata-heavy container workloads. Add an optional VFS create-and-open operation backed by an RAII preopened-file guard. Carry the returned FUSE handle through MountFS wrapping and File construction, skip the redundant open request, and close the handle on every intermediate failure path. Cache FUSE_CREATE ENOSYS at the connection level and preserve the Linux-compatible MKNOD plus OPEN fallback. Forward Linux-compatible create flags while keeping close, cache-state, writeback, and file-mode initialization consistent with normal FUSE opens. Extend FuseExtended coverage for handle reuse, CREATE flag filtering, ENOSYS fallback caching, and RELEASE/FORGET cleanup of invalid replies. Signed-off-by: longjin <longjin@dragonos.org>
Member
Author
|
@codex review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FUSE_CREATEinstead of issuingFUSE_RELEASEfollowed byFUSE_OPENFUSE_CREATEENOSYSand preserve the Linux-compatibleMKNOD + OPENfallbackRoot cause
DragonOS discarded the handle returned by
FUSE_CREATEand then opened the new inode again. This added two FUSE requests per created file and amplified metadata-heavy virtiofs workloads.Validation
make kernelmake allFUSE_OPENcount reduced from 64 to 0Fixes #2019