From: Mike Kravetz Date: Fri, 4 Nov 2005 23:20:24 +0000 (-0800) Subject: [PATCH] Memory Add Fixes for ppc64 X-Git-Tag: upstream/snapshot3+hdmi~44863^2~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82dd26a971848efafc6c8f12803ae012d268d2eb;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [PATCH] Memory Add Fixes for ppc64 This is a temporary kludge that supports adding all new memory to node 0. I will provide a more complete solution similar to that used for dynamically added CPUs in a few days. Signed-off-by: Mike Kravetz Signed-off-by: Paul Mackerras --- diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h index 80a708e..15e777c 100644 --- a/include/asm-ppc64/mmzone.h +++ b/include/asm-ppc64/mmzone.h @@ -33,6 +33,9 @@ extern int numa_cpu_lookup_table[]; extern char *numa_memory_lookup_table; extern cpumask_t numa_cpumask_lookup_table[]; extern int nr_cpus_in_node[]; +#ifdef CONFIG_MEMORY_HOTPLUG +extern unsigned long max_pfn; +#endif /* 16MB regions */ #define MEMORY_INCREMENT_SHIFT 24 @@ -45,6 +48,11 @@ 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