[PATCH] mm: drop page_initialized check from get_nid_for_pfn
From: Michal Hocko
Date: Tue Apr 04 2017 - 04:05:06 EST
c04fc586c1a4 ("mm: show node to memory section relationship with
symlinks in sysfs") has added means to export memblock<->node
association into the sysfs. It has also introduced get_nid_for_pfn
which is a rather confusing counterpart of pfn_to_nid which checks also
whether the pfn page is already initialized (page_initialized). This
is done by checking page::lru != NULL which doesn't make any sense at
all. Nothing in this path really relies on the lru list being used or
initialized. Just remove it
Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>
---
drivers/base/node.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 5548f9686016..ee080a35e869 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -368,8 +368,6 @@ int unregister_cpu_under_node(unsigned int cpu, unsigned int nid)
}
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
-#define page_initialized(page) (page->lru.next)
-
static int __ref get_nid_for_pfn(unsigned long pfn)
{
struct page *page;
@@ -380,9 +378,6 @@ static int __ref get_nid_for_pfn(unsigned long pfn)
if (system_state == SYSTEM_BOOTING)
return early_pfn_to_nid(pfn);
#endif
- page = pfn_to_page(pfn);
- if (!page_initialized(page))
- return -1;
return pfn_to_nid(pfn);
}
--
2.11.0
--
Michal Hocko
SUSE Labs