提交 26f26bed 编写于 作者: W Wei Yang 提交者: Linus Torvalds

mm/sparse.c: set section nid for hot-add memory

In case of NODE_NOT_IN_PAGE_FLAGS is set, we store section's node id in
section_to_node_table[].  While for hot-add memory, this is missed.
Without this information, page_to_nid() may not give the right node id.

BTW, current online_pages works because it leverages nid in
memory_block.  But the granularity of node id should be mem_section
wide.

Link: http://lkml.kernel.org/r/20190618005537.18878-1-richardw.yang@linux.intel.comSigned-off-by: NWei Yang <richardw.yang@linux.intel.com>
Reviewed-by: NOscar Salvador <osalvador@suse.de>
Reviewed-by: NDavid Hildenbrand <david@redhat.com>
Reviewed-by: NAnshuman Khandual <anshuman.khandual@arm.com>
Acked-by: NMichal Hocko <mhocko@suse.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b9bf8d34
...@@ -731,6 +731,7 @@ int __meminit sparse_add_one_section(int nid, unsigned long start_pfn, ...@@ -731,6 +731,7 @@ int __meminit sparse_add_one_section(int nid, unsigned long start_pfn,
*/ */
page_init_poison(memmap, sizeof(struct page) * PAGES_PER_SECTION); page_init_poison(memmap, sizeof(struct page) * PAGES_PER_SECTION);
set_section_nid(section_nr, nid);
section_mark_present(ms); section_mark_present(ms);
sparse_init_one_section(ms, section_nr, memmap, usemap); sparse_init_one_section(ms, section_nr, memmap, usemap);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册