linux/fs/fuse
Baokun Li d1dbc59200 fuse: wake one waiter per freed slot when raising max_background
fuse_get_req() parks background allocations on fch->blocked_waitq via
wait_event_state_exclusive(), so each wakeup releases exactly one
waiter.  fuse_chan_max_background_set() clears fch->blocked when the
new limit exceeds num_background, but the accompanying wake_up()
releases a single waiter regardless of how many slots just became
available.  Raising max_background from 10 to 100 therefore admits one
request instead of ninety.

The remaining waiters are not permanently stranded — the "else if
(!fch->blocked)" branch in fuse_request_end() wakes one more per
completion — but that only helps while requests keep completing.
Consider a fixed pool of threads doing readahead or async direct I/O
with the quota exhausted: every thread is either in flight or parked,
and each completion wakes one waiter while freeing one slot, a net
change of zero.  num_background oscillates around the old limit and
the added quota is never taken up.

Waking one waiter per freed slot also preserves submission order:
once fch->blocked is clear, new callers of fuse_get_req() skip the
waitqueue entirely, overtaking waiters that parked before the limit
was raised.

Use wake_up_nr() with the number of slots that just became available.
Since the wakeup is guarded by !fch->blocked, num_background is
strictly below max_background, so the count is at least 1 and never
degenerates into wake_up_all().

Signed-off-by: Baokun Li <libaokun@linux.alibaba.com>
Reviewed-By: Horst Birthelmer <hbirthelmer@ddn.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
History 2026-08-18 15:20:29 +02:00
..
acl.c fuse: Add SPDX ID lines to some files 2026-06-15 14:06:19 +02:00
args.h fuse: add zero-copy over io-uring 2026-08-17 17:02:37 +02:00
backing.c fuse: use current creds for backing files 2026-06-15 14:06:19 +02:00
control.c fuse: Add SPDX ID lines to some files 2026-06-15 14:06:19 +02:00
cuse.c cuse: wait for pending RCU callbacks on module exit 2026-08-18 10:30:50 +02:00
dax.c fuse: dax: Move long delayed work on system_dfl_long_wq 2026-06-15 14:06:19 +02:00
dev.c fuse: wake one waiter per freed slot when raising max_background 2026-08-18 15:20:29 +02:00
dev.h fuse: decouple fuse_ring creation from ent registration 2026-08-17 17:02:37 +02:00
dev_uring.c fuse: copy request headers via a stack buffer for io-uring 2026-08-18 13:50:31 +02:00
dev_uring_i.h fuse: add zero-copy over io-uring 2026-08-17 17:02:37 +02:00
dir.c fuse: fix invalidate lock leak on setattr writeback failure 2026-08-18 10:26:12 +02:00
file.c fuse: fix invalidate lock leak on open O_TRUNC DAX failure 2026-08-18 10:26:12 +02:00
fuse_dev_i.h fuse: give wakeup hints to the scheduler for synchronous requests 2026-08-18 11:52:56 +02:00
fuse_i.h fuse: move "epoch" from dentry.d_time to fuse_dentry.epoch 2026-07-06 15:44:58 +02:00
fuse_trace.h fuse: add fuse_request_sent tracepoint 2026-06-15 14:06:19 +02:00
inode.c fuse: check for NULL root inode in fuse_fill_super_submount 2026-08-18 11:21:05 +02:00
ioctl.c fuse: replace __get_free_page() with kmalloc() 2026-05-27 15:12:24 +02:00
iomode.c fuse: remove unused 'inode' parameter in fuse_passthrough_open 2025-08-27 14:29:44 +02:00
Kconfig fuse: fix references to fuse.rst -> fuse/fuse.rst 2025-09-02 11:14:15 +02:00
Makefile fuse: create notify.c 2026-06-15 14:06:17 +02:00
notify.c fuse: use iomap helper to mark folio uptodate 2026-07-08 11:12:48 +02:00
passthrough.c lsm: add backing_file LSM hooks 2026-04-03 16:53:50 -04:00
poll.c fuse: create poll.c 2026-06-15 14:06:17 +02:00
readdir.c fuse: move "epoch" from dentry.d_time to fuse_dentry.epoch 2026-07-06 15:44:58 +02:00
req.c fuse: split out filesystem part of request sending 2026-06-15 14:06:17 +02:00
req_timeout.c fuse: use min_not_zero() in fuse_init_server_timeout() 2026-08-18 14:35:23 +02:00
sysctl.c fuse: move request timeout code to a new source file 2026-06-15 14:06:15 +02:00
sysctl.h fuse: move request timeout code to a new source file 2026-06-15 14:06:15 +02:00
trace.c fuse: move CREATE_TRACE_POINTS to a separate file 2025-09-25 16:22:18 +02:00
virtio_fs.c virtio-fs: avoid double-free on failed queue setup 2026-06-15 14:06:20 +02:00
xattr.c fuse: Add SPDX ID lines to some files 2026-06-15 14:06:19 +02:00