arm64: Implement support for read-mostly sections
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.
--- arch/arm64/include/asm/cache.h | 2 ++ 1 file changed, 2 insertions(+)
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__static inline int cache_line_size (void )
Signature · 1 line
1.9.1
Catalin Marinas
maintainerPATCH 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]>Signed-off-by Jungseok Lee <[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
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.
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]>Signed-off-by Jungseok Lee <[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@@ -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
Acked-by Catalin Marinas <[email protected]>
Thanks!
Jungseok Lee