<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Andy Whitcroft &lt;apw@shadowen.org&gt;

Provide hooks for PPC64 to allow memory models to be informed of installed
memory areas.  This allows SPARSEMEM to instantiate mem_map for the populated
areas.

Signed-off-by: Andy Whitcroft &lt;apw@shadowen.org&gt;
Signed-off-by: Dave Hansen &lt;haveblue@us.ibm.com&gt;
Signed-off-by: Martin Bligh &lt;mbligh@aracnet.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 arch/ppc64/Kconfig   |    4 ++--
 arch/ppc64/mm/numa.c |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff -puN arch/ppc64/Kconfig~ppc64-add-memory-present arch/ppc64/Kconfig
--- 25/arch/ppc64/Kconfig~ppc64-add-memory-present	Fri May  6 15:10:51 2005
+++ 25-akpm/arch/ppc64/Kconfig	Fri May  6 15:10:51 2005
@@ -212,8 +212,8 @@ config ARCH_FLATMEM_ENABLE
 source "mm/Kconfig"
 
 config HAVE_ARCH_EARLY_PFN_TO_NID
-	bool
-	default y
+	def_bool y
+	depends on NEED_MULTIPLE_NODES
 
 # Some NUMA nodes have memory ranges that span
 # other nodes.  Even though a pfn is valid and
diff -puN arch/ppc64/mm/numa.c~ppc64-add-memory-present arch/ppc64/mm/numa.c
--- 25/arch/ppc64/mm/numa.c~ppc64-add-memory-present	Fri May  6 15:10:51 2005
+++ 25-akpm/arch/ppc64/mm/numa.c	Fri May  6 15:10:51 2005
@@ -440,6 +440,8 @@ new_range:
 		for (i = start ; i &lt; (start+size); i += MEMORY_INCREMENT)
 			numa_memory_lookup_table[i &gt;&gt; MEMORY_INCREMENT_SHIFT] =
 				numa_domain;
+		memory_present(numa_domain, start &gt;&gt; PAGE_SHIFT,
+						(start + size) &gt;&gt; PAGE_SHIFT);
 
 		if (--ranges)
 			goto new_range;
@@ -481,6 +483,7 @@ static void __init setup_nonnuma(void)
 
 	for (i = 0 ; i &lt; top_of_ram; i += MEMORY_INCREMENT)
 		numa_memory_lookup_table[i &gt;&gt; MEMORY_INCREMENT_SHIFT] = 0;
+	memory_present(0, 0, init_node_data[0].node_end_pfn);
 }
 
 static void __init dump_numa_topology(void)
_
</pre></body></html>