Skip to contentSkip to conversation

mm-remove-pmd-alignment-constraint-in-execmem_vmalloc.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 28, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: remove PMD alignment constraint in execmem_vmalloc()
has been removed from the -mm tree. Its filename was
mm-remove-pmd-alignment-constraint-in-execmem_vmalloc.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Dev Jain <[email protected]>
Subject: mm: remove PMD alignment constraint in execmem_vmalloc()
Date: Thu, 18 Sep 2025 15:04:53 +0530

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.

---

 mm/execmem.c |    3 ---
 1 file changed, 3 deletions(-)
mm/execmem.c renamed from mm/execmem.c~mm-remove-pmd-alignment-constraint-in-execmem_vmalloc +0 -3
@@ -38,9 +38,6 @@ static void *execmem_vmalloc(struct exec
 	if (kasan)
 		vm_flags |= VM_DEFER_KMEMLEAK;
 
-	if (vm_flags & VM_ALLOW_HUGE_VMAP)
-		align = PMD_SIZE;
-
 	p = __vmalloc_node_range(size, align, start, end, gfp_flags,
 				 pgprot, vm_flags, NUMA_NO_NODE,
 				 __builtin_return_address(0));

_

Patches currently in -mm which might be from [email protected] are