diff options
author | Wei Yang <richardw.yang@linux.intel.com> | 2019-07-19 00:57:21 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-19 02:08:06 +0200 |
commit | 26f26bedab337c9c7e1e55b21949a3e2e0d62840 (patch) | |
tree | 0fbe8c4de354a407c34d375a6abe9101d6e60d4f /mm | |
parent | mm/memory_hotplug: remove "zone" parameter from sparse_remove_one_section (diff) | |
download | linux-26f26bedab337c9c7e1e55b21949a3e2e0d62840.tar.xz linux-26f26bedab337c9c7e1e55b21949a3e2e0d62840.zip |
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.com
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/sparse.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index 1552c855d62a..fe44b2d3bd7e 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -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); + set_section_nid(section_nr, nid); section_mark_present(ms); sparse_init_one_section(ms, section_nr, memmap, usemap); |