On Wed, Jul 12, 2023 at 02:37:40PM +0800, Qu Wenruo wrote: > One of the biggest problem for metadata folio conversion is, we still > need the current page based solution (or folios with order 0) as a > fallback solution when we can not get a high order folio. Do we? btrfs by default uses a 16k nodesize (order 2 on x86), with a maximum of 64k (order 4). IIRC we should be able to get them pretty reliably. If not the best thning is to just a virtually contigous allocation as fallback, i.e. use vm_map_ram. That's what XFS uses in it's buffer cache, and it already did so before it stopped to use page cache to back it's buffer cache, something I plan to do for the btrfs buffer cache as well, as the page cache algorithms tend to not work very well for buffer based metadata, never mind that there is an incredible amount of complex code just working around the interactions.