Re: [RFC PATCH 3/8] mm/vmalloc: Extend vmap_small_pages_range_noflush() to support larger page_shift sizes

Barry Song
2026-04-08T21:29:42Z

On Wed, Apr 8, 2026 at 7:08 PM Dev Jain <dev.jain@arm.com> wrote:
>
>
>
> On 08/04/26 8:21 am, Barry Song (Xiaomi) wrote:
> > vmap_small_pages_range_noflush() provides a clean interface by taking
> > struct page **pages and mapping them via direct PTE iteration. This
> > avoids the page table zigzag seen when using
>
> "Zigzag" is ambiguous. Just say "page table rewalk". Also please
> elaborate on why the rewalk is happening currently.

Sure—I’m not a native speaker, but “zigzag” feels like
“repeatedly walking the page tables back and forth” to me.
That’s exactly what I want to express.

>
> > vmap_range_noflush() for page_shift values other than PAGE_SHIFT.
> >
> > Extend it to support larger page_shift values, and add PMD- and
> > contiguous-PTE mappings as well.
>
> So we can drop the "small" here since now it supports larger chunks
> as well.

I’m still struggling with the name, since we already have a
function without “small” here:

int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
pgprot_t prot, struct page **pages, unsigned int page_shift,
gfp_t gfp_mask)

>
> Also at this point the code you add is a no-op since you pass PAGE_SHIFT.
> Let us just squash patch 4 into this. This patch looks weird retaining
> the pagetable-rewalk algorithm when it literally adds functionality
> to avoid that.

Sure. will do.

Thanks
Barry