Skip to content

Commit a559b8d

Browse files
perf(fuse): FUSE-over-io_uring default on — kill switch AGENTFS_FUSE_URING=0
Codex A/B (n=5): equal-or-better on every phase — total 3.37x -> 2.92x, status 0.93x -> 0.60x, read_search 1.41x -> 1.37x, clone -3%; the synthetic-fixture write-phase regression that kept WS6 opt-in was a toy-workload artifact. Safe as a default because INIT only advertises FUSE_OVER_IO_URING after the ring-setup probe succeeds (requires root sysctl fuse.enable_uring=1); everything else stays on the legacy /dev/fuse channel. Gates green under the new default: noopen/flush coherence, serialization, durability, metadata-mutation, 109 CLI tests. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 4de454a commit a559b8d

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

cli/src/fuse.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -730,23 +730,23 @@ impl Filesystem for AgentFSFuse {
730730
capabilities |= FUSE_NO_OPENDIR_SUPPORT;
731731
}
732732
let _ = config.add_capabilities(capabilities);
733-
// Opt-in fuse-over-io_uring (AGENTFS_FUSE_URING=1): only advertise
734-
// when the kernel offered it and ring setup works, since the kernel
735-
// stalls requests after INIT until the ring queues register. The
736-
// max_write clamp keeps per-entry ring payload buffers at 1 MiB
737-
// (the kernel caps single WRITEs at max_pages = 256 pages anyway,
738-
// so >1 MiB writes never materialize on Linux).
733+
// FUSE-over-io_uring, default on (kill switch AGENTFS_FUSE_URING=0):
734+
// only advertised when the kernel offered it and ring setup works,
735+
// since the kernel stalls requests after INIT until the ring queues
736+
// register; without the root sysctl fuse.enable_uring=1 the probe
737+
// fails and the legacy /dev/fuse channel is used. The max_write
738+
// clamp keeps per-entry ring payload buffers at 1 MiB (the kernel
739+
// caps single WRITEs at max_pages = 256 pages anyway, so >1 MiB
740+
// writes never materialize on Linux).
739741
if crate::fuser::uring::uring_enabled() {
740742
if crate::fuser::uring::probe_ring_setup()
741743
&& config.add_capabilities(FUSE_OVER_IO_URING).is_ok()
742744
{
743745
let _ = config.set_max_write(crate::fuser::uring::URING_MAX_WRITE);
744746
let _ = config.set_max_readahead(crate::fuser::uring::URING_MAX_WRITE);
745-
tracing::info!("advertising FUSE_OVER_IO_URING (AGENTFS_FUSE_URING=1)");
747+
tracing::info!("advertising FUSE_OVER_IO_URING");
746748
} else {
747-
tracing::warn!(
748-
"AGENTFS_FUSE_URING=1 but kernel/ring support missing; using legacy channel"
749-
);
749+
tracing::debug!("fuse-over-io_uring unavailable; using legacy channel");
750750
}
751751
}
752752
if self.noopen {

cli/src/fuser/uring.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
//! reply synchronously, so each ring's submission queue is effectively
2222
//! single-threaded (guarded by a mutex that is never contended in practice).
2323
//!
24-
//! Opt-in via `AGENTFS_FUSE_URING=1`; depth per queue via
25-
//! `AGENTFS_FUSE_URING_DEPTH` (default 4).
24+
//! Default on when the kernel side is available (root sysctl
25+
//! `fuse.enable_uring=1`); kill switch `AGENTFS_FUSE_URING=0`; depth per
26+
//! queue via `AGENTFS_FUSE_URING_DEPTH` (default 4).
2627
2728
#![cfg(target_os = "linux")]
2829

@@ -134,10 +135,16 @@ const PAYLOAD_BUF_SIZE: usize = (URING_MAX_WRITE as usize) + 4096;
134135

135136
// ─── configuration ──────────────────────────────────────────────────────────
136137

138+
/// Default on: codex A/B showed the transport equal-or-better on every
139+
/// phase (total 3.37x -> 2.92x). Safe unconditionally because INIT only
140+
/// advertises FUSE_OVER_IO_URING after a ring-setup probe succeeds, which
141+
/// requires the root sysctl `fuse.enable_uring=1`; everything else falls
142+
/// back to the legacy /dev/fuse channel. `AGENTFS_FUSE_URING=0` is the
143+
/// kill switch.
137144
pub(crate) fn uring_enabled() -> bool {
138-
matches!(
145+
!matches!(
139146
std::env::var("AGENTFS_FUSE_URING").as_deref(),
140-
Ok("1") | Ok("true") | Ok("on")
147+
Ok("0") | Ok("false") | Ok("off")
141148
)
142149
}
143150

0 commit comments

Comments
 (0)