|
@@ -41,6 +41,15 @@ int page_to_nid(struct page *page)
|
|
return section_to_node_table[page_to_section(page)];
|
|
return section_to_node_table[page_to_section(page)];
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(page_to_nid);
|
|
EXPORT_SYMBOL(page_to_nid);
|
|
|
|
+
|
|
|
|
+static void set_section_nid(unsigned long section_nr, int nid)
|
|
|
|
+{
|
|
|
|
+ section_to_node_table[section_nr] = nid;
|
|
|
|
+}
|
|
|
|
+#else /* !NODE_NOT_IN_PAGE_FLAGS */
|
|
|
|
+static inline void set_section_nid(unsigned long section_nr, int nid)
|
|
|
|
+{
|
|
|
|
+}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef CONFIG_SPARSEMEM_EXTREME
|
|
#ifdef CONFIG_SPARSEMEM_EXTREME
|
|
@@ -68,10 +77,6 @@ static int __meminit sparse_index_init(unsigned long section_nr, int nid)
|
|
struct mem_section *section;
|
|
struct mem_section *section;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
-#ifdef NODE_NOT_IN_PAGE_FLAGS
|
|
|
|
- section_to_node_table[section_nr] = nid;
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
if (mem_section[root])
|
|
if (mem_section[root])
|
|
return -EEXIST;
|
|
return -EEXIST;
|
|
|
|
|
|
@@ -148,6 +153,7 @@ void __init memory_present(int nid, unsigned long start, unsigned long end)
|
|
struct mem_section *ms;
|
|
struct mem_section *ms;
|
|
|
|
|
|
sparse_index_init(section, nid);
|
|
sparse_index_init(section, nid);
|
|
|
|
+ set_section_nid(section, nid);
|
|
|
|
|
|
ms = __nr_to_section(section);
|
|
ms = __nr_to_section(section);
|
|
if (!ms->section_mem_map)
|
|
if (!ms->section_mem_map)
|