瀏覽代碼

ARM: implement support for read-mostly sections

As our SMP implementation uses MESI protocols.  Grouping together data
which is mostly only read together means that we avoid unnecessary
cache line bouncing when this code shares a cache line with other data.

In other words, cache lines associated with read-mostly data are
expected to spend most of their time in shared state.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Russell King 15 年之前
父節點
當前提交
daf8741675
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 2 0
      arch/arm/include/asm/cache.h
  2. 1 0
      arch/arm/kernel/vmlinux.lds.S

+ 2 - 0
arch/arm/include/asm/cache.h

@@ -23,4 +23,6 @@
 #define ARCH_SLAB_MINALIGN 8
 #endif
 
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
+
 #endif

+ 1 - 0
arch/arm/kernel/vmlinux.lds.S

@@ -167,6 +167,7 @@ SECTIONS
 
 		NOSAVE_DATA
 		CACHELINE_ALIGNED_DATA(32)
+		READ_MOSTLY_DATA(32)
 
 		/*
 		 * The exception fixup table (might need resorting at runtime)