]> Git Repo - linux.git/commitdiff
mm/sparse.c: pass the __highest_present_section_nr + 1 to alloc_func()
authorWei Yang <[email protected]>
Fri, 8 Jun 2018 00:06:43 +0000 (17:06 -0700)
committerLinus Torvalds <[email protected]>
Fri, 8 Jun 2018 00:34:35 +0000 (17:34 -0700)
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]>
mm/sparse.c

index 3570ff294ab1cc0a8848e82b41b0c282d4e52a77..f13f2723950ad4c06502c15df16cd8f7acb8e4c3 100644 (file)
@@ -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);
 }
 
This page took 0.057716 seconds and 4 git commands to generate.