linux/arch/x86/kernel/apic
Vlad Zolotarov 0816b0f036 x86: Add read_mostly declaration/definition to variables from smp.h
Add "read-mostly" qualifier to the following variables in
smp.h:

 - cpu_sibling_map
 - cpu_core_map
 - cpu_llc_shared_map
 - cpu_llc_id
 - cpu_number
 - x86_cpu_to_apicid
 - x86_bios_cpu_apicid
 - x86_cpu_to_logical_apicid

As long as all the variables above are only written during the
initialization, this change is meant to prevent the false
sharing. More specifically, on vSMP Foundation platform
x86_cpu_to_apicid shared the same internode_cache_line with
frequently written lapic_events.

From the analysis of the first 33 per_cpu variables out of 219
(memories they describe, to be more specific) the 8 have read_mostly
nature (tlb_vector_offset, cpu_loops_per_jiffy, xen_debug_irq, etc.)
and 25 are frequently written (irq_stack_union, gdt_page,
exception_stacks, idt_desc, etc.).

Assuming that the spread of the rest of the per_cpu variables is
similar, identifying the read mostly memories will make more sense
in terms of long-term code maintenance comparing to identifying
frequently written memories.

Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
Acked-by: Shai Fultheim <shai@scalemp.com>
Cc: Shai Fultheim (Shai@ScaleMP.com) <Shai@scalemp.com>
Cc: ido@wizery.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1719258.EYKzE4Zbq5@vlad
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-06-14 12:42:11 +02:00
..
apic_flat_64.c x86/apic: Add apic->eoi_write() callback 2012-05-18 09:46:08 +02:00
apic_noop.c x86/apic: Add apic->eoi_write() callback 2012-05-18 09:46:08 +02:00
apic_numachip.c x86/apic: Add apic->eoi_write() callback 2012-05-18 09:46:08 +02:00
apic.c x86: Add read_mostly declaration/definition to variables from smp.h 2012-06-14 12:42:11 +02:00
bigsmp_32.c x86/apic: Add apic->eoi_write() callback 2012-05-18 09:46:08 +02:00
es7000_32.c x86/apic: Add apic->eoi_write() callback 2012-05-18 09:46:08 +02:00
hw_nmi.c x86, nmi: Wire up NMI handlers to new routines 2011-10-10 06:56:57 +02:00
io_apic.c x86/ioapic: Fix NULL pointer dereference on CPU hotplug after disabling irqs 2012-06-06 12:03:25 +02:00
ipi.c x86: Always use x86_cpu_to_logical_apicid for cpu -> logical apic id 2011-01-28 14:54:05 +01:00
Makefile x86: Add NumaChip support 2011-12-05 17:17:24 +01:00
numaq_32.c x86/apic: Add apic->eoi_write() callback 2012-05-18 09:46:08 +02:00
probe_32.c x86/apic: Add apic->eoi_write() callback 2012-05-18 09:46:08 +02:00
probe_64.c x86, apic: Make apic drivers static 2011-05-22 11:48:04 +02:00
summit_32.c x86/apic: Add apic->eoi_write() callback 2012-05-18 09:46:08 +02:00
x2apic_cluster.c x86/apic: Implement EIO micro-optimization 2012-05-18 09:46:09 +02:00
x2apic_phys.c x86/apic: Implement EIO micro-optimization 2012-05-18 09:46:09 +02:00
x2apic_uv_x.c x86/apic: Implement EIO micro-optimization 2012-05-18 09:46:09 +02:00