-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Currently, CachyOS uses unnecessary/suboptimal BTRFS mount options space_cache=v2
and compress=zstd
in /etc/fstab.
-
Mount option
space_cache=v2
is not needed for a clean install and has been a default mkfs.btrfs option (free-space-tree
) sincebtrfs-progs 5.15
and supported sincekernel 4.5
. It is redundant and unnecessary to add this mount option. -
Mount option
compress=zstd
defaults to compression level3
, for NVMe drives, this greatly slows down throughput (zstd compression on CPU is slower than NVMe write speed). Compression level1
(compress=zstd:1
) has been the default on Fedora for some time now and is the better choice for modern storage media that uses PCIe vs. legacy interfaces like SATA. (Even for SATA, level3
is questionable for SSDs with weak CPU compression performance, but nowhere near as bad when used with an NVMe drive.) Compression, can, however, improve write performance on slow interfaces (e.g. SATA with a HDD, USB 2.0 and possibly USB 3.0 storage devices) when using higher compression levels (e.g., >= 3). To achieve the best performance, the CPU's compression rate (for a given level) must be faster than the interface's write bandwidth. Otherwise compression stymies write performance as the CPU becomes the bottleneck and can actually slow the whole system down and kill battery life.
Space Cache V2 Notes:
https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html
(default since btrfs-progs 5.15, kernel support since 4.5)
Online conversion can be done by mounting with space_cache=v2, this is sufficient to be done one time.
https://wiki.tnonline.net/w/Btrfs/Space_Cache
With btrfs-progs 5.15 and newer, the Free Space Tree is default. There is no need to specify any special options to take advantage of the new cache.