diff options
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/ia64/kernel/acpi.c | 4 | ||||
-rw-r--r-- | arch/ia64/kernel/numa.c | 57 | ||||
-rw-r--r-- | arch/ia64/kernel/smpboot.c | 41 |
4 files changed, 61 insertions, 42 deletions
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile index b2e2f6509eb0..e1fb68ddec26 100644 --- a/arch/ia64/kernel/Makefile +++ b/arch/ia64/kernel/Makefile | |||
@@ -17,6 +17,7 @@ obj-$(CONFIG_IA64_PALINFO) += palinfo.o | |||
17 | obj-$(CONFIG_IOSAPIC) += iosapic.o | 17 | obj-$(CONFIG_IOSAPIC) += iosapic.o |
18 | obj-$(CONFIG_MODULES) += module.o | 18 | obj-$(CONFIG_MODULES) += module.o |
19 | obj-$(CONFIG_SMP) += smp.o smpboot.o domain.o | 19 | obj-$(CONFIG_SMP) += smp.o smpboot.o domain.o |
20 | obj-$(CONFIG_NUMA) += numa.o | ||
20 | obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o | 21 | obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o |
21 | obj-$(CONFIG_IA64_CYCLONE) += cyclone.o | 22 | obj-$(CONFIG_IA64_CYCLONE) += cyclone.o |
22 | obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o | 23 | obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index cda06f88c66e..542256e98e60 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -640,9 +640,11 @@ acpi_boot_init (void) | |||
640 | if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id()) | 640 | if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id()) |
641 | node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu]; | 641 | node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu]; |
642 | } | 642 | } |
643 | build_cpu_to_node_map(); | ||
644 | # endif | 643 | # endif |
645 | #endif | 644 | #endif |
645 | #ifdef CONFIG_ACPI_NUMA | ||
646 | build_cpu_to_node_map(); | ||
647 | #endif | ||
646 | /* Make boot-up look pretty */ | 648 | /* Make boot-up look pretty */ |
647 | printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); | 649 | printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); |
648 | return 0; | 650 | return 0; |
diff --git a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c new file mode 100644 index 000000000000..a68ce6678092 --- /dev/null +++ b/arch/ia64/kernel/numa.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License as published by | ||
4 | * the Free Software Foundation; either version 2 of the License, or | ||
5 | * (at your option) any later version. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
15 | * | ||
16 | * ia64 kernel NUMA specific stuff | ||
17 | * | ||
18 | * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de> | ||
19 | * Copyright (C) 2004 Silicon Graphics, Inc. | ||
20 | * Jesse Barnes <jbarnes@sgi.com> | ||
21 | */ | ||
22 | #include <linux/config.h> | ||
23 | #include <linux/topology.h> | ||
24 | #include <linux/module.h> | ||
25 | #include <asm/processor.h> | ||
26 | #include <asm/smp.h> | ||
27 | |||
28 | u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned; | ||
29 | EXPORT_SYMBOL(cpu_to_node_map); | ||
30 | |||
31 | cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; | ||
32 | |||
33 | /** | ||
34 | * build_cpu_to_node_map - setup cpu to node and node to cpumask arrays | ||
35 | * | ||
36 | * Build cpu to node mapping and initialize the per node cpu masks using | ||
37 | * info from the node_cpuid array handed to us by ACPI. | ||
38 | */ | ||
39 | void __init build_cpu_to_node_map(void) | ||
40 | { | ||
41 | int cpu, i, node; | ||
42 | |||
43 | for(node=0; node < MAX_NUMNODES; node++) | ||
44 | cpus_clear(node_to_cpu_mask[node]); | ||
45 | |||
46 | for(cpu = 0; cpu < NR_CPUS; ++cpu) { | ||
47 | node = -1; | ||
48 | for (i = 0; i < NR_CPUS; ++i) | ||
49 | if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) { | ||
50 | node = node_cpuid[i].nid; | ||
51 | break; | ||
52 | } | ||
53 | cpu_to_node_map[cpu] = (node >= 0) ? node : 0; | ||
54 | if (node >= 0) | ||
55 | cpu_set(cpu, node_to_cpu_mask[node]); | ||
56 | } | ||
57 | } | ||
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 623b0a546709..7d72c0d872b3 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -525,47 +525,6 @@ smp_build_cpu_map (void) | |||
525 | } | 525 | } |
526 | } | 526 | } |
527 | 527 | ||
528 | #ifdef CONFIG_NUMA | ||
529 | |||
530 | /* on which node is each logical CPU (one cacheline even for 64 CPUs) */ | ||
531 | u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned; | ||
532 | EXPORT_SYMBOL(cpu_to_node_map); | ||
533 | /* which logical CPUs are on which nodes */ | ||
534 | cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; | ||
535 | |||
536 | /* | ||
537 | * Build cpu to node mapping and initialize the per node cpu masks. | ||
538 | */ | ||
539 | void __init | ||
540 | build_cpu_to_node_map (void) | ||
541 | { | ||
542 | int cpu, i, node; | ||
543 | |||
544 | for(node=0; node<MAX_NUMNODES; node++) | ||
545 | cpus_clear(node_to_cpu_mask[node]); | ||
546 | for(cpu = 0; cpu < NR_CPUS; ++cpu) { | ||
547 | /* | ||
548 | * All Itanium NUMA platforms I know use ACPI, so maybe we | ||
549 | * can drop this ifdef completely. [EF] | ||
550 | */ | ||
551 | #ifdef CONFIG_ACPI_NUMA | ||
552 | node = -1; | ||
553 | for (i = 0; i < NR_CPUS; ++i) | ||
554 | if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) { | ||
555 | node = node_cpuid[i].nid; | ||
556 | break; | ||
557 | } | ||
558 | #else | ||
559 | # error Fixme: Dunno how to build CPU-to-node map. | ||
560 | #endif | ||
561 | cpu_to_node_map[cpu] = (node >= 0) ? node : 0; | ||
562 | if (node >= 0) | ||
563 | cpu_set(cpu, node_to_cpu_mask[node]); | ||
564 | } | ||
565 | } | ||
566 | |||
567 | #endif /* CONFIG_NUMA */ | ||
568 | |||
569 | /* | 528 | /* |
570 | * Cycle through the APs sending Wakeup IPIs to boot each. | 529 | * Cycle through the APs sending Wakeup IPIs to boot each. |
571 | */ | 530 | */ |