aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/smpboot.c
diff options
context:
space:
mode:
authorChristoph Lameter <christoph@lameter.com>2005-07-07 20:56:59 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:46 -0400
commit6c036527a630720063b67d9a65455e8caca2c8fa (patch)
tree316e947f5f4efcda0205e48044ed1d12665eaed1 /arch/i386/kernel/smpboot.c
parent0db925af1db5f3dfe1691c35b39496e2baaff9c9 (diff)
[PATCH] mostly_read data section
Add a new section called ".data.read_mostly" for data items that are read frequently and rarely written to like cpumaps etc. If these maps are placed in the .data section then these frequenly read items may end up in cachelines with data is is frequently updated. In that case all processors in an SMP system must needlessly reload the cachelines again and again containing elements of those frequently used variables. The ability to share these cachelines will allow each cpu in an SMP system to keep local copies of those shared cachelines thereby optimizing performance. Signed-off-by: Alok N Kataria <alokk@calsoftinc.com> Signed-off-by: Shobhit Dayal <shobhit@calsoftinc.com> Signed-off-by: Christoph Lameter <christoph@scalex86.org> Signed-off-by: Shai Fultheim <shai@scalex86.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/smpboot.c')
-rw-r--r--arch/i386/kernel/smpboot.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index d66bf489a2e9..8ac8e9fd5614 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -68,21 +68,21 @@ EXPORT_SYMBOL(smp_num_siblings);
68#endif 68#endif
69 69
70/* Package ID of each logical CPU */ 70/* Package ID of each logical CPU */
71int phys_proc_id[NR_CPUS] = {[0 ... NR_CPUS-1] = BAD_APICID}; 71int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
72EXPORT_SYMBOL(phys_proc_id); 72EXPORT_SYMBOL(phys_proc_id);
73 73
74/* Core ID of each logical CPU */ 74/* Core ID of each logical CPU */
75int cpu_core_id[NR_CPUS] = {[0 ... NR_CPUS-1] = BAD_APICID}; 75int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
76EXPORT_SYMBOL(cpu_core_id); 76EXPORT_SYMBOL(cpu_core_id);
77 77
78cpumask_t cpu_sibling_map[NR_CPUS]; 78cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly;
79EXPORT_SYMBOL(cpu_sibling_map); 79EXPORT_SYMBOL(cpu_sibling_map);
80 80
81cpumask_t cpu_core_map[NR_CPUS]; 81cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
82EXPORT_SYMBOL(cpu_core_map); 82EXPORT_SYMBOL(cpu_core_map);
83 83
84/* bitmap of online cpus */ 84/* bitmap of online cpus */
85cpumask_t cpu_online_map; 85cpumask_t cpu_online_map __read_mostly;
86EXPORT_SYMBOL(cpu_online_map); 86EXPORT_SYMBOL(cpu_online_map);
87 87
88cpumask_t cpu_callin_map; 88cpumask_t cpu_callin_map;
@@ -100,7 +100,7 @@ static int __devinitdata tsc_sync_disabled;
100struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; 100struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned;
101EXPORT_SYMBOL(cpu_data); 101EXPORT_SYMBOL(cpu_data);
102 102
103u8 x86_cpu_to_apicid[NR_CPUS] = 103u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly =
104 { [0 ... NR_CPUS-1] = 0xff }; 104 { [0 ... NR_CPUS-1] = 0xff };
105EXPORT_SYMBOL(x86_cpu_to_apicid); 105EXPORT_SYMBOL(x86_cpu_to_apicid);
106 106
@@ -550,10 +550,10 @@ extern struct {
550#ifdef CONFIG_NUMA 550#ifdef CONFIG_NUMA
551 551
552/* which logical CPUs are on which nodes */ 552/* which logical CPUs are on which nodes */
553cpumask_t node_2_cpu_mask[MAX_NUMNODES] = 553cpumask_t node_2_cpu_mask[MAX_NUMNODES] __read_mostly =
554 { [0 ... MAX_NUMNODES-1] = CPU_MASK_NONE }; 554 { [0 ... MAX_NUMNODES-1] = CPU_MASK_NONE };
555/* which node each logical CPU is on */ 555/* which node each logical CPU is on */
556int cpu_2_node[NR_CPUS] = { [0 ... NR_CPUS-1] = 0 }; 556int cpu_2_node[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = 0 };
557EXPORT_SYMBOL(cpu_2_node); 557EXPORT_SYMBOL(cpu_2_node);
558 558
559/* set up a mapping between cpu and node. */ 559/* set up a mapping between cpu and node. */
@@ -581,7 +581,7 @@ static inline void unmap_cpu_to_node(int cpu)
581 581
582#endif /* CONFIG_NUMA */ 582#endif /* CONFIG_NUMA */
583 583
584u8 cpu_2_logical_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; 584u8 cpu_2_logical_apicid[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
585 585
586static void map_cpu_to_logical_apicid(void) 586static void map_cpu_to_logical_apicid(void)
587{ 587{