Re: [PATCH] mm: Remove PMD alignment constraint in execmem_vmalloc()
From: Mike Rapoport
Date: Sun Sep 21 2025 - 03:39:51 EST
Hi Ryan,
On Thu, Sep 18, 2025 at 02:06:25PM +0100, Ryan Roberts wrote:
> On 18/09/2025 11:33, Mike Rapoport wrote:
> > On Thu, Sep 18, 2025 at 03:04:53PM +0530, Dev Jain wrote:
> >> When using vmalloc with VM_ALLOW_HUGE_VMAP flag, it will set the alignment
> >> to PMD_SIZE internally, if it deems huge mappings to be eligible.
> >> Therefore, setting the alignment in execmem_vmalloc is redundant. Apart
> >> from this, it also reduces the probability of allocation in case vmalloc
> >> fails to allocate hugepages - in the fallback case, vmalloc tries to use
> >> the original alignment and allocate basepages, which unfortunately will
> >> again be PMD_SIZE passed over from execmem_vmalloc, thus constraining
> >> the search for a free space in vmalloc region.
> >>
> >> Therefore, remove this constraint.
> >>
> >> Signed-off-by: Dev Jain <dev.jain@xxxxxxx>
> >
> > Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
>
> Hijacking this thread to ask Mike a related question, which I noticed during
> code review...
Replied on the related thread :)
https://lore.kernel.org/all/aM-rDD-TRqmtr6Nb@xxxxxxxxxx/
--
Sincerely yours,
Mike.