linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mm/sparse: pass the __highest_present_section_nr + 1 to alloc_func()
@ 2018-03-26  8:19 Wei Yang
  2018-03-26  8:19 ` [PATCH 2/2] mm/sparse: check __highest_present_section_nr only for a present section Wei Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Wei Yang @ 2018-03-26  8:19 UTC (permalink / raw)
  To: dave.hansen, akpm, mhocko; +Cc: linux-mm, Wei Yang

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.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/sparse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index 7af5e7a92528..505050346249 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -561,7 +561,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);
 }
 
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-12  3:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-26  8:19 [PATCH 1/2] mm/sparse: pass the __highest_present_section_nr + 1 to alloc_func() Wei Yang
2018-03-26  8:19 ` [PATCH 2/2] mm/sparse: check __highest_present_section_nr only for a present section Wei Yang
2018-03-30  3:20   ` [PATCH] mm: check __highest_present_sectioin_nr directly in memory_dev_init() Wei Yang
2018-03-26 20:56 ` [PATCH 1/2] mm/sparse: pass the __highest_present_section_nr + 1 to alloc_func() David Rientjes
2018-03-26 22:30   ` Wei Yang
2018-03-26 22:47     ` David Rientjes
2018-03-26 22:56       ` Wei Yang
2018-03-26 22:58         ` David Rientjes
2018-03-26 23:15           ` Wei Yang
2018-04-12  3:26 ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).