Linux-mm Archive on
 help / color / Atom feed
* [patch 090/158] mm/vmalloc: add more comments to the adjust_va_to_fit_type()
@ 2019-12-01  1:54 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2019-12-01  1:54 UTC (permalink / raw)
  To: akpm, bigeasy, dwagner, hdanton, linux-mm, mhocko, mm-commits,
	oleksiy.avramchenko, peterz, rostedt, tglx, torvalds, urezki,

From: "Uladzislau Rezki (Sony)" <>
Subject: mm/vmalloc: add more comments to the adjust_va_to_fit_type()

When fit type is NE_FIT_TYPE there is a need in one extra object.  Usually
the "ne_fit_preload_node" per-CPU variable has it and there is no need in
GFP_NOWAIT allocation, but there are exceptions.

This commit just adds more explanations, as a result giving answers on
questions like when it can occur, how often, under which conditions and
what happens if GFP_NOWAIT gets failed.

Signed-off-by: Uladzislau Rezki (Sony) <>
Acked-by: Michal Hocko <>
Cc: Daniel Wagner <>
Cc: Sebastian Andrzej Siewior <>
Cc: Thomas Gleixner <>
Cc: Peter Zijlstra <>
Cc: Uladzislau Rezki <>
Cc: Hillf Danton <>
Cc: Michal Hocko <>
Cc: Matthew Wilcox <>
Cc: Oleksiy Avramchenko <>
Cc: Steven Rostedt <>
Signed-off-by: Andrew Morton <>

 mm/vmalloc.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

--- a/mm/vmalloc.c~mm-vmalloc-add-more-comments-to-the-adjust_va_to_fit_type
+++ a/mm/vmalloc.c
@@ -968,6 +968,19 @@ adjust_va_to_fit_type(struct vmap_area *
 			 * There are a few exceptions though, as an example it is
 			 * a first allocation (early boot up) when we have "one"
 			 * big free space that has to be split.
+			 *
+			 * Also we can hit this path in case of regular "vmap"
+			 * allocations, if "this" current CPU was not preloaded.
+			 * See the comment in alloc_vmap_area() why. If so, then
+			 * GFP_NOWAIT is used instead to get an extra object for
+			 * split purpose. That is rare and most time does not
+			 * occur.
+			 *
+			 * What happens if an allocation gets failed. Basically,
+			 * an "overflow" path is triggered to purge lazily freed
+			 * areas to free some memory, then, the "retry" path is
+			 * triggered to repeat one more time. See more details
+			 * in alloc_vmap_area() function.
 			lva = kmem_cache_alloc(vmap_area_cachep, GFP_NOWAIT);
 			if (!lva)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01  1:54 [patch 090/158] mm/vmalloc: add more comments to the adjust_va_to_fit_type() akpm

Linux-mm Archive on

Archives are clonable:
	git clone --mirror linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ \
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone