virtiofs: negotiate FUSE_MAX_PAGES for larger I/O requests#3447
Open
benhillis wants to merge 1 commit intomicrosoft:mainfrom
Open
virtiofs: negotiate FUSE_MAX_PAGES for larger I/O requests#3447benhillis wants to merge 1 commit intomicrosoft:mainfrom
benhillis wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Add FUSE_MAX_PAGES to DEFAULT_FLAGS so the FUSE server advertises support for larger request sizes during FUSE_INIT negotiation. Without this flag, the Linux kernel uses FUSE_DEFAULT_MAX_PAGES_PER_REQ (32 pages = 128 KiB) as the maximum request size. With the flag, the kernel uses min(fuse_max_pages_limit, virtqueue_size - 4) which is typically 252 pages (~1008 KiB) — an ~8x increase in max request size. This significantly reduces per-request overhead (virtio descriptor setup, FUSE header parsing, context switches) for sequential I/O. Benchmark results (burette virtio-fs, 3 iterations, vs baseline): Sequential read: 144 → 329 MiB/s (+129%) Sequential write: 149 → 284 MiB/s (+91%) Random read IOPS: 2323 → 2390 (within noise) Random write IOPS: 2954 → 3134 (within noise) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the FUSE session’s default init negotiation flags so virtio-fs can negotiate larger per-request I/O sizes with Linux guests by advertising FUSE_MAX_PAGES during FUSE_INIT.
Changes:
- Add
FUSE_MAX_PAGESto theDEFAULT_FLAGSbitmask used for FUSE init negotiation.
Brian-Perkins
approved these changes
May 8, 2026
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.
Add
FUSE_MAX_PAGEStoDEFAULT_FLAGSso the FUSE server advertises support for larger request sizes duringFUSE_INITnegotiation.Background
Without this flag, the Linux kernel uses
FUSE_DEFAULT_MAX_PAGES_PER_REQ(32 pages = 128 KiB) as the maximum request size. With the flag, the kernel usesmin(fuse_max_pages_limit, virtqueue_size - 4)which is typically 252 pages (~1008 KiB) — an ~8x increase in max request size.This significantly reduces per-request overhead (virtio descriptor setup, FUSE header parsing, context switches) for sequential I/O.
Benchmark results
burette virtio-fs, 3 iterations, vs baseline (no
FUSE_MAX_PAGES):Notes
DEFAULT_MAX_PAGES(256) is intentionally left unchanged. The kernel clampsmax_pagestomin(fuse_max_pages_limit=256, virtqueue_size-4), so larger values have no effect. The gain comes entirely from negotiating the flag, which moves the kernel from 32 → 252 pages per request.