diff options
author | Mike Kravetz <kravetz@us.ibm.com> | 2005-11-04 18:20:24 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-07 23:17:22 -0500 |
commit | 82dd26a971848efafc6c8f12803ae012d268d2eb (patch) | |
tree | 74a72d94a726e876dc9db54155d158ed8e4f5b21 /include/asm-ppc64/mmzone.h | |
parent | dd7ccbd3eed52a42dc8bba57717dac3ece39b58e (diff) |
[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 <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc64/mmzone.h')
-rw-r--r-- | include/asm-ppc64/mmzone.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h index 80a708e7093a..15e777ce0f4a 100644 --- a/include/asm-ppc64/mmzone.h +++ b/include/asm-ppc64/mmzone.h | |||
@@ -33,6 +33,9 @@ extern int numa_cpu_lookup_table[]; | |||
33 | extern char *numa_memory_lookup_table; | 33 | extern char *numa_memory_lookup_table; |
34 | extern cpumask_t numa_cpumask_lookup_table[]; | 34 | extern cpumask_t numa_cpumask_lookup_table[]; |
35 | extern int nr_cpus_in_node[]; | 35 | extern int nr_cpus_in_node[]; |
36 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
37 | extern unsigned long max_pfn; | ||
38 | #endif | ||
36 | 39 | ||
37 | /* 16MB regions */ | 40 | /* 16MB regions */ |
38 | #define MEMORY_INCREMENT_SHIFT 24 | 41 | #define MEMORY_INCREMENT_SHIFT 24 |
@@ -45,6 +48,11 @@ static inline int pa_to_nid(unsigned long pa) | |||
45 | { | 48 | { |
46 | int nid; | 49 | int nid; |
47 | 50 | ||
51 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
52 | /* kludge hot added sections default to node 0 */ | ||
53 | if (pa >= (max_pfn << PAGE_SHIFT)) | ||
54 | return 0; | ||
55 | #endif | ||
48 | nid = numa_memory_lookup_table[pa >> MEMORY_INCREMENT_SHIFT]; | 56 | nid = numa_memory_lookup_table[pa >> MEMORY_INCREMENT_SHIFT]; |
49 | 57 | ||
50 | #ifdef DEBUG_NUMA | 58 | #ifdef DEBUG_NUMA |