Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] More __read_mostly variables

Move some more frequently read variables that showed up during some of our
performance tests as sometimes ending up in hot cachelines to the
read_mostly section.

Fix: Move the __read_mostly from before hpet_usec_quotient to follow the
variable like the other uses of __read_mostly.

Signed-off-by: Alok N Kataria <alokk@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>

authored by

Christoph Lameter and committed by
Linus Torvalds
c3d8c141 b3dbb4ec

+7 -7
+1 -1
arch/i386/kernel/setup.c
··· 82 82 /* cpu data as detected by the assembly code in head.S */ 83 83 struct cpuinfo_x86 new_cpu_data __initdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 84 84 /* common cpu data for all cpus */ 85 - struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 85 + struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 86 86 EXPORT_SYMBOL(boot_cpu_data); 87 87 88 88 unsigned long mmu_cr4_features;
+1 -1
arch/i386/kernel/timers/timer_hpet.c
··· 18 18 #include "mach_timer.h" 19 19 #include <asm/hpet.h> 20 20 21 - static unsigned long __read_mostly hpet_usec_quotient; /* convert hpet clks to usec */ 21 + static unsigned long hpet_usec_quotient __read_mostly; /* convert hpet clks to usec */ 22 22 static unsigned long tsc_hpet_quotient; /* convert tsc to hpet clks */ 23 23 static unsigned long hpet_last; /* hpet counter value at last tick*/ 24 24 static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */
+1 -1
mm/mmap.c
··· 61 61 62 62 int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ 63 63 int sysctl_overcommit_ratio = 50; /* default is 50% */ 64 - int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT; 64 + int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; 65 65 atomic_t vm_committed_space = ATOMIC_INIT(0); 66 66 67 67 /*
+4 -4
mm/page_alloc.c
··· 42 42 * MCD - HACK: Find somewhere to initialize this EARLY, or make this 43 43 * initializer cleaner 44 44 */ 45 - nodemask_t node_online_map = { { [0] = 1UL } }; 45 + nodemask_t node_online_map __read_mostly = { { [0] = 1UL } }; 46 46 EXPORT_SYMBOL(node_online_map); 47 - nodemask_t node_possible_map = NODE_MASK_ALL; 47 + nodemask_t node_possible_map __read_mostly = NODE_MASK_ALL; 48 48 EXPORT_SYMBOL(node_possible_map); 49 - struct pglist_data *pgdat_list; 49 + struct pglist_data *pgdat_list __read_mostly; 50 50 unsigned long totalram_pages; 51 51 unsigned long totalhigh_pages; 52 52 long nr_swap_pages; ··· 68 68 * Used by page_zone() to look up the address of the struct zone whose 69 69 * id is encoded in the upper bits of page->flags 70 70 */ 71 - struct zone *zone_table[1 << ZONETABLE_SHIFT]; 71 + struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly; 72 72 EXPORT_SYMBOL(zone_table); 73 73 74 74 static char *zone_names[MAX_NR_ZONES] = { "DMA", "Normal", "HighMem" };