Commit 82dd26a9 authored by Mike Kravetz's avatar Mike Kravetz Committed by Paul Mackerras

[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: default avatarMike Kravetz <kravetz@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent dd7ccbd3
...@@ -33,6 +33,9 @@ extern int numa_cpu_lookup_table[]; ...@@ -33,6 +33,9 @@ extern int numa_cpu_lookup_table[];
extern char *numa_memory_lookup_table; extern char *numa_memory_lookup_table;
extern cpumask_t numa_cpumask_lookup_table[]; extern cpumask_t numa_cpumask_lookup_table[];
extern int nr_cpus_in_node[]; extern int nr_cpus_in_node[];
#ifdef CONFIG_MEMORY_HOTPLUG
extern unsigned long max_pfn;
#endif
/* 16MB regions */ /* 16MB regions */
#define MEMORY_INCREMENT_SHIFT 24 #define MEMORY_INCREMENT_SHIFT 24
...@@ -45,6 +48,11 @@ static inline int pa_to_nid(unsigned long pa) ...@@ -45,6 +48,11 @@ static inline int pa_to_nid(unsigned long pa)
{ {
int nid; 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]; nid = numa_memory_lookup_table[pa >> MEMORY_INCREMENT_SHIFT];
#ifdef DEBUG_NUMA #ifdef DEBUG_NUMA
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment