It looks like Linux 6.17 could end up enabling experimental support for large data folios that could help with bringing some performance improvements under real-world workloads for this copy-on-write file-system.
Qu Wenruo of SUSE has a patch queued in David Sterba’s Btrfs “for-next” branch to enable experimental large data folio support. Qu explains on the patch message:
With all the preparation patches already merged, it’s pretty easy to enable large data folios:
– Remove the ASSERT() on folio size in btrfs_end_repair_bio()
– Add a helper to properly set the max folio order Currently due to several call sites are fetching the bitmap content directly into an unsigned long, we can only support BITS_PER_LONG blocks for each bitmap.
– Call the helper when reading/creating an inode
The support has the following limits:
– No large folios for data reloc inode The relocation code still requires page sized folio. But it’s not that hot nor common compared to regular buffered ios. Will be improved in the future.
– Requires CONFIG_BTRFS_EXPERIMENTAL
– Will require all folio related operations to check if it needs the extra btrfs_subpage structure Now any folio larger than block size will need btrfs_subpage structure handling.
Gating the feature though behind the “CONFIG_BTRFS_EXPERIMENTAL” Kconfig switch means that most users won’t be seeing it for now. The CONFIG_BTRFS_EXPERIMENTAL is used for experimental features not yet reader for the end-user masses.
Another caveat is that Qu hasn’t yet been able to quantify the performance impact. Qu added on the patch message:
“Unfortunately I do not have a physical machine for performance test, but if everything goes like XFS/EXT4, it should mostly bring single digits percentage performance improvement in the real world.
Although I believe there are still quite some optimizations to be done, let’s focus on testing the current large data folio support first.”
The large folio patches for EXT4 had shown some nice performance gains. In any event another performance-related improvement to be on the lookout for out on the horizon with Btrfs.