Commit cf950b7a authored by Nathan Lynch's avatar Nathan Lynch Committed by Paul Mackerras

[PATCH] powerpc numa: Get rid of "numa domain" terminology

Since we effectively treat the domain ids given to us by firmare as
logical node ids, make this explicit (basically s/numa_domain/nid/).

No functional changes, only variable and function names are modified.
Signed-off-by: default avatarNathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 2e5ce39d
...@@ -191,9 +191,9 @@ static int *of_get_associativity(struct device_node *dev) ...@@ -191,9 +191,9 @@ static int *of_get_associativity(struct device_node *dev)
return (unsigned int *)get_property(dev, "ibm,associativity", NULL); return (unsigned int *)get_property(dev, "ibm,associativity", NULL);
} }
static int of_node_numa_domain(struct device_node *device) static int of_node_to_nid(struct device_node *device)
{ {
int numa_domain; int nid;
unsigned int *tmp; unsigned int *tmp;
if (min_common_depth == -1) if (min_common_depth == -1)
...@@ -201,13 +201,13 @@ static int of_node_numa_domain(struct device_node *device) ...@@ -201,13 +201,13 @@ static int of_node_numa_domain(struct device_node *device)
tmp = of_get_associativity(device); tmp = of_get_associativity(device);
if (tmp && (tmp[0] >= min_common_depth)) { if (tmp && (tmp[0] >= min_common_depth)) {
numa_domain = tmp[min_common_depth]; nid = tmp[min_common_depth];
} else { } else {
dbg("WARNING: no NUMA information for %s\n", dbg("WARNING: no NUMA information for %s\n",
device->full_name); device->full_name);
numa_domain = 0; nid = 0;
} }
return numa_domain; return nid;
} }
/* /*
...@@ -286,7 +286,7 @@ static unsigned long __devinit read_n_cells(int n, unsigned int **buf) ...@@ -286,7 +286,7 @@ static unsigned long __devinit read_n_cells(int n, unsigned int **buf)
*/ */
static int __cpuinit numa_setup_cpu(unsigned long lcpu) static int __cpuinit numa_setup_cpu(unsigned long lcpu)
{ {
int numa_domain = 0; int nid = 0;
struct device_node *cpu = find_cpu_node(lcpu); struct device_node *cpu = find_cpu_node(lcpu);
if (!cpu) { if (!cpu) {
...@@ -294,27 +294,27 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu) ...@@ -294,27 +294,27 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
goto out; goto out;
} }
numa_domain = of_node_numa_domain(cpu); nid = of_node_to_nid(cpu);
if (numa_domain >= num_online_nodes()) { if (nid >= num_online_nodes()) {
/* /*
* POWER4 LPAR uses 0xffff as invalid node, * POWER4 LPAR uses 0xffff as invalid node,
* dont warn in this case. * dont warn in this case.
*/ */
if (numa_domain != 0xffff) if (nid != 0xffff)
printk(KERN_ERR "WARNING: cpu %ld " printk(KERN_ERR "WARNING: cpu %ld "
"maps to invalid NUMA node %d\n", "maps to invalid NUMA node %d\n",
lcpu, numa_domain); lcpu, nid);
numa_domain = 0; nid = 0;
} }
out: out:
node_set_online(numa_domain); node_set_online(nid);
map_cpu_to_node(lcpu, numa_domain); map_cpu_to_node(lcpu, nid);
of_node_put(cpu); of_node_put(cpu);
return numa_domain; return nid;
} }
static int cpu_numa_callback(struct notifier_block *nfb, static int cpu_numa_callback(struct notifier_block *nfb,
...@@ -399,17 +399,17 @@ static int __init parse_numa_properties(void) ...@@ -399,17 +399,17 @@ static int __init parse_numa_properties(void)
* with larger node ids. In that case we force the cpu into node 0. * with larger node ids. In that case we force the cpu into node 0.
*/ */
for_each_cpu(i) { for_each_cpu(i) {
int numa_domain; int nid;
cpu = find_cpu_node(i); cpu = find_cpu_node(i);
if (cpu) { if (cpu) {
numa_domain = of_node_numa_domain(cpu); nid = of_node_to_nid(cpu);
of_node_put(cpu); of_node_put(cpu);
if (numa_domain < MAX_NUMNODES && if (nid < MAX_NUMNODES &&
max_domain < numa_domain) max_domain < nid)
max_domain = numa_domain; max_domain = nid;
} }
} }
...@@ -418,7 +418,7 @@ static int __init parse_numa_properties(void) ...@@ -418,7 +418,7 @@ static int __init parse_numa_properties(void)
while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
unsigned long start; unsigned long start;
unsigned long size; unsigned long size;
int numa_domain; int nid;
int ranges; int ranges;
unsigned int *memcell_buf; unsigned int *memcell_buf;
unsigned int len; unsigned int len;
...@@ -439,18 +439,18 @@ static int __init parse_numa_properties(void) ...@@ -439,18 +439,18 @@ static int __init parse_numa_properties(void)
start = read_n_cells(n_mem_addr_cells, &memcell_buf); start = read_n_cells(n_mem_addr_cells, &memcell_buf);
size = read_n_cells(n_mem_size_cells, &memcell_buf); size = read_n_cells(n_mem_size_cells, &memcell_buf);
numa_domain = of_node_numa_domain(memory); nid = of_node_to_nid(memory);
if (numa_domain >= MAX_NUMNODES) { if (nid >= MAX_NUMNODES) {
if (numa_domain != 0xffff) if (nid != 0xffff)
printk(KERN_ERR "WARNING: memory at %lx maps " printk(KERN_ERR "WARNING: memory at %lx maps "
"to invalid NUMA node %d\n", start, "to invalid NUMA node %d\n", start,
numa_domain); nid);
numa_domain = 0; nid = 0;
} }
if (max_domain < numa_domain) if (max_domain < nid)
max_domain = numa_domain; max_domain = nid;
if (!(size = numa_enforce_memory_limit(start, size))) { if (!(size = numa_enforce_memory_limit(start, size))) {
if (--ranges) if (--ranges)
...@@ -459,7 +459,7 @@ static int __init parse_numa_properties(void) ...@@ -459,7 +459,7 @@ static int __init parse_numa_properties(void)
continue; continue;
} }
add_region(numa_domain, start >> PAGE_SHIFT, add_region(nid, start >> PAGE_SHIFT,
size >> PAGE_SHIFT); size >> PAGE_SHIFT);
if (--ranges) if (--ranges)
...@@ -769,10 +769,10 @@ int hot_add_scn_to_nid(unsigned long scn_addr) ...@@ -769,10 +769,10 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
{ {
struct device_node *memory = NULL; struct device_node *memory = NULL;
nodemask_t nodes; nodemask_t nodes;
int numa_domain = 0; int nid = 0;
if (!numa_enabled || (min_common_depth < 0)) if (!numa_enabled || (min_common_depth < 0))
return numa_domain; return nid;
while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
unsigned long start, size; unsigned long start, size;
...@@ -789,15 +789,15 @@ int hot_add_scn_to_nid(unsigned long scn_addr) ...@@ -789,15 +789,15 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
ha_new_range: ha_new_range:
start = read_n_cells(n_mem_addr_cells, &memcell_buf); start = read_n_cells(n_mem_addr_cells, &memcell_buf);
size = read_n_cells(n_mem_size_cells, &memcell_buf); size = read_n_cells(n_mem_size_cells, &memcell_buf);
numa_domain = of_node_numa_domain(memory); nid = of_node_to_nid(memory);
/* Domains not present at boot default to 0 */ /* Domains not present at boot default to 0 */
if (!node_online(numa_domain)) if (!node_online(nid))
numa_domain = any_online_node(NODE_MASK_ALL); nid = any_online_node(NODE_MASK_ALL);
if ((scn_addr >= start) && (scn_addr < (start + size))) { if ((scn_addr >= start) && (scn_addr < (start + size))) {
of_node_put(memory); of_node_put(memory);
goto got_numa_domain; goto got_nid;
} }
if (--ranges) /* process all ranges in cell */ if (--ranges) /* process all ranges in cell */
...@@ -806,12 +806,12 @@ int hot_add_scn_to_nid(unsigned long scn_addr) ...@@ -806,12 +806,12 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
BUG(); /* section address should be found above */ BUG(); /* section address should be found above */
/* Temporary code to ensure that returned node is not empty */ /* Temporary code to ensure that returned node is not empty */
got_numa_domain: got_nid:
nodes_setall(nodes); nodes_setall(nodes);
while (NODE_DATA(numa_domain)->node_spanned_pages == 0) { while (NODE_DATA(nid)->node_spanned_pages == 0) {
node_clear(numa_domain, nodes); node_clear(nid, nodes);
numa_domain = any_online_node(nodes); nid = any_online_node(nodes);
} }
return numa_domain; return nid;
} }
#endif /* CONFIG_MEMORY_HOTPLUG */ #endif /* CONFIG_MEMORY_HOTPLUG */
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