1
0
Fork 0
alistair23-linux/arch
Russell King f81309067f ARM: move heavy barrier support out of line
The existing memory barrier macro causes a significant amount of code
to be inserted inline at every call site.  For example, in
gpio_set_irq_type(), we have this for mb():

c0344c08:       f57ff04e        dsb     st
c0344c0c:       e59f8190        ldr     r8, [pc, #400]  ; c0344da4 <gpio_set_irq_type+0x230>
c0344c10:       e3590004        cmp     r9, #4
c0344c14:       e5983014        ldr     r3, [r8, #20]
c0344c18:       0a000054        beq     c0344d70 <gpio_set_irq_type+0x1fc>
c0344c1c:       e3530000        cmp     r3, #0
c0344c20:       0a000004        beq     c0344c38 <gpio_set_irq_type+0xc4>
c0344c24:       e50b2030        str     r2, [fp, #-48]  ; 0xffffffd0
c0344c28:       e50bc034        str     ip, [fp, #-52]  ; 0xffffffcc
c0344c2c:       e12fff33        blx     r3
c0344c30:       e51bc034        ldr     ip, [fp, #-52]  ; 0xffffffcc
c0344c34:       e51b2030        ldr     r2, [fp, #-48]  ; 0xffffffd0
c0344c38:       e5963004        ldr     r3, [r6, #4]

Moving the outer_cache_sync() call out of line reduces the impact of
the barrier:

c0344968:       f57ff04e        dsb     st
c034496c:       e35a0004        cmp     sl, #4
c0344970:       e50b2030        str     r2, [fp, #-48]  ; 0xffffffd0
c0344974:       0a000044        beq     c0344a8c <gpio_set_irq_type+0x1b8>
c0344978:       ebf363dd        bl      c001d8f4 <arm_heavy_mb>
c034497c:       e5953004        ldr     r3, [r5, #4]

This should reduce the cache footprint of this code.  Overall, this
results in a reduction of around 20K in the kernel size:

    text    data      bss      dec     hex filename
10773970  667392 10369656 21811018 14ccf4a ../build/imx6/vmlinux-old
10754219  667392 10369656 21791267 14c8223 ../build/imx6/vmlinux-new

Another advantage to this approach is that we can finally resolve the
issue of SoCs which have their own memory barrier requirements within
multiplatform kernels (such as OMAP.)  Here, the bus interconnects
need additional handling to ensure that writes become visible in the
correct order (eg, between dma_map() operations, writes to DMA
coherent memory, and MMIO accesses.)

Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-07-25 15:28:05 +01:00
..
alpha TTY/Serial driver patches for 4.2-rc1 2015-06-26 15:53:22 -07:00
arc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
arm ARM: move heavy barrier support out of line 2015-07-25 15:28:05 +01:00
arm64 Various arm64 fixes: 2015-07-03 12:28:30 -07:00
avr32 Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-01 15:19:35 -07:00
blackfin Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
c6x Merge branch 'for-4.2/sg' of git://git.kernel.dk/linux-block 2015-06-25 15:22:36 -07:00
cris Replace module_init with equivalent device_initcall in non modules. 2015-07-02 10:30:48 -07:00
frv Fix up implicit <module.h> users that will break later. 2015-07-02 10:25:22 -07:00
h8300 h8300: Always build dtb 2015-06-23 13:36:00 +09:00
hexagon Merge branch 'for-4.2/sg' of git://git.kernel.dk/linux-block 2015-06-25 15:22:36 -07:00
ia64 remove some boot noise from a now-invalid check that pages are reserved 2015-07-02 14:46:15 -07:00
m32r Merge branch 'for-4.2/sg' of git://git.kernel.dk/linux-block 2015-06-25 15:22:36 -07:00
m68k Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-01 15:19:35 -07:00
metag Merge branch 'akpm' (patches from Andrew) 2015-06-26 09:52:05 -07:00
microblaze Merge branch 'for-4.2/sg' of git://git.kernel.dk/linux-block 2015-06-25 15:22:36 -07:00
mips Devicetree changes for v4.2 2015-07-01 19:40:18 -07:00
mn10300 Replace module_init with equivalent device_initcall in non modules. 2015-07-02 10:30:48 -07:00
nios2 nios2 update for v4.2 2015-07-03 12:22:49 -07:00
openrisc Merge branch 'for-4.2/sg' of git://git.kernel.dk/linux-block 2015-06-25 15:22:36 -07:00
parisc Replace module_init with equivalent device_initcall in non modules. 2015-07-02 10:30:48 -07:00
powerpc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
score Merge branch 'for-4.2/sg' of git://git.kernel.dk/linux-block 2015-06-25 15:22:36 -07:00
sh Replace module_init with equivalent device_initcall in non modules. 2015-07-02 10:30:48 -07:00
sparc Merge branch 'akpm' (patches from Andrew) 2015-06-26 09:52:05 -07:00
tile Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
um Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
unicore32 arch/unicore32/kernel/fpu-ucf64.c: remove unnecessary KERN_ERR 2015-06-30 19:44:59 -07:00
x86 platform-drivers-x86 for 4.2-2 2015-07-05 10:54:09 -07:00
xtensa Replace module_init with equivalent device_initcall in non modules. 2015-07-02 10:30:48 -07:00
.gitignore
Kconfig clone: support passing tls argument via C rather than pt_regs magic 2015-06-25 17:00:38 -07:00