]> git.baikalelectronics.ru Git - kernel.git/commit
mm/sparse.c: pass the __highest_present_section_nr + 1 to alloc_func()
authorWei Yang <richard.weiyang@gmail.com>
Fri, 8 Jun 2018 00:06:43 +0000 (17:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Jun 2018 00:34:35 +0000 (17:34 -0700)
commit4cbb6ba7bf7c533351c2e53666d939bae1583c51
tree8edd4c0b7acf7664a526358273bdc8dca66915ff
parent952196e937dfec2783de6637d114f64e9354df27
mm/sparse.c: pass the __highest_present_section_nr + 1 to alloc_func()

In commit c429baf4a083 ("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@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/sparse.c