MIPS: Implement __read_mostly

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>

authored by David Daney and committed by Ralf Baechle 1befdd55 f5b35d0b

+3 -1
+2
arch/mips/include/asm/cache.h
··· 17 17 #define SMP_CACHE_SHIFT L1_CACHE_SHIFT 18 18 #define SMP_CACHE_BYTES L1_CACHE_BYTES 19 19 20 + #define __read_mostly __attribute__((__section__(".data.read_mostly"))) 21 + 20 22 #endif /* _ASM_CACHE_H */
+1 -1
arch/mips/kernel/setup.c
··· 70 70 * mips_io_port_base is the begin of the address space to which x86 style 71 71 * I/O ports are mapped. 72 72 */ 73 - const unsigned long mips_io_port_base __read_mostly = -1; 73 + const unsigned long mips_io_port_base = -1; 74 74 EXPORT_SYMBOL(mips_io_port_base); 75 75 76 76 static struct resource code_resource = { .name = "Kernel code", };