The patch titled
Additions to .data.read_mostly section
has been added to the -mm tree. Its filename is
additions-to-dataread_mostly-section.patch
Patches currently in -mm which might be from [EMAIL PROTECTED] are
additions-to-dataread_mostly-section.patch
From: Ravikiran G Thirumalai <[EMAIL PROTECTED]>
Mark variables which are usually accessed for reads with __readmostly.
Signed-off-by: Alok N Kataria <[EMAIL PROTECTED]>
Signed-off-by: Shai Fultheim <[EMAIL PROTECTED]>
Signed-off-by: Ravikiran Thirumalai <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
arch/i386/kernel/io_apic.c | 10 +++++-----
arch/i386/kernel/timers/timer_hpet.c | 2 +-
arch/i386/mm/discontig.c | 8 ++++----
arch/i386/mm/init.c | 2 +-
arch/x86_64/kernel/genapic.c | 2 +-
arch/x86_64/kernel/io_apic.c | 10 +++++-----
arch/x86_64/kernel/setup.c | 2 +-
arch/x86_64/kernel/setup64.c | 2 +-
arch/x86_64/kernel/smpboot.c | 10 +++++-----
arch/x86_64/mm/numa.c | 6 +++---
fs/namespace.c | 2 +-
mm/page_alloc.c | 4 ++--
mm/shmem.c | 2 +-
13 files changed, 31 insertions(+), 31 deletions(-)
diff -puN arch/i386/kernel/io_apic.c~additions-to-dataread_mostly-section
arch/i386/kernel/io_apic.c
--- 25/arch/i386/kernel/io_apic.c~additions-to-dataread_mostly-section Mon Aug
29 14:56:23 2005
+++ 25-akpm/arch/i386/kernel/io_apic.c Mon Aug 29 14:56:23 2005
@@ -78,7 +78,7 @@ static struct irq_pin_list {
int apic, pin, next;
} irq_2_pin[PIN_MAP_SIZE];
-int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1};
+int vector_irq[NR_VECTORS] __read_mostly = { [0 ... NR_VECTORS - 1] = -1};
#ifdef CONFIG_PCI_MSI
#define vector_to_irq(vector) \
(platform_legacy_irq(vector) ? vector : vector_irq[vector])
@@ -1119,7 +1119,7 @@ static inline int IO_APIC_irq_trigger(in
}
/* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
-u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 };
+u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 };
int assign_irq_vector(int irq)
{
@@ -1990,7 +1990,7 @@ static void set_ioapic_affinity_vector (
* edge-triggered handler, without risking IRQ storms and other ugly
* races.
*/
-static struct hw_interrupt_type ioapic_edge_type = {
+static struct hw_interrupt_type ioapic_edge_type __read_mostly = {
.typename = "IO-APIC-edge",
.startup = startup_edge_ioapic,
.shutdown = shutdown_edge_ioapic,
@@ -2003,7 +2003,7 @@ static struct hw_interrupt_type ioapic_e
#endif
};
-static struct hw_interrupt_type ioapic_level_type = {
+static struct hw_interrupt_type ioapic_level_type __read_mostly = {
.typename = "IO-APIC-level",
.startup = startup_level_ioapic,
.shutdown = shutdown_level_ioapic,
@@ -2076,7 +2076,7 @@ static void ack_lapic_irq (unsigned int
static void end_lapic_irq (unsigned int i) { /* nothing */ }
-static struct hw_interrupt_type lapic_irq_type = {
+static struct hw_interrupt_type lapic_irq_type __read_mostly = {
.typename = "local-APIC-edge",
.startup = NULL, /* startup_irq() not used for IRQ0 */
.shutdown = NULL, /* shutdown_irq() not used for IRQ0 */
diff -puN
arch/i386/kernel/timers/timer_hpet.c~additions-to-dataread_mostly-section
arch/i386/kernel/timers/timer_hpet.c
---
25/arch/i386/kernel/timers/timer_hpet.c~additions-to-dataread_mostly-section
Mon Aug 29 14:56:23 2005
+++ 25-akpm/arch/i386/kernel/timers/timer_hpet.c Mon Aug 29 14:56:23 2005
@@ -19,7 +19,7 @@
#include <asm/hpet.h>
static unsigned long hpet_usec_quotient __read_mostly; /* convert hpet clks to
usec */
-static unsigned long tsc_hpet_quotient; /* convert tsc to hpet
clks */
+static unsigned long tsc_hpet_quotient __read_mostly; /* convert tsc to hpet
clks */
static unsigned long hpet_last; /* hpet counter value at last tick*/
static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */
static unsigned long last_tsc_high; /* msb 32 bits of Time Stamp Counter */
diff -puN arch/i386/mm/discontig.c~additions-to-dataread_mostly-section
arch/i386/mm/discontig.c
--- 25/arch/i386/mm/discontig.c~additions-to-dataread_mostly-section Mon Aug
29 14:56:23 2005
+++ 25-akpm/arch/i386/mm/discontig.c Mon Aug 29 14:56:23 2005
@@ -37,7 +37,7 @@
#include <asm/mmzone.h>
#include <bios_ebda.h>
-struct pglist_data *node_data[MAX_NUMNODES];
+struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
EXPORT_SYMBOL(node_data);
bootmem_data_t node0_bdata;
@@ -49,8 +49,8 @@ bootmem_data_t node0_bdata;
* 2) node_start_pfn - the starting page frame number for a node
* 3) node_end_pfn - the ending page fram number for a node
*/
-unsigned long node_start_pfn[MAX_NUMNODES];
-unsigned long node_end_pfn[MAX_NUMNODES];
+unsigned long node_start_pfn[MAX_NUMNODES] __read_mostly;
+unsigned long node_end_pfn[MAX_NUMNODES] __read_mostly;
#ifdef CONFIG_DISCONTIGMEM
@@ -66,7 +66,7 @@ unsigned long node_end_pfn[MAX_NUMNODES]
* physnode_map[4-7] = 1;
* physnode_map[8- ] = -1;
*/
-s8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1};
+s8 physnode_map[MAX_ELEMENTS] __read_mostly = { [0 ... (MAX_ELEMENTS - 1)] =
-1};
EXPORT_SYMBOL(physnode_map);
void memory_present(int nid, unsigned long start, unsigned long end)
diff -puN arch/i386/mm/init.c~additions-to-dataread_mostly-section
arch/i386/mm/init.c
--- 25/arch/i386/mm/init.c~additions-to-dataread_mostly-section Mon Aug 29
14:56:23 2005
+++ 25-akpm/arch/i386/mm/init.c Mon Aug 29 14:56:23 2005
@@ -393,7 +393,7 @@ void zap_low_mappings (void)
}
static int disable_nx __initdata = 0;
-u64 __supported_pte_mask = ~_PAGE_NX;
+u64 __supported_pte_mask __read_mostly = ~_PAGE_NX;
/*
* noexec = on|off
diff -puN arch/x86_64/kernel/genapic.c~additions-to-dataread_mostly-section
arch/x86_64/kernel/genapic.c
--- 25/arch/x86_64/kernel/genapic.c~additions-to-dataread_mostly-section
Mon Aug 29 14:56:23 2005
+++ 25-akpm/arch/x86_64/kernel/genapic.c Mon Aug 29 14:56:23 2005
@@ -25,7 +25,7 @@
#endif
/* which logical CPU number maps to which CPU (physical APIC ID) */
-u8 x86_cpu_to_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
+u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID
};
EXPORT_SYMBOL(x86_cpu_to_apicid);
u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
diff -puN arch/x86_64/kernel/io_apic.c~additions-to-dataread_mostly-section
arch/x86_64/kernel/io_apic.c
--- 25/arch/x86_64/kernel/io_apic.c~additions-to-dataread_mostly-section
Mon Aug 29 14:56:23 2005
+++ 25-akpm/arch/x86_64/kernel/io_apic.c Mon Aug 29 14:56:23 2005
@@ -70,7 +70,7 @@ static struct irq_pin_list {
short apic, pin, next;
} irq_2_pin[PIN_MAP_SIZE];
-int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1};
+int vector_irq[NR_VECTORS] __read_mostly = { [0 ... NR_VECTORS - 1] = -1};
#ifdef CONFIG_PCI_MSI
#define vector_to_irq(vector) \
(platform_legacy_irq(vector) ? vector : vector_irq[vector])
@@ -683,7 +683,7 @@ static inline int IO_APIC_irq_trigger(in
}
/* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
-u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 };
+u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 };
int assign_irq_vector(int irq)
{
@@ -1443,7 +1443,7 @@ static void set_ioapic_affinity_vector (
* races.
*/
-static struct hw_interrupt_type ioapic_edge_type = {
+static struct hw_interrupt_type ioapic_edge_type __read_mostly = {
.typename = "IO-APIC-edge",
.startup = startup_edge_ioapic,
.shutdown = shutdown_edge_ioapic,
@@ -1456,7 +1456,7 @@ static struct hw_interrupt_type ioapic_e
#endif
};
-static struct hw_interrupt_type ioapic_level_type = {
+static struct hw_interrupt_type ioapic_level_type __read_mostly = {
.typename = "IO-APIC-level",
.startup = startup_level_ioapic,
.shutdown = shutdown_level_ioapic,
@@ -1529,7 +1529,7 @@ static void ack_lapic_irq (unsigned int
static void end_lapic_irq (unsigned int i) { /* nothing */ }
-static struct hw_interrupt_type lapic_irq_type = {
+static struct hw_interrupt_type lapic_irq_type __read_mostly = {
.typename = "local-APIC-edge",
.startup = NULL, /* startup_irq() not used for IRQ0 */
.shutdown = NULL, /* shutdown_irq() not used for IRQ0 */
diff -puN arch/x86_64/kernel/setup64.c~additions-to-dataread_mostly-section
arch/x86_64/kernel/setup64.c
--- 25/arch/x86_64/kernel/setup64.c~additions-to-dataread_mostly-section
Mon Aug 29 14:56:23 2005
+++ 25-akpm/arch/x86_64/kernel/setup64.c Mon Aug 29 14:56:23 2005
@@ -36,7 +36,7 @@ struct desc_ptr idt_descr = { 256 * 16,
char boot_cpu_stack[IRQSTACKSIZE]
__attribute__((section(".bss.page_aligned")));
-unsigned long __supported_pte_mask = ~0UL;
+unsigned long __supported_pte_mask __read_mostly = ~0UL;
static int do_not_nx __initdata = 0;
/* noexec=on|off
diff -puN arch/x86_64/kernel/setup.c~additions-to-dataread_mostly-section
arch/x86_64/kernel/setup.c
--- 25/arch/x86_64/kernel/setup.c~additions-to-dataread_mostly-section Mon Aug
29 14:56:23 2005
+++ 25-akpm/arch/x86_64/kernel/setup.c Mon Aug 29 14:56:23 2005
@@ -65,7 +65,7 @@
* Machine setup..
*/
-struct cpuinfo_x86 boot_cpu_data;
+struct cpuinfo_x86 boot_cpu_data __read_mostly;
unsigned long mmu_cr4_features;
diff -puN arch/x86_64/kernel/smpboot.c~additions-to-dataread_mostly-section
arch/x86_64/kernel/smpboot.c
--- 25/arch/x86_64/kernel/smpboot.c~additions-to-dataread_mostly-section
Mon Aug 29 14:56:23 2005
+++ 25-akpm/arch/x86_64/kernel/smpboot.c Mon Aug 29 14:56:23 2005
@@ -62,13 +62,13 @@
/* Number of siblings per CPU package */
int smp_num_siblings = 1;
/* Package ID of each logical CPU */
-u8 phys_proc_id[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
-u8 cpu_core_id[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
+u8 phys_proc_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
+u8 cpu_core_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
EXPORT_SYMBOL(phys_proc_id);
EXPORT_SYMBOL(cpu_core_id);
/* Bitmask of currently online CPUs */
-cpumask_t cpu_online_map;
+cpumask_t cpu_online_map __read_mostly;
EXPORT_SYMBOL(cpu_online_map);
@@ -88,8 +88,8 @@ struct cpuinfo_x86 cpu_data[NR_CPUS] __c
/* Set when the idlers are all forked */
int smp_threads_ready;
-cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned;
-cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned;
+cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly;
+cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
EXPORT_SYMBOL(cpu_core_map);
/*
diff -puN arch/x86_64/mm/numa.c~additions-to-dataread_mostly-section
arch/x86_64/mm/numa.c
--- 25/arch/x86_64/mm/numa.c~additions-to-dataread_mostly-section Mon Aug
29 14:56:23 2005
+++ 25-akpm/arch/x86_64/mm/numa.c Mon Aug 29 14:56:23 2005
@@ -22,14 +22,14 @@
#define Dprintk(x...)
#endif
-struct pglist_data *node_data[MAX_NUMNODES];
+struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
bootmem_data_t plat_node_bdata[MAX_NUMNODES];
int memnode_shift;
u8 memnodemap[NODEMAPSIZE];
-unsigned char cpu_to_node[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE };
-cpumask_t node_to_cpumask[MAX_NUMNODES];
+unsigned char cpu_to_node[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] =
NUMA_NO_NODE };
+cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly;
int numa_off __initdata;
diff -puN fs/namespace.c~additions-to-dataread_mostly-section fs/namespace.c
--- 25/fs/namespace.c~additions-to-dataread_mostly-section Mon Aug 29
14:56:23 2005
+++ 25-akpm/fs/namespace.c Mon Aug 29 14:56:23 2005
@@ -40,7 +40,7 @@ static inline int sysfs_init(void)
__cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock);
static struct list_head *mount_hashtable;
-static int hash_mask, hash_bits;
+static int hash_mask __read_mostly, hash_bits __read_mostly;
static kmem_cache_t *mnt_cache;
static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry)
diff -puN mm/page_alloc.c~additions-to-dataread_mostly-section mm/page_alloc.c
--- 25/mm/page_alloc.c~additions-to-dataread_mostly-section Mon Aug 29
14:56:23 2005
+++ 25-akpm/mm/page_alloc.c Mon Aug 29 14:56:23 2005
@@ -47,8 +47,8 @@ EXPORT_SYMBOL(node_online_map);
nodemask_t node_possible_map __read_mostly = NODE_MASK_ALL;
EXPORT_SYMBOL(node_possible_map);
struct pglist_data *pgdat_list __read_mostly;
-unsigned long totalram_pages;
-unsigned long totalhigh_pages;
+unsigned long totalram_pages __read_mostly;
+unsigned long totalhigh_pages __read_mostly;
long nr_swap_pages;
/*
diff -puN mm/shmem.c~additions-to-dataread_mostly-section mm/shmem.c
--- 25/mm/shmem.c~additions-to-dataread_mostly-section Mon Aug 29 14:56:23 2005
+++ 25-akpm/mm/shmem.c Mon Aug 29 14:56:23 2005
@@ -182,7 +182,7 @@ static struct inode_operations shmem_dir
static struct inode_operations shmem_special_inode_operations;
static struct vm_operations_struct shmem_vm_ops;
-static struct backing_dev_info shmem_backing_dev_info = {
+static struct backing_dev_info shmem_backing_dev_info __read_mostly = {
.ra_pages = 0, /* No readahead */
.capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
.unplug_io_fn = default_unplug_io_fn,
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html