diff options
author | Li Zhong <zhong@linux.vnet.ibm.com> | 2014-08-27 05:34:01 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2014-09-25 09:14:53 -0400 |
commit | 297cf5025b3bda59e15d6ba1f84022ebd409925b (patch) | |
tree | 96ef77c364307dc99f71fbcd050140e6ca16bcee /arch/powerpc | |
parent | bc3c4327c92b9ceb9a6356ec64d1b2ab2dc851f9 (diff) |
powerpc: some changes in numa_setup_cpu()
this patches changes some error handling logics in numa_setup_cpu(),
when cpu node is not found, so:
if the cpu is possible, but not present, -1 is kept in numa_cpu_lookup_table,
so later, if the cpu is added, we could set correct numa information for it.
if the cpu is present, then we set the first online node to
numa_cpu_lookup_table instead of 0 ( in case 0 might not be an online node? )
Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Acked-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/numa.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 3a9061e9f5dd..ec32d463cad9 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -538,7 +538,7 @@ static int of_drconf_to_nid_single(struct of_drconf_cell *drmem, | |||
538 | */ | 538 | */ |
539 | static int numa_setup_cpu(unsigned long lcpu) | 539 | static int numa_setup_cpu(unsigned long lcpu) |
540 | { | 540 | { |
541 | int nid; | 541 | int nid = -1; |
542 | struct device_node *cpu; | 542 | struct device_node *cpu; |
543 | 543 | ||
544 | /* | 544 | /* |
@@ -555,19 +555,21 @@ static int numa_setup_cpu(unsigned long lcpu) | |||
555 | 555 | ||
556 | if (!cpu) { | 556 | if (!cpu) { |
557 | WARN_ON(1); | 557 | WARN_ON(1); |
558 | nid = 0; | 558 | if (cpu_present(lcpu)) |
559 | goto out; | 559 | goto out_present; |
560 | else | ||
561 | goto out; | ||
560 | } | 562 | } |
561 | 563 | ||
562 | nid = of_node_to_nid_single(cpu); | 564 | nid = of_node_to_nid_single(cpu); |
563 | 565 | ||
566 | out_present: | ||
564 | if (nid < 0 || !node_online(nid)) | 567 | if (nid < 0 || !node_online(nid)) |
565 | nid = first_online_node; | 568 | nid = first_online_node; |
566 | out: | ||
567 | map_cpu_to_node(lcpu, nid); | ||
568 | 569 | ||
570 | map_cpu_to_node(lcpu, nid); | ||
569 | of_node_put(cpu); | 571 | of_node_put(cpu); |
570 | 572 | out: | |
571 | return nid; | 573 | return nid; |
572 | } | 574 | } |
573 | 575 | ||