A new set of patches posted today to the Linux kernel mailing list begin adapting the Linux software RAID code paths to begin making use of the folio data structure.
Folios have continued to see continued usage throughout the Linux kernel since their merging back in 2021 with Linux 5.16. Folios allow more efficiently managing a groups of contiguous memory pages for better performance while often simplifying the kernel code too.
Huawei engineer Li Nan posted the patches to begin making use of folios for sync I/O within the Linux RAID code. Initially folios are used for sync operations in RAID1 and RAID10 modes. Where up to this point the RAID code relied on 16 x 4K pages for 64K sync I/O, with the proposed patches it’s consolidated into a single 64K folio.
“This patchset adds folio support to sync operations in raid1/10. Previously, we used 16 * 4K pages for 64K sync I/O. With this change, we’ll use a single 64K folio instead.
This is the first step towards full folio support in RAID. Going forward, I will replace the remaining page-based usage with folio.
The patchset was tested with mdadm. Additional fault injection stress tests were run under file systems.”
More details for those interested in this initial folio adoption in the Linux MD RAID code via the LKML patch series.
