mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-29 19:37:00 -05:00
Support Linux v6.13 FUSE max_page_limit
This commit is contained in:
parent
d31e97e64c
commit
92ae63e842
12 changed files with 221 additions and 24 deletions
|
|
@ -1,7 +1,8 @@
|
|||
# fuse_msg_size
|
||||
|
||||
* `fuse_msg_size=UINT`
|
||||
* Defaults to `256`
|
||||
* `fuse_msg_size=UINT|SIZE`
|
||||
* Defaults to `1M`
|
||||
* Performance improvements often peak at about `4M`
|
||||
|
||||
FUSE applications communicate with the kernel over a special character
|
||||
device: `/dev/fuse`. A large portion of the overhead associated with
|
||||
|
|
@ -16,14 +17,33 @@ halved.
|
|||
In Linux v4.20 a new feature was added allowing the negotiation of the
|
||||
max message size. Since the size is in multiples of
|
||||
[pages](https://en.wikipedia.org/wiki/Page_(computer_memory)) the
|
||||
feature is called `max_pages`. There is a maximum `max_pages` value of
|
||||
256 (1MiB) and minimum of 1 (4KiB). The default used by Linux >=4.20,
|
||||
and hardcoded value used before 4.20, is 32 (128KiB). In mergerfs it's
|
||||
referred to as fuse_msg_size to make it clear what it impacts and
|
||||
provide some abstraction.
|
||||
feature is called `max_pages`. In versions of Linux prior to v6.13
|
||||
there is a maximum `max_pages` value of 256 (1MiB) and minimum of 1
|
||||
(4KiB). In [Linux
|
||||
v6.13](https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2b3933b1e0a0a4b758fbc164bb31db0c113a7e2c)
|
||||
and above the max value supported by the kernel can range from 1
|
||||
(4KiB) to 65535 (~256MiB) (assuming a page size of 4KiB.) The default
|
||||
used by Linux >= 4.20, and hard coded value used before 4.20, is 32
|
||||
(128KiB). In mergerfs it is referred to as `fuse_msg_size` to make it
|
||||
clear what it impacts and provide some abstraction.
|
||||
|
||||
Since there should be no downsides to increasing `fuse_msg_size`,
|
||||
outside a minor increase in RAM usage due to larger message buffers,
|
||||
mergerfs defaults the value to 256. On kernels before v4.20 the value
|
||||
has no effect. The reason the value is configurable is to enable
|
||||
experimentation and benchmarking.
|
||||
If the `fuse_msg_size` value provided is more than the system wide
|
||||
maximum mergerfs will attempt to increase the system wide value to keep
|
||||
the user from needing to set the value using `sysctl`,
|
||||
`/etc/sysctl.conf`, or `/proc/sys/fs/fuse/max_pages_limit`.
|
||||
|
||||
The main downside to increasing the value is that memory usage will
|
||||
increase approximately relative to the number of [processing
|
||||
threads](threads.md) configured. Keep this in mind for systems with
|
||||
lower amounts of memory like most SBCs. Performance improvements seem
|
||||
to peak around 4MiB.
|
||||
|
||||
On kernels before v4.20 the option has no effect. On kernels between
|
||||
v4.20 and v6.13 the max value is 256. On kernels >= v6.13 the maximum
|
||||
value is 65535.
|
||||
|
||||
Since page size can differ between systems mergerfs can take a value in
|
||||
bytes and will convert it to the proper number of pages (rounded up).
|
||||
|
||||
NOTE: If you intend to enable `cache.files` you should also set
|
||||
[readahead](readahead.md) to match `fuse_msg_size`.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ These options are the same regardless of whether you use them with the
|
|||
- BOOL = 'true' | 'false'
|
||||
- INT = [MIN_INT,MAX_INT]
|
||||
- UINT = [0,MAX_INT]
|
||||
- SIZE = 'NNM'; NN = INT, M = 'K' | 'M' | 'G' | 'T'
|
||||
- SIZE = 'NNM'; NN = INT, M = 'B' | 'K' | 'M' | 'G' | 'T'
|
||||
- PAGESIZE = UINT (representing number of pages) | SIZE (in bytes
|
||||
which will be converted to pages)
|
||||
- STR = string (may refer to an enumerated value, see details of
|
||||
argument)
|
||||
- FUNC = filesystem function
|
||||
|
|
@ -109,9 +111,9 @@ These options are the same regardless of whether you use them with the
|
|||
unavailable the kernel will ensure there is at most one pending read
|
||||
request per file handle and will attempt to order requests by
|
||||
offset. (default: true)
|
||||
- **[fuse_msg_size](fuse_msg_size.md)=UINT**: Set the max number of
|
||||
- **[fuse_msg_size](fuse_msg_size.md)=PAGESIZE**: Set the max number of
|
||||
pages per FUSE message. Only available on Linux >= 4.20 and ignored
|
||||
otherwise. (min: 1; max: 256; default: 256)
|
||||
otherwise. (min: 1; max: 65535; default: "1M")
|
||||
- **[threads](threads.md)=INT**: Number of threads to use. When used
|
||||
alone (`process-thread-count=-1`) it sets the number of threads
|
||||
reading and processing FUSE messages. When used together it sets the
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@ doesn't mean that is the size used by the kernel for read and
|
|||
writes.
|
||||
|
||||
Linux has a max read/write size of 2GB. Since the max FUSE message
|
||||
size is just over 1MB the kernel will break up read and write requests
|
||||
with buffers larger than that 1MB.
|
||||
size is just over 1MiB (by default on more recent kernels) the kernel
|
||||
will break up read and write requests with buffers larger than that
|
||||
1MiB.
|
||||
|
||||
When page caching is disabled (`cache.files=off`), besides the kernel
|
||||
breaking up requests with larger buffers, requests are effectively one
|
||||
|
|
@ -35,4 +36,5 @@ a generic feature but there is no standard way to do so mergerfs added
|
|||
this feature to make it easier to set.
|
||||
|
||||
There is currently no way to set separate values for different
|
||||
branches through mergerfs.
|
||||
branches through mergerfs. In fact at some point the feature may be
|
||||
changed to only set mergerfs' readahead.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue