+ mm-vmalloc-do-not-warn-on-enomem-from-va_alloc.patch added to mm-new branch

Andrew Morton <[email protected]> Mon, 03 Aug 2026 17:52:35 -0700
Newsgroups org.kernel.vger.mm-commits
Message-ID <[email protected]>
The patch titled
     Subject: mm/vmalloc: do not warn on -ENOMEM from va_alloc()
has been added to the -mm mm-new branch.  Its filename is
     mm-vmalloc-do-not-warn-on-enomem-from-va_alloc.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmalloc-do-not-warn-on-enomem-from-va_alloc.patch

This patch will later appear in the mm-new branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews.  Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.

The mm-new branch of mm.git is not included in linux-next

If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: "Uladzislau Rezki (Sony)" <[email protected]>
Subject: mm/vmalloc: do not warn on -ENOMEM from va_alloc()
Date: Sun, 2 Aug 2026 12:46:27 +0200

Since vmalloc() accepts non-blocking GFP flags, allocation requests may
fail when callers pass restrictive GFP masks.

va_clip() may return -ENOMEM when its GFP_NOWAIT fallback allocation fails
during NE_FIT_TYPE splitting.  This is an expected failure, so va_alloc()
should return the error without triggering a kernel splat.

Link: https://lore.kernel.org/[email protected]
Signed-off-by: Uladzislau Rezki (Sony) <[email protected]>
Reported-by: [email protected]
Closes: https://lore.kernel.org/[email protected]
Reviewed-by: Anshuman Khandual <[email protected]>
Reviewed-by: Baoquan He <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

 mm/vmalloc.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

--- a/mm/vmalloc.c~mm-vmalloc-do-not-warn-on-enomem-from-va_alloc
+++ a/mm/vmalloc.c
@@ -1875,8 +1875,10 @@ va_alloc(struct vmap_area *va,
 
 	/* Update the free vmap_area. */
 	ret = va_clip(root, head, va, nva_start_addr, size);
-	if (WARN_ON_ONCE(ret))
+	if (ret) {
+		WARN_ON_ONCE(ret != -ENOMEM);
 		return ret;
+	}
 
 	return nva_start_addr;
 }
@@ -1949,12 +1951,9 @@ preload_this_cpu_lock(spinlock_t *lock,
 
 	/*
 	 * Preload this CPU with one extra vmap_area object. It is used
-	 * when fit type of free area is NE_FIT_TYPE. It guarantees that
-	 * a CPU that does an allocation is preloaded.
-	 *
-	 * We do it in non-atomic context, thus it allows us to use more
-	 * permissive allocation masks to be more stable under low memory
-	 * condition and high memory pressure.
+	 * when fit type of free area is NE_FIT_TYPE. It is best effort
+	 * pre-loading. If it fails va_clip() may return -ENOMEM from its
+	 * GFP_NOWAIT fallback.
 	 */
 	if (!this_cpu_read(ne_fit_preload_node))
 		va = kmem_cache_alloc_node(vmap_area_cachep, gfp_mask, node);
_

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

mm-vmalloc-do-not-warn-on-enomem-from-va_alloc.patch