linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richardw.yang@linux.intel.com>
To: linux-mm@kvack.org
Cc: akpm@linux-foundation.org, osalvador@suse.de, david@redhat.com,
	anshuman.khandual@arm.com,
	Wei Yang <richardw.yang@linux.intel.com>
Subject: [PATCH v2] mm/sparse: set section nid for hot-add memory
Date: Tue, 18 Jun 2019 08:55:37 +0800	[thread overview]
Message-ID: <20190618005537.18878-1-richardw.yang@linux.intel.com> (raw)

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


             reply	other threads:[~2019-06-18  0:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18  0:55 Wei Yang [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190618005537.18878-1-richardw.yang@linux.intel.com \
    --to=richardw.yang@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox