diff options
author | Nathan Lynch <nathanl@austin.ibm.com> | 2006-03-20 19:35:45 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-21 23:03:52 -0500 |
commit | cf950b7af0e51935e559c54262214423e2b6c88a (patch) | |
tree | 125dfacbbc12c4f5cc5d5ad83c13d463208fa045 /arch/powerpc | |
parent | 2e5ce39d6703836b583c43131c365201a76285a5 (diff) |
[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: Nathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/numa.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 1fb11bbe1ace..a5286a68760a 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -191,9 +191,9 @@ static int *of_get_associativity(struct device_node *dev) | |||
191 | return (unsigned int *)get_property(dev, "ibm,associativity", NULL); | 191 | return (unsigned int *)get_property(dev, "ibm,associativity", NULL); |
192 | } | 192 | } |
193 | 193 | ||
194 | static int of_node_numa_domain(struct device_node *device) | 194 | static int of_node_to_nid(struct device_node *device) |
195 | { | 195 | { |
196 | int numa_domain; | 196 | int nid; |
197 | unsigned int *tmp; | 197 | unsigned int *tmp; |
198 | 198 | ||
199 | if (min_common_depth == -1) | 199 | if (min_common_depth == -1) |
@@ -201,13 +201,13 @@ static int of_node_numa_domain(struct device_node *device) | |||
201 | 201 | ||
202 | tmp = of_get_associativity(device); | 202 | tmp = of_get_associativity(device); |
203 | if (tmp && (tmp[0] >= min_common_depth)) { | 203 | if (tmp && (tmp[0] >= min_common_depth)) { |
204 | numa_domain = tmp[min_common_depth]; | 204 | nid = tmp[min_common_depth]; |
205 | } else { | 205 | } else { |
206 | dbg("WARNING: no NUMA information for %s\n", | 206 | dbg("WARNING: no NUMA information for %s\n", |
207 | device->full_name); | 207 | device->full_name); |
208 | numa_domain = 0; | 208 | nid = 0; |
209 | } | 209 | } |
210 | return numa_domain; | 210 | return nid; |
211 | } | 211 | } |
212 | 212 | ||
213 | /* | 213 | /* |
@@ -286,7 +286,7 @@ static unsigned long __devinit read_n_cells(int n, unsigned int **buf) | |||
286 | */ | 286 | */ |
287 | static int __cpuinit numa_setup_cpu(unsigned long lcpu) | 287 | static int __cpuinit numa_setup_cpu(unsigned long lcpu) |
288 | { | 288 | { |
289 | int numa_domain = 0; | 289 | int nid = 0; |
290 | struct device_node *cpu = find_cpu_node(lcpu); | 290 | struct device_node *cpu = find_cpu_node(lcpu); |
291 | 291 | ||
292 | if (!cpu) { | 292 | if (!cpu) { |
@@ -294,27 +294,27 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu) | |||
294 | goto out; | 294 | goto out; |
295 | } | 295 | } |
296 | 296 | ||
297 | numa_domain = of_node_numa_domain(cpu); | 297 | nid = of_node_to_nid(cpu); |
298 | 298 | ||
299 | if (numa_domain >= num_online_nodes()) { | 299 | if (nid >= num_online_nodes()) { |
300 | /* | 300 | /* |
301 | * POWER4 LPAR uses 0xffff as invalid node, | 301 | * POWER4 LPAR uses 0xffff as invalid node, |
302 | * dont warn in this case. | 302 | * dont warn in this case. |
303 | */ | 303 | */ |
304 | if (numa_domain != 0xffff) | 304 | if (nid != 0xffff) |
305 | printk(KERN_ERR "WARNING: cpu %ld " | 305 | printk(KERN_ERR "WARNING: cpu %ld " |
306 | "maps to invalid NUMA node %d\n", | 306 | "maps to invalid NUMA node %d\n", |
307 | lcpu, numa_domain); | 307 | lcpu, nid); |
308 | numa_domain = 0; | 308 | nid = 0; |
309 | } | 309 | } |
310 | out: | 310 | out: |
311 | node_set_online(numa_domain); | 311 | node_set_online(nid); |
312 | 312 | ||
313 | map_cpu_to_node(lcpu, numa_domain); | 313 | map_cpu_to_node(lcpu, nid); |
314 | 314 | ||
315 | of_node_put(cpu); | 315 | of_node_put(cpu); |
316 | 316 | ||
317 | return numa_domain; | 317 | return nid; |
318 | } | 318 | } |
319 | 319 | ||
320 | static int cpu_numa_callback(struct notifier_block *nfb, | 320 | static int cpu_numa_callback(struct notifier_block *nfb, |
@@ -399,17 +399,17 @@ static int __init parse_numa_properties(void) | |||
399 | * with larger node ids. In that case we force the cpu into node 0. | 399 | * with larger node ids. In that case we force the cpu into node 0. |
400 | */ | 400 | */ |
401 | for_each_cpu(i) { | 401 | for_each_cpu(i) { |
402 | int numa_domain; | 402 | int nid; |
403 | 403 | ||
404 | cpu = find_cpu_node(i); | 404 | cpu = find_cpu_node(i); |
405 | 405 | ||
406 | if (cpu) { | 406 | if (cpu) { |
407 | numa_domain = of_node_numa_domain(cpu); | 407 | nid = of_node_to_nid(cpu); |
408 | of_node_put(cpu); | 408 | of_node_put(cpu); |
409 | 409 | ||
410 | if (numa_domain < MAX_NUMNODES && | 410 | if (nid < MAX_NUMNODES && |
411 | max_domain < numa_domain) | 411 | max_domain < nid) |
412 | max_domain = numa_domain; | 412 | max_domain = nid; |
413 | } | 413 | } |
414 | } | 414 | } |
415 | 415 | ||
@@ -418,7 +418,7 @@ static int __init parse_numa_properties(void) | |||
418 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { | 418 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { |
419 | unsigned long start; | 419 | unsigned long start; |
420 | unsigned long size; | 420 | unsigned long size; |
421 | int numa_domain; | 421 | int nid; |
422 | int ranges; | 422 | int ranges; |
423 | unsigned int *memcell_buf; | 423 | unsigned int *memcell_buf; |
424 | unsigned int len; | 424 | unsigned int len; |
@@ -439,18 +439,18 @@ new_range: | |||
439 | start = read_n_cells(n_mem_addr_cells, &memcell_buf); | 439 | start = read_n_cells(n_mem_addr_cells, &memcell_buf); |
440 | size = read_n_cells(n_mem_size_cells, &memcell_buf); | 440 | size = read_n_cells(n_mem_size_cells, &memcell_buf); |
441 | 441 | ||
442 | numa_domain = of_node_numa_domain(memory); | 442 | nid = of_node_to_nid(memory); |
443 | 443 | ||
444 | if (numa_domain >= MAX_NUMNODES) { | 444 | if (nid >= MAX_NUMNODES) { |
445 | if (numa_domain != 0xffff) | 445 | if (nid != 0xffff) |
446 | printk(KERN_ERR "WARNING: memory at %lx maps " | 446 | printk(KERN_ERR "WARNING: memory at %lx maps " |
447 | "to invalid NUMA node %d\n", start, | 447 | "to invalid NUMA node %d\n", start, |
448 | numa_domain); | 448 | nid); |
449 | numa_domain = 0; | 449 | nid = 0; |
450 | } | 450 | } |
451 | 451 | ||
452 | if (max_domain < numa_domain) | 452 | if (max_domain < nid) |
453 | max_domain = numa_domain; | 453 | max_domain = nid; |
454 | 454 | ||
455 | if (!(size = numa_enforce_memory_limit(start, size))) { | 455 | if (!(size = numa_enforce_memory_limit(start, size))) { |
456 | if (--ranges) | 456 | if (--ranges) |
@@ -459,7 +459,7 @@ new_range: | |||
459 | continue; | 459 | continue; |
460 | } | 460 | } |
461 | 461 | ||
462 | add_region(numa_domain, start >> PAGE_SHIFT, | 462 | add_region(nid, start >> PAGE_SHIFT, |
463 | size >> PAGE_SHIFT); | 463 | size >> PAGE_SHIFT); |
464 | 464 | ||
465 | if (--ranges) | 465 | if (--ranges) |
@@ -769,10 +769,10 @@ int hot_add_scn_to_nid(unsigned long scn_addr) | |||
769 | { | 769 | { |
770 | struct device_node *memory = NULL; | 770 | struct device_node *memory = NULL; |
771 | nodemask_t nodes; | 771 | nodemask_t nodes; |
772 | int numa_domain = 0; | 772 | int nid = 0; |
773 | 773 | ||
774 | if (!numa_enabled || (min_common_depth < 0)) | 774 | if (!numa_enabled || (min_common_depth < 0)) |
775 | return numa_domain; | 775 | return nid; |
776 | 776 | ||
777 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { | 777 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { |
778 | unsigned long start, size; | 778 | unsigned long start, size; |
@@ -789,15 +789,15 @@ int hot_add_scn_to_nid(unsigned long scn_addr) | |||
789 | ha_new_range: | 789 | ha_new_range: |
790 | start = read_n_cells(n_mem_addr_cells, &memcell_buf); | 790 | start = read_n_cells(n_mem_addr_cells, &memcell_buf); |
791 | size = read_n_cells(n_mem_size_cells, &memcell_buf); | 791 | size = read_n_cells(n_mem_size_cells, &memcell_buf); |
792 | numa_domain = of_node_numa_domain(memory); | 792 | nid = of_node_to_nid(memory); |
793 | 793 | ||
794 | /* Domains not present at boot default to 0 */ | 794 | /* Domains not present at boot default to 0 */ |
795 | if (!node_online(numa_domain)) | 795 | if (!node_online(nid)) |
796 | numa_domain = any_online_node(NODE_MASK_ALL); | 796 | nid = any_online_node(NODE_MASK_ALL); |
797 | 797 | ||
798 | if ((scn_addr >= start) && (scn_addr < (start + size))) { | 798 | if ((scn_addr >= start) && (scn_addr < (start + size))) { |
799 | of_node_put(memory); | 799 | of_node_put(memory); |
800 | goto got_numa_domain; | 800 | goto got_nid; |
801 | } | 801 | } |
802 | 802 | ||
803 | if (--ranges) /* process all ranges in cell */ | 803 | if (--ranges) /* process all ranges in cell */ |
@@ -806,12 +806,12 @@ ha_new_range: | |||
806 | BUG(); /* section address should be found above */ | 806 | BUG(); /* section address should be found above */ |
807 | 807 | ||
808 | /* Temporary code to ensure that returned node is not empty */ | 808 | /* Temporary code to ensure that returned node is not empty */ |
809 | got_numa_domain: | 809 | got_nid: |
810 | nodes_setall(nodes); | 810 | nodes_setall(nodes); |
811 | while (NODE_DATA(numa_domain)->node_spanned_pages == 0) { | 811 | while (NODE_DATA(nid)->node_spanned_pages == 0) { |
812 | node_clear(numa_domain, nodes); | 812 | node_clear(nid, nodes); |
813 | numa_domain = any_online_node(nodes); | 813 | nid = any_online_node(nodes); |
814 | } | 814 | } |
815 | return numa_domain; | 815 | return nid; |
816 | } | 816 | } |
817 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 817 | #endif /* CONFIG_MEMORY_HOTPLUG */ |