kernel_optimize_test/arch/mips
David Daney 6b07d38aaa MIPS: Octeon: Use optimized memory barrier primitives.
In order to achieve correct synchronization semantics, the Octeon port
had defined CONFIG_WEAK_REORDERING_BEYOND_LLSC.  This resulted in code
that looks like:

   sync
   ll ...
   .
   .
   .
   sc ...
   .
   .
   sync

The second SYNC was redundant, but harmless.

Octeon has a SYNCW instruction that acts as a write-memory-barrier
(due to an erratum in some parts two SYNCW are used).  It is much
faster than SYNC because it imposes ordering on the writes, but
doesn't otherwise stall the execution pipeline.  On Octeon, SYNC
stalls execution until all preceeding writes are committed to the
coherent memory system.

Using:

    syncw;syncw
    ll
    .
    .
    .
    sc
    .
    .

Has identical semantics to the first sequence, but is much faster.
The SYNCW orders the writes, and the SC will not complete successfully
until the write is committed to the coherent memory system.  So at the
end all preceeding writes have been committed.  Since Octeon does not
do speculative reads, this functions as a full barrier.

The patch removes CONFIG_WEAK_REORDERING_BEYOND_LLSC, and substitutes
SYNCW for SYNC in write-memory-barriers.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/850/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27 12:53:06 +01:00
..
alchemy MIPS: Alchemy: get rid of common/reset.c 2010-02-27 12:53:04 +01:00
ar7 MIPS: AR7: Fix USB slave mem range typo 2010-02-01 20:30:25 +01:00
bcm47xx MIPS: BCM47xx: Fix 128MB RAM support 2010-02-22 21:42:12 +01:00
bcm63xx MIPS: BCM63xx: Remove duplicate CONFIG_CMDLINE. 2010-01-12 18:19:36 +01:00
boot MIPS: Fix vmlinuz build for 32bit-only math shells 2010-01-28 00:03:30 +01:00
cavium-octeon MIPS: Octeon: Register some devices on the I2C bus. 2010-02-27 12:53:05 +01:00
cobalt MIPS: Cobalt use strlcat() for the command line arguments 2010-01-12 18:19:34 +01:00
configs MIPS: Alchemy: DB1200 defconfig update 2010-02-27 12:53:01 +01:00
dec
emma
fw MIPS: IP22: Remove an unused function 2009-12-17 01:56:56 +00:00
gt64120/wrppmc
include/asm MIPS: Octeon: Use optimized memory barrier primitives. 2010-02-27 12:53:06 +01:00
jazz
kernel MIPS: Two-level pagetables for 64-bit kernels with 64KB pages. 2010-02-27 12:53:03 +01:00
lasat MIPS: Lasat: Fix botched changes to sysctl code. 2009-12-17 01:57:37 +00:00
lib
loongson MIPS: Loongson: Cleanups of serial port support 2009-12-17 01:57:34 +00:00
math-emu MIPS: Collect FPU emulator statistics per-CPU. 2009-12-17 01:57:08 +00:00
mipssim MIPS: Malta, PowerTV: Remove unnecessary "Linux started" 2010-01-12 18:19:36 +01:00
mm MIPS: Two-level pagetables for 64-bit kernels with 64KB pages. 2010-02-27 12:53:03 +01:00
mti-malta MIPS: Malta, PowerTV: Remove unnecessary "Linux started" 2010-01-12 18:19:36 +01:00
nxp MIPS: Fixup last users of irq_chip->typename 2009-12-17 01:57:21 +00:00
oprofile MIPS: oprofile: Only do performance counter handling for counter interrupts 2009-12-17 01:57:10 +00:00
pci resource/PCI: mark struct resource as const 2010-02-22 16:16:57 -08:00
pmc-sierra resource/PCI: mark struct resource as const 2010-02-22 16:16:57 -08:00
power
powertv MIPS: PowerTV: Streamline access to platform device registers 2010-01-28 00:03:31 +01:00
rb532 MIPS: Replace all usages of CL_SIZE by COMMAND_LINE_SIZE 2009-12-17 01:56:56 +00:00
sgi-ip22 MIPS: Move several variables from .bss to .init.data 2009-12-17 01:57:27 +00:00
sgi-ip27 mm: make totalhigh_pages unsigned long 2010-01-11 09:34:03 -08:00
sgi-ip32 MIPS: Move several variables from .bss to .init.data 2009-12-17 01:57:27 +00:00
sibyte MIPS: Don't include <linux/smp_lock.h> unnecessarily. 2010-02-27 12:52:57 +01:00
sni MIPS: SNI: Correct NULL test 2010-02-10 22:15:45 +01:00
txx9 MIPS: TXx9: Cleanup builtin-cmdline processing 2010-01-12 18:19:34 +01:00
vr41xx MIPS: VR41xx: Use strlcat() for the command line arguments 2010-01-12 18:19:30 +01:00
Kconfig MIPS: Octeon: Use optimized memory barrier primitives. 2010-02-27 12:53:06 +01:00
Kconfig.debug MIPS: Fix and enhance built-in kernel command line 2009-12-17 01:57:35 +00:00
Makefile MIPS: Fix build error for uncompressed non-plain vmlinux kernels 2010-02-27 12:52:49 +01:00