aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yang <[email protected]>2018-06-07 17:06:43 -0700
committerLinus Torvalds <[email protected]>2018-06-07 17:34:35 -0700
commit08994b24673b6ae33ee40fc3b5e265c6762848e4 (patch)
tree8edd4c0b7acf7664a526358273bdc8dca66915ff
parentd538c164fc018bdb79f07f904fa9d48acf18bb0a (diff)
mm/sparse.c: pass the __highest_present_section_nr + 1 to alloc_func()
In commit c4e1be9ec113 ("mm, sparsemem: break out of loops early") __highest_present_section_nr is introduced to reduce the loop counts for present section. This is also helpful for usemap and memmap allocation. This patch uses __highest_present_section_nr + 1 to optimize the loop. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Wei Yang <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: David Rientjes <[email protected]> Cc: Dave Hansen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/sparse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index 3570ff294ab1..f13f2723950a 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -522,7 +522,7 @@ static void __init alloc_usemap_and_memmap(void (*alloc_func)
map_count = 1;
}
/* ok, last chunk */
- alloc_func(data, pnum_begin, NR_MEM_SECTIONS,
+ alloc_func(data, pnum_begin, __highest_present_section_nr+1,
map_count, nodeid_begin);
}