summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/base/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/base/node.c')
-rw-r--r--kernel/drivers/base/node.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/drivers/base/node.c b/kernel/drivers/base/node.c
index a2aa65b42..b10479c87 100644
--- a/kernel/drivers/base/node.c
+++ b/kernel/drivers/base/node.c
@@ -388,6 +388,16 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
int page_nid;
+ /*
+ * memory block could have several absent sections from start.
+ * skip pfn range from absent section
+ */
+ if (!pfn_present(pfn)) {
+ pfn = round_down(pfn + PAGES_PER_SECTION,
+ PAGES_PER_SECTION) - 1;
+ continue;
+ }
+
page_nid = get_nid_for_pfn(pfn);
if (page_nid < 0)
continue;