All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mm/sparse: set section nid for hot-add memory
@ 2019-06-18  0:55 Wei Yang
  2019-06-18  7:49 ` Oscar Salvador
  2019-06-19  6:23 ` Michal Hocko
  0 siblings, 2 replies; 17+ messages in thread
From: Wei Yang @ 2019-06-18  0:55 UTC (permalink / raw)
  To: linux-mm; +Cc: akpm, osalvador, david, anshuman.khandual, Wei Yang

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.

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>

---
v2:
  * specify the case NODE_NOT_IN_PAGE_FLAGS is effected.
  * list one of the victim page_to_nid()

---
 mm/sparse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/sparse.c b/mm/sparse.c
index 4012d7f50010..48fa16038cf5 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -733,6 +733,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);
 
-- 
2.19.1


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

end of thread, other threads:[~2019-06-19  9:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18  0:55 [PATCH v2] mm/sparse: set section nid for hot-add memory Wei Yang
2019-06-18  7:49 ` Oscar Salvador
2019-06-18  8:32   ` Wei Yang
2019-06-18  8:40     ` David Hildenbrand
2019-06-19  6:10       ` Michal Hocko
2019-06-19  8:54         ` David Hildenbrand
2019-06-19  9:01           ` Michal Hocko
2019-06-19  9:03             ` David Hildenbrand
2019-06-19  9:08               ` Michal Hocko
2019-06-19  9:11                 ` David Hildenbrand
2019-06-19  6:23 ` Michal Hocko
2019-06-19  7:53   ` Oscar Salvador
2019-06-19  8:51     ` David Hildenbrand
2019-06-19  9:04       ` Michal Hocko
2019-06-19  9:07         ` David Hildenbrand
2019-06-19  9:16           ` Michal Hocko
2019-06-19  9:30             ` David Hildenbrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.