linux/include
Nick Piggin b6c7347fff x86: optimise barriers
According to latest memory ordering specification documents from Intel
and AMD, both manufacturers are committed to in-order loads from
cacheable memory for the x86 architecture.  Hence, smp_rmb() may be a
simple barrier.

Also according to those documents, and according to existing practice in
Linux (eg.  spin_unlock doesn't enforce ordering), stores to cacheable
memory are visible in program order too.  Special string stores are safe
-- their constituent stores may be out of order, but they must complete
in order WRT surrounding stores.  Nontemporal stores to WB memory can go
out of order, and so they should be fenced explicitly to make them
appear in-order WRT other stores.  Hence, smp_wmb() may be a simple
barrier.

    http://developer.intel.com/products/processor/manuals/318147.pdf
    http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24593.pdf

In userspace microbenchmarks on a core2 system, fence instructions range
anywhere from around 15 cycles to 50, which may not be totally
insignificant in performance critical paths (code size will go down
too).

However the primary motivation for this is to have the canonical barrier
implementation for x86 architecture.

smp_rmb on buggy pentium pros remains a locked op, which is apparently
required.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-12 18:41:21 -07:00
..
acpi ACPI: CONFIG_ACPI_SLEEP=n power off regression in 2.6.23-rc8 (NOT in rc7) 2007-09-25 17:58:52 -04:00
asm-alpha Fix Alpha O_CLOEXEC definition 2007-08-09 08:39:22 -07:00
asm-arm Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight 2007-10-11 19:19:50 -07:00
asm-avr32 [AVR32] Don't use __builtin_xchg() 2007-10-11 13:32:56 +02:00
asm-blackfin Blackfin arch: update kgdb patch 2007-10-10 16:47:58 +08:00
asm-cris
asm-frv FRV: connect up fallocate 2007-08-11 15:47:40 -07:00
asm-generic libata-portmap: Remove unused definitions 2007-10-12 14:55:37 -04:00
asm-h8300 Binfmt_flat: Add minimum support for the Blackfin relocations 2007-10-03 23:41:43 +08:00
asm-ia64 [IA64] Cleanup HPSIM code (was: Re: Enable early console for Ski simulator) 2007-09-01 02:52:25 -07:00
asm-m32r Binfmt_flat: Add minimum support for the Blackfin relocations 2007-10-03 23:41:43 +08:00
asm-m68k m68k(nommu): add missing syscalls 2007-09-11 17:21:20 -07:00
asm-m68knommu Binfmt_flat: Add minimum support for the Blackfin relocations 2007-10-03 23:41:43 +08:00
asm-mips [MIPS] R1: Fix hazard barriers to make kernels work on R2 also. 2007-10-11 23:46:19 +01:00
asm-parisc [PARISC] Add dummy isa_(bus|virt)_to_(virt|bus) inlines 2007-08-27 00:29:22 -04:00
asm-powerpc Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
asm-ppc [POWERPC] Prevent direct inclusion of <asm/rwsem.h>. 2007-09-22 14:49:21 +10:00
asm-s390 [S390] s390: use PAGE_SIZE in vmlinux.lds 2007-10-12 16:13:10 +02:00
asm-sh i386/x86_64: move headers to include/asm-x86 2007-10-11 11:20:03 +02:00
asm-sh64 sh64: Add missing dma_sync_single_for_*(). 2007-08-10 02:47:31 +09:00
asm-sparc [SPARC32]: Make flush_tlb_kernel_range() an inline function. 2007-08-26 18:49:12 -07:00
asm-sparc64 [SPARC64]: Fix lockdep, particularly on SMP. 2007-09-16 11:51:15 -07:00
asm-um UML: Fix ELF_CORE_COPY_REGS build botch 2007-09-10 18:58:05 -07:00
asm-v850 Binfmt_flat: Add minimum support for the Blackfin relocations 2007-10-03 23:41:43 +08:00
asm-x86 x86: optimise barriers 2007-10-12 18:41:21 -07:00
asm-xtensa [patch 1/2] Xtensa: enable arbitary tty speed setting ioctls 2007-08-27 13:54:25 -07:00
crypto [CRYPTO] sha: Add header file for SHA definitions 2007-10-10 16:55:50 -07:00
keys
linux Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev 2007-10-12 16:16:41 -07:00
math-emu Fix <math-emu/soft-fp.h> tpyo 2007-08-18 17:15:17 -07:00
media V4L/DVB (6293): V4L: convert struct class_device to struct device 2007-10-10 00:03:14 -03:00
mtd
net [IPv6]: Export userland ND options through netlink (RDNSS support) 2007-10-10 21:22:05 -07:00
pcmcia
rdma IB/cm: Modify interface to send MRAs in response to duplicate messages 2007-10-09 19:59:17 -07:00
rxrpc
scsi [SCSI] libiscsi: sync up iscsi and scsi eh's access to the connection 2007-08-15 13:09:21 -05:00
sound
video
xen
Kbuild