Add fuse-read-spin-us: poll /dev/fuse briefly before blocking

After handling a request, a sync read thread polls its /dev/fuse fd for
up to fuse-read-spin-us microseconds before blocking in read(). Default
0 (disabled). Measured at 50us (tmpfs branch, direct_io): sequential
128K/1M reads +27-32%, 128K writes +14%, metadata walks +24-32%; no
change on 8 parallel streams or 1M writes. Costs roughly one core on a
busy-but-quiet mount, nothing when idle.
This commit is contained in:
Antonio S. Musumeci 2026-10-14 19:55:12 -04:00
parent 54166afe08
commit 76d3990776
7 changed files with 84 additions and 8 deletions

View file

@ -116,6 +116,7 @@ Config::Config()
posix_acl(false),
process_thread_count(fuse_cfg.process_thread_count),
process_thread_queue_depth(fuse_cfg.process_thread_queue_depth),
fuse_read_spin_us(fuse_cfg.read_spin_us),
proxy_ioprio(false),
read_thread_count(fuse_cfg.read_thread_count),
readahead(0),
@ -172,6 +173,7 @@ Config::Config()
posix_acl.ro =
process_thread_count.ro =
process_thread_queue_depth.ro =
fuse_read_spin_us.ro =
read_thread_count.ro =
scheduling_priority.ro =
true;
@ -276,6 +278,7 @@ Config::Config()
_map["posix-acl"] = &posix_acl;
_map["process-thread-count"] = &process_thread_count;
_map["process-thread-queue-depth"] = &process_thread_queue_depth;
_map["fuse-read-spin-us"] = &fuse_read_spin_us;
_map["proxy-ioprio"] = &proxy_ioprio;
_map["read-thread-count"] = &read_thread_count;
_map["readahead"] = &readahead;

View file

@ -153,6 +153,7 @@ public:
ConfigBOOL posix_acl;
TFSRef<int> process_thread_count;
TFSRef<int> process_thread_queue_depth;
TFSRef<u64> fuse_read_spin_us;
ProxyIOPrio proxy_ioprio;
TFSRef<int> read_thread_count;
ConfigU64 readahead;