]> www.infradead.org Git - users/dwmw2/linux.git/commit
fuse: enable dynamic configuration of fuse max pages limit (FUSE_MAX_MAX_PAGES)
authorJoanne Koong <joannelkoong@gmail.com>
Mon, 23 Sep 2024 17:13:11 +0000 (10:13 -0700)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 25 Oct 2024 15:05:49 +0000 (17:05 +0200)
commit2b3933b1e0a0a4b758fbc164bb31db0c113a7e2c
tree476333e1f6bfb488c3e04ec6eebd92875ffd3fb7
parentd34a5575e6d2380cc375d2b4650d385a859e67bc
fuse: enable dynamic configuration of fuse max pages limit (FUSE_MAX_MAX_PAGES)

Introduce the capability to dynamically configure the max pages limit
(FUSE_MAX_MAX_PAGES) through a sysctl. This allows system administrators
to dynamically set the maximum number of pages that can be used for
servicing requests in fuse.

Previously, this is gated by FUSE_MAX_MAX_PAGES which is statically set
to 256 pages. One result of this is that the buffer size for a write
request is limited to 1 MiB on a 4k-page system.

The default value for this sysctl is the original limit (256 pages).

$ sysctl -a | grep max_pages_limit
fs.fuse.max_pages_limit = 256

$ sysctl -n fs.fuse.max_pages_limit
256

$ echo 1024 | sudo tee /proc/sys/fs/fuse/max_pages_limit
1024

$ sysctl -n fs.fuse.max_pages_limit
1024

$ echo 65536 | sudo tee /proc/sys/fs/fuse/max_pages_limit
tee: /proc/sys/fs/fuse/max_pages_limit: Invalid argument

$ echo 0 | sudo tee /proc/sys/fs/fuse/max_pages_limit
tee: /proc/sys/fs/fuse/max_pages_limit: Invalid argument

$ echo 65535 | sudo tee /proc/sys/fs/fuse/max_pages_limit
65535

$ sysctl -n fs.fuse.max_pages_limit
65535

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Documentation/admin-guide/sysctl/fs.rst
fs/fuse/Makefile
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/fuse/ioctl.c
fs/fuse/sysctl.c [new file with mode: 0644]