The patch titled Subject: mm/sparse.c: pass the __highest_present_section_nr + 1 to alloc_func() has been added to the -mm tree. Its filename is mm-sparse-pass-the-__highest_present_section_nr-1-to-alloc_func.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-sparse-pass-the-__highest_present_section_nr-1-to-alloc_func.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-sparse-pass-the-__highest_present_section_nr-1-to-alloc_func.patch 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 and is updated there every 3-4 working days ------------------------------------------------------ From: Wei Yang <richard.weiyang@xxxxxxxxx> Subject: mm/sparse.c: pass the __highest_present_section_nr + 1 to alloc_func() In 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/20180326081956.75275-1-richard.weiyang@xxxxxxxxx Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/sparse.c~mm-sparse-pass-the-__highest_present_section_nr-1-to-alloc_func mm/sparse.c --- a/mm/sparse.c~mm-sparse-pass-the-__highest_present_section_nr-1-to-alloc_func +++ a/mm/sparse.c @@ -522,7 +522,7 @@ static void __init alloc_usemap_and_memm 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); } _ Patches currently in -mm which might be from richard.weiyang@xxxxxxxxx are mm-page_alloc-remove-realsize-in-free_area_init_core.patch mm-sparse-check-__highest_present_section_nr-only-for-a-present-section.patch mm-sparse-pass-the-__highest_present_section_nr-1-to-alloc_func.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html