Skip to contentSkip to conversation

mm-vmalloc-clarify-why-vmap_range_noflush-might-sleep.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jan 21

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/vmalloc: clarify why vmap_range_noflush() might sleep
has been removed from the -mm tree. Its filename was
mm-vmalloc-clarify-why-vmap_range_noflush-might-sleep.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: Brendan Jackman <[email protected]>
Subject: mm/vmalloc: clarify why vmap_range_noflush() might sleep
Date: Mon, 15 Dec 2025 10:40:25 +0000

The only reason vmap_range_noflush() can sleep is because of pagetable allocations.

The actual allocation mechanism is arch-specific so might_alloc() doesn't work here (what GFP flags would be used?). Hence, just add a comment.

Also note that this might do a TLB shootdown. This is not actually sleeping but it requires IRQs on for x86, and might_sleep() incidentally serves to detect violations of that too.

---

 mm/vmalloc.c |    5 +++++
 1 file changed, 5 insertions(+)
mm/vmalloc.c renamed from mm/vmalloc.c~mm-vmalloc-clarify-why-vmap_range_noflush-might-sleep +5 -0
@@ -305,6 +305,11 @@ static int vmap_range_noflush(unsigned l
 	int err;
 	pgtbl_mod_mask mask = 0;
 
+	/*
+	 * Might allocate pagetables (for most archs a more precise annotation
+	 * would be might_alloc(GFP_PGTABLE_KERNEL)). Also might shootdown TLB
+	 * (requires IRQs enabled on x86).
+	 */
 	might_sleep();
 	BUG_ON(addr >= end);
 

_

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