Re: [PATCH v6 0/6] mm/vmalloc: Speed up ioremap, vmalloc and vmap with contiguous memory
From: Wen Jiang
Date: Tue Jul 14 2026 - 23:34:51 EST
On Tue, 14 Jul 2026 at 19:17, Dev Jain <dev.jain@xxxxxxx> wrote:
>
>
>
> On 14/07/26 2:06 pm, Anshuman Khandual wrote:
> >
> >
> > On 10/07/26 2:24 PM, Wen Jiang wrote:
> >> On Fri, 10 Jul 2026 at 07:08, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> >>>
> >>> On Thu, 9 Jul 2026 15:38:17 +0800 Wen Jiang <jiangwenxiaomi@xxxxxxxxx> wrote:
> >>>
> >>>> This patchset accelerates ioremap, vmalloc, and vmap when the memory
> >>>> is physically fully or partially contiguous.
> >>>
> >>> Thanks, I added this to mm.git's mm-new branch for wider testing.
> >>>
> >>> AI review asked some questions, and some of them are new since the v5
> >>> series:
> >>> https://sashiko.dev/#/patchset/20260709073823.6643-1-jiangwen6@xxxxxxxxxx
> >>
> >> Hi Andrew,
> >>
> >> I've gone through the Sashiko findings:
> >>
> >> - Patch 1 (find_num_contig): Over-interpretation. No new hugetlbfs hstate
> >> is added. The extra sizes are only used by init_mm kernel mappings via.
> >
> > But not sure if that is a right approach. If these multi CONT_PTE
> > sized mappings need to be supported in vmalloc() but without adding
> > corresponding HugeTLB sizes, probably these required helpers could
> > just be factored outside HugeTLB.
>
> The problem is that the existing vmalloc-huge code reuses the hugetlb helpers
> because it is easier that way.
>
> If you really look at it, num_contig_ptes(), set_huge_pte_at() and arch_make_huge_pte()
> do not have anything to do with hugetlbfs, but with huge mappings. It is unfortunate
> that these helpers are sitting in hugetlbpage.c . Really these functions should be
> pulled out of CONFIG_HUGETLBFS and put into some common header - but I can't think
> of a clean solution to this.
>
> So I think for this series, the least we can do is add a comment to clarify that these
> helpers can be used by non-hugetlbfs mm code to set multiple huge mappings at the PTE level.
>
Hi Dev,
I tried to add a comment, but it feels awkward to place it cleanly around
these helpers. Since the change is mainly about vmalloc reusing the existing
huge-mapping helpers, I left the code as-is for now. Do you have a suggestion
for a better place to add a short comment?
Thanks,
Wen
>
> >>
> >> - Patch 5/6 (NULL page): Invalid input. vmap() expects a fully populated
> >> array of valid struct page pointers.
> >>
> >> - Patch 6 (32-bit count << PAGE_SHIFT overflow): Pre-existing. This was
> >> already discussed in the V3 thread, and a separate fix was proposed
> >> there.
> >>
> >> Thanks,
> >> Wen
> >
>