summary refs log tree commit diff
path: root/include/asm-ppc64
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-11-11 14:22:35 +1100
committerPaul Mackerras <paulus@samba.org>2005-11-11 22:21:11 +1100
commit45fb6cea09443b2066016f895937f9c2647a1507 (patch)
tree8abd2e14c0e096d583e6dc5151d0669db9227359 /include/asm-ppc64
parent3e66c4def14aa64ee6d1d4ef077d789abc30125d (diff)
downloadlinux-45fb6cea09443b2066016f895937f9c2647a1507.tar.gz
[PATCH] ppc64: Convert NUMA to sparsemem (3)
Convert to sparsemem and remove all the discontigmem code in the
process. This has a few advantages:

- The old numa_memory_lookup_table can go away
- All the arch specific discontigmem magic can go away

We also remove the triple pass of memory properties and instead create a
list of per node extents that we iterate through. A final cleanup would
be to change our lmb code to store extents per node, then we can reuse
that information in the numa code.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc64')
-rw-r--r--include/asm-ppc64/mmzone.h63
-rw-r--r--include/asm-ppc64/page.h5
2 files changed, 3 insertions, 65 deletions
diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h
index 7f06afbfbabb..54958d6cae04 100644
--- a/include/asm-ppc64/mmzone.h
+++ b/include/asm-ppc64/mmzone.h
@@ -8,15 +8,14 @@
 #define _ASM_MMZONE_H_
 
 #include <linux/config.h>
-#include <asm/smp.h>
 
-/* generic non-linear memory support:
+/*
+ * generic non-linear memory support:
  *
  * 1) we will not split memory into more chunks than will fit into the
  *    flags field of the struct page
  */
 
-
 #ifdef CONFIG_NEED_MULTIPLE_NODES
 
 extern struct pglist_data *node_data[];
@@ -30,41 +29,11 @@ extern struct pglist_data *node_data[];
  */
 
 extern int numa_cpu_lookup_table[];
-extern char *numa_memory_lookup_table;
 extern cpumask_t numa_cpumask_lookup_table[];
 #ifdef CONFIG_MEMORY_HOTPLUG
 extern unsigned long max_pfn;
 #endif
 
-/* 16MB regions */
-#define MEMORY_INCREMENT_SHIFT 24
-#define MEMORY_INCREMENT (1UL << MEMORY_INCREMENT_SHIFT)
-
-/* NUMA debugging, will not work on a DLPAR machine */
-#undef DEBUG_NUMA
-
-static inline int pa_to_nid(unsigned long pa)
-{
-	int nid;
-
-#ifdef CONFIG_MEMORY_HOTPLUG
-	/* kludge hot added sections default to node 0 */
-	if (pa >= (max_pfn << PAGE_SHIFT))
-		return 0;
-#endif
-	nid = numa_memory_lookup_table[pa >> MEMORY_INCREMENT_SHIFT];
-
-#ifdef DEBUG_NUMA
-	/* the physical address passed in is not in the map for the system */
-	if (nid == -1) {
-		printk("bad address: %lx\n", pa);
-		BUG();
-	}
-#endif
-
-	return nid;
-}
-
 /*
  * Following are macros that each numa implmentation must define.
  */
@@ -72,36 +41,10 @@ static inline int pa_to_nid(unsigned long pa)
 #define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
 #define node_end_pfn(nid)	(NODE_DATA(nid)->node_end_pfn)
 
-#ifdef CONFIG_DISCONTIGMEM
-
-#define node_localnr(pfn, nid)	((pfn) - NODE_DATA(nid)->node_start_pfn)
-
-#define pfn_to_nid(pfn)		pa_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
-
-/* Written this way to avoid evaluating arguments twice */
-#define discontigmem_pfn_to_page(pfn) \
-({ \
-	unsigned long __tmp = pfn; \
-	(NODE_DATA(pfn_to_nid(__tmp))->node_mem_map + \
-	 node_localnr(__tmp, pfn_to_nid(__tmp))); \
-})
-
-#define discontigmem_page_to_pfn(p) \
-({ \
-	struct page *__tmp = p; \
-	(((__tmp) - page_zone(__tmp)->zone_mem_map) + \
-	 page_zone(__tmp)->zone_start_pfn); \
-})
-
-/* XXX fix for discontiguous physical memory */
-#define discontigmem_pfn_valid(pfn)		((pfn) < num_physpages)
-
-#endif /* CONFIG_DISCONTIGMEM */
-
 #endif /* CONFIG_NEED_MULTIPLE_NODES */
 
 #ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
-#define early_pfn_to_nid(pfn)  pa_to_nid(((unsigned long)pfn) << PAGE_SHIFT)
+extern int __init early_pfn_to_nid(unsigned long pfn);
 #endif
 
 #endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h
index e32f1187aa29..3efc3288f7e9 100644
--- a/include/asm-ppc64/page.h
+++ b/include/asm-ppc64/page.h
@@ -279,11 +279,6 @@ extern u64 ppc64_pft_size;		/* Log 2 of page table size */
 
 #define __va(x) ((void *)((unsigned long)(x) + KERNELBASE))
 
-#ifdef CONFIG_DISCONTIGMEM
-#define page_to_pfn(page)	discontigmem_page_to_pfn(page)
-#define pfn_to_page(pfn)	discontigmem_pfn_to_page(pfn)
-#define pfn_valid(pfn)		discontigmem_pfn_valid(pfn)
-#endif
 #ifdef CONFIG_FLATMEM
 #define pfn_to_page(pfn)	(mem_map + (pfn))
 #define page_to_pfn(page)	((unsigned long)((page) - mem_map))