From d3215019835a3d79dff866ed5749b61157c8980f Mon Sep 17 00:00:00 2001 From: Ben Hillis Date: Fri, 8 May 2026 21:45:09 +0000 Subject: [PATCH] virtiofs: negotiate FUSE_MAX_PAGES for larger I/O requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- vm/devices/support/fs/fuse/src/session.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/vm/devices/support/fs/fuse/src/session.rs b/vm/devices/support/fs/fuse/src/session.rs index 20896f26ed..6857f38750 100644 --- a/vm/devices/support/fs/fuse/src/session.rs +++ b/vm/devices/support/fs/fuse/src/session.rs @@ -24,6 +24,7 @@ const DEFAULT_FLAGS: u32 = FUSE_ASYNC_READ | FUSE_ASYNC_DIO | FUSE_ATOMIC_O_TRUNC | FUSE_BIG_WRITES + | FUSE_MAX_PAGES | FUSE_INIT_EXT; // Default flags2 to negotiate when FUSE_INIT_EXT is supported.