Skip to contentSkip to conversation

arm64: Implement support for read-mostly sections

PATCH New Jungseok Lee 2 participants 3 messages Dec 1, 2014 – Dec 2, 2014 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Implement support for read-mostly sections

Hi All,

I'm not fully understand why this code is missed in ARM64, so my analysis below might be wrong.

Best Regards
Jungseok Lee

---->8----

As putting data which is read mostly together, we can avoid unnecessary cache line bouncing.

Other architectures, such as ARM and x86, adopted the same idea.

Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
---
 arch/arm64/include/asm/cache.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cache.h +2 -0
index 88cc05b..c1a2a9f 100644
@@ -30,6 +30,8 @@
  */
 #define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
 
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
+
 #ifndef __ASSEMBLY__
 
 static inline int cache_line_size(void)
Signature · 1 line
1.9.1
maintainer
#1 lore raw

PATCH 1/1 arm64: Implement support for read-mostly sections

Quoted 8 lines · Jungseok Lee

As putting data which is read mostly together, we can avoid unnecessary cache line bouncing.

Other architectures, such as ARM and x86, adopted the same idea.

Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>

It looks fine to me, with a nitpick below:

Quoted 9 lines
---
 arch/arm64/include/asm/cache.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cache.h +0 -0
index 88cc05b..c1a2a9f 100644

arch/arm64/include/asm/cache.h line 35

Quoted 6 lines
arch/arm64/include/asm/cache.h +2 -0
@@ -30,6 +30,8 @@
  */
 #define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
 
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
+
 #ifndef __ASSEMBLY__

I think we can move this #define below #ifndef as it doesn't make sense in .S files anyway.

#2 lore raw

PATCH 1/1 arm64: Implement support for read-mostly sections

Quoted 24 lines · Catalin Marinas
Quoted 8 lines · Jungseok Lee

As putting data which is read mostly together, we can avoid unnecessary cache line bouncing.

Other architectures, such as ARM and x86, adopted the same idea.

Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>

It looks fine to me, with a nitpick below:

Quoted 12 lines

---
arch/arm64/include/asm/cache.h | 2 ++

1 file changed, 2 insertions(+)
arch/arm64/include/asm/cache.h +0 -0
index 88cc05b..c1a2a9f 100644
@@ -30,6 +30,8 @@
 */
 #define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
 
Quoted 6 lines

arch/arm64/include/asm/cache.h line 35

Quoted 3 lines
arch/arm64/include/asm/cache.h +2 -0
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
+
 #ifndef __ASSEMBLY__

I think we can move this #define below #ifndef as it doesn't make sense in .S files anyway.

Okay, I will move it below #ifndef.

Quoted 1 line

Thanks!
Jungseok Lee