Btrfs Huge Folios Support Merged Ahead of Linux 7.2
#Infrastructure

Btrfs Huge Folios Support Merged Ahead of Linux 7.2

Chips Reporter
2 min read

SUSE engineer Qu Wenruo has landed huge folio support for Btrfs, enabling the filesystem to utilize memory pages up to 2MB in size. The patches are now in the Btrfs for-next branch ahead of the Linux 7.2 merge window, promising improved I/O throughput and reduced system overhead.

The Btrfs filesystem is preparing to take advantage of huge folios in Linux 7.2, with SUSE engineer Qu Wenruo's patches now merged into the for-next branch maintained by filesystem lead David Sterba.

Folios represent a fundamental shift in how the Linux kernel manages memory. Rather than working with traditional 4KB pages, folios allow the kernel to operate on larger contiguous memory regions. The distinction between "large folios" and "huge folios" lies in their size: large folios typically refer to 64KB allocations, while huge folios can reach up to 2MB. This matters significantly for filesystem operations because larger folio sizes reduce the overhead of managing individual pages, decrease the number of TLB (Translation Lookaside Buffer) misses, and allow for more efficient bulk data transfers.

Btrfs has had experimental support for large folios across recent kernel cycles, but the huge folio support represents a substantial expansion of these capabilities. By enabling 2MB folio support, Btrfs can now perform I/O operations that touch less metadata, reduce the frequency of page allocation failures, and improve cache efficiency for sequential workloads.

The performance implications are particularly significant for workloads involving large file reads and writes, database operations, and virtualization scenarios where memory efficiency directly impacts throughput. When a filesystem can map a 2MB region of memory for I/O operations instead of breaking it into hundreds of 4KB pages, the reduction in kernel overhead translates to measurable performance gains.

Qu Wenruo, a SUSE engineer who has contributed extensively to Btrfs development, has been driving this effort. His work has now reached the stage where it's ready for the mainline kernel. With the patches merged into the for-next branch, they will be submitted during the Linux 7.2 merge window, likely arriving in kernel 7.2-rc1.

This development reflects a broader trend in Linux kernel evolution toward better memory management through larger allocation units. As hardware capabilities increase and workloads demand more efficient I/O paths, filesystem support for huge folios represents an important optimization vector that Btrfs will now be able to exploit.

Comments

Loading comments...