Skip to content

Commit 060650a

Browse files
urezkitorvalds
authored andcommitted
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. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Uladzislau Rezki (Sony) <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Daniel Wagner <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Uladzislau Rezki <[email protected]> Cc: Hillf Danton <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Oleksiy Avramchenko <[email protected]> Cc: Steven Rostedt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f07116d commit 060650a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

mm/vmalloc.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,19 @@ adjust_va_to_fit_type(struct vmap_area *va,
968968
* There are a few exceptions though, as an example it is
969969
* a first allocation (early boot up) when we have "one"
970970
* big free space that has to be split.
971+
*
972+
* Also we can hit this path in case of regular "vmap"
973+
* allocations, if "this" current CPU was not preloaded.
974+
* See the comment in alloc_vmap_area() why. If so, then
975+
* GFP_NOWAIT is used instead to get an extra object for
976+
* split purpose. That is rare and most time does not
977+
* occur.
978+
*
979+
* What happens if an allocation gets failed. Basically,
980+
* an "overflow" path is triggered to purge lazily freed
981+
* areas to free some memory, then, the "retry" path is
982+
* triggered to repeat one more time. See more details
983+
* in alloc_vmap_area() function.
971984
*/
972985
lva = kmem_cache_alloc(vmap_area_cachep, GFP_NOWAIT);
973986
if (!lva)

0 commit comments

Comments
 (0)