]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
MIPS: Implement __read_mostly
authorDavid Daney <ddaney@caviumnetworks.com>
Thu, 14 Oct 2010 19:36:49 +0000 (12:36 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 18 Jan 2011 18:30:28 +0000 (19:30 +0100)
Just do what everyone else is doing by placing __read_mostly things in
the .data.read_mostly section.

mips_io_port_base can not be read-only (const) and writable
(__read_mostly) at the same time.  One of them has to go, so I chose
to eliminate the __read_mostly.  It will still get stuck in a portion
of memory that is not adjacent to things that are written, and thus
not be on a dirty cache line, for whatever that is worth.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/1702/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/cache.h
arch/mips/kernel/setup.c

index 37f175c42bb5530c9c7c76655cb54e94722597fe..650ac9ba734c9bb254baec52f6d076b9ce53583f 100644 (file)
@@ -17,4 +17,6 @@
 #define SMP_CACHE_SHIFT                L1_CACHE_SHIFT
 #define SMP_CACHE_BYTES                L1_CACHE_BYTES
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 #endif /* _ASM_CACHE_H */
index acd3f2c49c069fa04af112d8c30dc008cf869351..8ad1d5679f1440ebe2393e1d25f1a3ab38c7a017 100644 (file)
@@ -70,7 +70,7 @@ static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
  * mips_io_port_base is the begin of the address space to which x86 style
  * I/O ports are mapped.
  */
-const unsigned long mips_io_port_base __read_mostly = -1;
+const unsigned long mips_io_port_base = -1;
 EXPORT_SYMBOL(mips_io_port_base);
 
 static struct resource code_resource = { .name = "Kernel code", };