Re: [PATCH] mm: Move nth_page from folio_page into folio_next
From: Zi Yan
Date: Thu Mar 13 2025 - 21:40:19 EST
On 13 Mar 2025, at 21:18, Herbert Xu wrote:
> On Thu, Mar 13, 2025 at 12:25:50PM +0000, Matthew Wilcox wrote:
>>
>> That isn't true. HugeTLB can construct a folio which crosses a
>> contiguity boundary.
>
> Thanks. So thea means we do need to use nth_page when iterating
> through a folio or a scatterlist generated from a folio.
When you know the folio is hugetlb with gigantic order. Folios
come out of buddy allocator are all within contiguity boundaries.
To be precise, the boundary here means a section boundary.
In addition, nth_page() is a trivial addition for SPARSEMEM_VMEMMAP
or FLATMEM. For SPARSEMEM && !SPARSEMEM_VMEMMAP, it needs to use
pfn for the calculation.
Best Regards,
Yan, Zi