On 16.06.19 04:35, Wei Yang wrote: > section_to_node_table[] is used to record section's node id, which is > used in page_to_nid(). While for hot-add memory, this is missed. > > BTW, current online_pages works because it leverages nid in memory_block. > But the granularity of node id should be mem_section wide. set_section_nid() is only relevant if the NID is not part of the vmemmaps. > > Signed-off-by: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx> > --- > mm/sparse.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/sparse.c b/mm/sparse.c > index fd13166949b5..3ba8f843cb7a 100644 > --- a/mm/sparse.c > +++ b/mm/sparse.c > @@ -735,6 +735,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); > > Although I dislike basically all of the current ->nid design, this seems to be the right thing to do Reviewed-by: David Hildenbrand <david@xxxxxxxxxx> -- Thanks, David / dhildenb