linux/include/asm-i386
Nick Piggin 4827bbb06e i386: remove bogus comment about memory barrier
The comment being removed by this patch is incorrect and misleading.

In the following situation:

	1. load  ...
	2. store 1 -> X
	3. wmb
	4. rmb
	5. load  a <- Y
	6. store ...

4 will only ensure ordering of 1 with 5.
3 will only ensure ordering of 2 with 6.

Further, a CPU with strictly in-order stores will still only provide that
2 and 6 are ordered (effectively, it is the same as a weakly ordered CPU
with wmb after every store).

In all cases, 5 may still be executed before 2 is visible to other CPUs!

The additional piece of the puzzle that mb() provides is the store/load
ordering, which fundamentally cannot be achieved with any combination of
rmb()s and wmb()s.

This can be an unexpected result if one expected any sort of global ordering
guarantee to barriers (eg. that the barriers themselves are sequentially
consistent with other types of barriers).  However sfence or lfence barriers
need only provide an ordering partial ordering of memory operations -- Consider
that wmb may be implemented as nothing more than inserting a special barrier
entry in the store queue, or, in the case of x86, it can be a noop as the store
queue is in order. And an rmb may be implemented as a directive to prevent
subsequent loads only so long as their are no previous outstanding loads (while
there could be stores still in store queues).

I can actually see the occasional load/store being reordered around lfence on
my core2. That doesn't prove my above assertions, but it does show the comment
is wrong (unless my program is -- can send it out by request).

So:
   mb() and smp_mb() always have and always will require a full mfence
   or lock prefixed instruction on x86.  And we should remove this comment.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Paul McKenney <paulmck@us.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-09-29 09:13:59 -07:00
..
mach-bigsmp [PATCH] x86: default to physical mode on hotplug CPU kernels 2007-05-02 19:27:04 +02:00
mach-default i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert() 2007-08-18 09:54:44 -07:00
mach-es7000 i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert() 2007-08-18 09:54:44 -07:00
mach-generic [PATCH] x86: default to physical mode on hotplug CPU kernels 2007-05-02 19:27:04 +02:00
mach-numaq [PATCH] x86: default to physical mode on hotplug CPU kernels 2007-05-02 19:27:04 +02:00
mach-summit [PATCH] x86: Log reason why TSC was marked unstable 2007-05-02 19:27:08 +02:00
mach-visws [PATCH] x86: default to physical mode on hotplug CPU kernels 2007-05-02 19:27:04 +02:00
mach-voyager i386: remove pit_interrupt_hook 2007-07-21 18:37:08 -07:00
xen xen: add the Xenbus sysfs and virtual device hotplug driver 2007-07-18 08:47:45 -07:00
8253pit.h
a.out.h arch: personality independent stack top 2007-07-19 10:04:45 -07:00
acpi.h ACPI: Kconfig: remove CONFIG_ACPI_SLEEP from source 2007-07-25 01:29:39 -04:00
agp.h [AGPGART] Move [un]map_page_into_agp into asm/agp.h 2007-04-26 14:22:50 -04:00
alternative-asm.i Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
alternative.h x86: Fix alternatives and kprobes to remap write-protected kernel text 2007-07-22 11:03:37 -07:00
apic.h i386: Use global flag to disable broken local apic timer on AMD CPUs. 2007-08-11 15:58:13 -07:00
apicdef.h x86_64: Remove stale lapic definition from apicdef.h 2006-04-01 22:50:03 -05:00
arch_hooks.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
atomic.h i386: fix early usage of atomic_add_return and local_add_return on real i386 2007-05-23 20:14:15 -07:00
auxvec.h
bitops.h Fix misspellings collected by members of KJ list. 2007-05-09 07:14:03 +02:00
boot.h include/asm-i386/boot.h: This is <asm/boot.h>, not <linux/boot.h> 2007-07-12 10:55:54 -07:00
bootparam.h [x86 setup] Make struct ist_info cross-architecture, and use in setup code 2007-07-25 12:02:21 -07:00
bug.h [PATCH] Generic BUG for i386 2006-12-08 08:28:39 -08:00
bugs.h [PATCH] x86: update for i386 and x86-64 check_bugs 2007-05-02 19:27:16 +02:00
byteorder.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
cache.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
cacheflush.h [PATCH] Optimize D-cache alias handling on fork 2006-12-13 09:27:08 -08:00
checksum.h [NET]: I386 checksum annotations and cleanups. 2006-12-02 21:23:19 -08:00
cmpxchg.h i386: Use patchable lock prefix in set_64bit 2007-07-22 11:03:38 -07:00
cpu.h [PATCH] i386: introduce the mechanism of disabling cpu hotplug control 2006-12-07 02:14:10 +01:00
cpufeature.h i386: Use global flag to disable broken local apic timer on AMD CPUs. 2007-08-11 15:58:13 -07:00
cputime.h
current.h [PATCH] i386: Convert PDA into the percpu section 2007-05-02 19:27:16 +02:00
debugreg.h
delay.h [PATCH] vmi: paravirt drop udelay op 2007-03-05 07:57:52 -08:00
desc.h [PATCH] i386: Page-align the GDT 2007-05-02 19:27:15 +02:00
device.h ACPI: Change ACPI to use dev_archdata instead of firmware_data 2006-12-01 14:52:01 -08:00
div64.h [NET]: div64_64 consolidate (rev3) 2007-04-25 22:23:33 -07:00
dma-mapping.h x86: Disable DAC on VIA bridges 2007-06-20 14:27:25 -07:00
dma.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
dmi.h [PATCH] x86_64: Implement early DMI scanning 2006-03-25 09:10:55 -08:00
dwarf2.h [PATCH] i386/x86-64: Work around gcc bug with noreturn functions in unwinder 2006-09-26 10:52:41 +02:00
e820.h Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION 2007-07-29 16:45:38 -07:00
edac.h
elf.h i386: sched.h inclusion from module.h is baack 2007-05-08 11:15:08 -07:00
emergency-restart.h
errno.h
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h
fixmap.h serial: convert early_uart to earlycon for 8250 2007-07-16 09:05:35 -07:00
floppy.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
frame.i Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
futex.h [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
genapic.h [PATCH] x86: default to physical mode on hotplug CPU kernels 2007-05-02 19:27:04 +02:00
geode.h i386: basic infrastructure support for AMD geode-class machines 2007-07-21 18:37:14 -07:00
hardirq.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
highmem.h [PATCH] i386: PARAVIRT: add kmap_atomic_pte for mapping highpte pages 2007-05-02 19:27:15 +02:00
hpet.h x86: share hpet.h with i386 2007-07-21 18:37:09 -07:00
hw_irq.h [PATCH] i386/x86_64: Remove global IO_APIC_VECTOR 2006-10-08 12:24:02 -07:00
hypertransport.h [PATCH] Initial generic hypertransport interrupt support 2006-10-04 07:55:29 -07:00
i387.h [PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu 2007-05-02 19:27:21 +02:00
i8253.h i386: move PIT function declarations and constants to correct header file 2007-07-21 18:37:14 -07:00
i8259.h
ide.h fix jvc cdrom drive lockup 2007-07-16 09:05:40 -07:00
intel_arch_perfmon.h [PATCH] x86: i386/x86-64 Add nmi watchdog support for new Intel CPUs 2006-09-26 10:52:27 +02:00
io_apic.h ACPI: boot correctly with "nosmp" or "maxcpus=0" 2007-08-21 00:33:35 -04:00
io.h PCI: Document pci_iomap() 2007-08-22 14:48:40 -07:00
ioctl.h
ioctls.h tty: i386/x86_64 arbitary speed support 2007-05-08 11:15:03 -07:00
ipc.h
ipcbuf.h
irq_regs.h [PATCH] i386: Convert PDA into the percpu section 2007-05-02 19:27:16 +02:00
irq.h xen: Core Xen implementation 2007-07-18 08:47:42 -07:00
irqflags.h [PATCH] i386: Use X86_EFLAGS_IF in irqflags.h. 2007-05-02 19:27:10 +02:00
ist.h [x86 setup] Make struct ist_info cross-architecture, and use in setup code 2007-07-25 12:02:21 -07:00
k8.h [PATCH] x86_64: Clean and enhance up K8 northbridge access code 2006-06-26 10:48:15 -07:00
Kbuild [PATCH] x86: Clean up x86 control register and MSR macros (corrected) 2007-05-02 19:27:12 +02:00
kdebug.h Revert "ipmi: add new IPMI nmi watchdog handling" 2007-05-14 15:24:24 -07:00
kexec.h kdump/kexec: calculate note size at compile time 2007-05-08 11:15:07 -07:00
kmap_types.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
kprobes.h jprobes: remove JPROBE_ENTRY() 2007-07-19 10:04:44 -07:00
ldt.h
linkage.h
local.h i386: fix early usage of atomic_add_return and local_add_return on real i386 2007-05-23 20:14:15 -07:00
math_emu.h [PATCH] i386: PDA: Fix math emulator for new pt_regs 2006-12-07 02:14:03 +01:00
mc146818rtc.h i386: add cpu_relax() to cmos_lock() 2007-07-21 18:37:13 -07:00
mca_dma.h [PATCH] kernel-doc for kernel/dma.c 2006-10-03 08:03:41 -07:00
mca.h
mce.h x86: Stop MCEs and NMIs during code patching 2007-07-22 11:03:37 -07:00
mman.h
mmu_context.h paravirt: unstatic leave_mm 2007-07-18 08:47:41 -07:00
mmu.h [PATCH] vdso: randomize the i386 vDSO by moving it into a vma 2006-06-27 17:32:38 -07:00
mmx.h
mmzone.h i386 mmzone: use __maybe_unused 2007-05-09 12:30:57 -07:00
module.h [PATCH] i386: Add an option for the VIA C7 which sets appropriate L1 cache 2007-05-02 19:27:05 +02:00
mpspec_def.h [PATCH] x86-64: remove remaining pc98 code 2006-12-07 02:14:19 +01:00
mpspec.h [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
msgbuf.h
msidef.h [PATCH] genirq: i386 irq: Move msi message composition into io_apic.c 2006-10-04 07:55:28 -07:00
msr-index.h [PATCH] i386: Enable support for fixed-range IORRs to keep RdMem & WrMem in sync 2007-05-02 19:27:17 +02:00
msr.h i386: msr.h: be paranoid about types and parentheses 2007-05-09 12:49:33 -07:00
mtrr.h [PATCH] x86: Save the MTRRs of the BSP before booting an AP 2007-05-02 19:27:17 +02:00
mutex.h [PATCH] i386: Remove lock section support in mutex.h 2006-09-26 10:52:31 +02:00
namei.h
nmi.h x86_64: Fix to keep watchdog disabled by default for i386/x86_64 2007-08-18 10:25:25 -07:00
numa.h
numaq.h
page.h i386: minor nx handling adjustment 2007-07-21 18:37:09 -07:00
param.h [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
paravirt.h i386: Make patching more robust, fix paravirt issue 2007-08-11 15:58:13 -07:00
parport.h
pci-direct.h
pci.h finish i386 and x86-64 sysdata conversion 2007-08-11 15:47:42 -07:00
percpu.h define new percpu interface for shared data 2007-07-19 10:04:44 -07:00
pgalloc.h paravirt: add an "mm" argument to alloc_pt 2007-07-18 08:47:40 -07:00
pgtable-2level-defs.h [PATCH] i386: PARAVIRT: Allow paravirt backend to choose kernel PMD sharing 2007-05-02 19:27:13 +02:00
pgtable-2level.h page table handling cleanup 2007-07-16 09:05:36 -07:00
pgtable-3level-defs.h [PATCH] i386: PARAVIRT: Allow paravirt backend to choose kernel PMD sharing 2007-05-02 19:27:13 +02:00
pgtable-3level.h page table handling cleanup 2007-07-16 09:05:36 -07:00
pgtable.h mm: remove ptep_test_and_clear_dirty and ptep_clear_flush_dirty 2007-07-17 10:22:59 -07:00
poll.h Consolidate asm/poll.h 2007-05-11 08:29:34 -07:00
posix_types.h i386: improve and correct inline asm memory constraints 2006-07-08 15:24:18 -07:00
processor-cyrix.h x86: Replace NSC/Cyrix specific chipset access macros by inlined functions. 2007-07-22 11:03:38 -07:00
processor-flags.h [PATCH] x86: Clean up x86 control register and MSR macros (corrected) 2007-05-02 19:27:12 +02:00
processor.h x86: Replace NSC/Cyrix specific chipset access macros by inlined functions. 2007-07-22 11:03:38 -07:00
ptrace-abi.h [PATCH] Split i386 and x86_64 ptrace.h 2006-09-26 08:49:10 -07:00
ptrace.h [PATCH] i386: Profile pc badness 2007-02-13 13:26:21 +01:00
reboot_fixups.h [PATCH] i386: clean up mach_reboot_fixups 2007-05-02 19:27:06 +02:00
reboot.h [PATCH] i386: Add machine_ops interface to abstract halting and rebooting 2007-05-02 19:27:11 +02:00
required-features.h i386: Allow KVM on i386 nonpae 2007-07-19 14:37:05 -07:00
resource.h
resume-trace.h x86: PM_TRACE support 2007-07-21 18:37:10 -07:00
rtc.h
rwlock.h [PATCH] i386: Clean up spin/rwlocks 2006-09-26 10:52:32 +02:00
rwsem.h [PATCH] lockdep: name some old style locks 2006-12-07 08:39:36 -08:00
scatterlist.h PCI: scatterlist.h needs types.h 2007-05-02 19:02:34 -07:00
seccomp.h
sections.h
segment.h [PATCH] i386: Fix UP gdt bugs 2007-05-02 19:27:16 +02:00
semaphore.h [PATCH] i386: Use early clobbers for semaphores now 2006-09-27 14:39:51 -07:00
sembuf.h
serial.h revert "x86, serial: convert legacy COM ports to platform devices" 2007-07-31 15:39:38 -07:00
setup.h paravirt: add a hook for once the allocator is ready 2007-07-18 08:47:41 -07:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h [PATCH] headers_check: move inclusion of <linux/linkage.h> in <asm-i386/signal.h> 2006-09-13 07:32:15 -07:00
smp.h paravirt: make siblingmap functions visible 2007-07-18 08:47:41 -07:00
socket.h [NET]: Adding SO_TIMESTAMPNS / SCM_TIMESTAMPNS support 2007-04-25 22:24:21 -07:00
sockios.h [NET]: Introduce SIOCGSTAMPNS ioctl to get timestamps with nanosec resolution 2007-04-25 22:24:04 -07:00
sparsemem.h
spinlock_types.h [PATCH] Remove 'volatile' from spinlock_types 2006-12-06 14:39:53 -08:00
spinlock.h [PATCH] paravirt: Patch inline replacements for paravirt intercepts 2006-12-07 02:14:08 +01:00
srat.h
stacktrace.h [PATCH] i386: Do stacktracer conversion too 2006-09-26 10:52:34 +02:00
stat.h [PATCH] 2TB files: st_blocks is invalid when calling stat64 2006-03-26 08:57:00 -08:00
statfs.h
string.h i386: Move all simple string operations out of line 2007-07-21 18:37:08 -07:00
suspend.h ACPI: Kconfig: remove CONFIG_ACPI_SLEEP from source 2007-07-25 01:29:39 -04:00
sync_bitops.h Fix misspellings collected by members of KJ list. 2007-05-09 07:14:03 +02:00
system.h i386: remove bogus comment about memory barrier 2007-09-29 09:13:59 -07:00
termbits.h tty: i386/x86_64 arbitary speed support 2007-05-08 11:15:03 -07:00
termios.h tty: i386/x86_64 arbitary speed support 2007-05-08 11:15:03 -07:00
therm_throt.h [PATCH] x86: Add a cumulative thermal throttle event counter. 2006-09-26 10:52:42 +02:00
thread_info.h remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
time.h [PATCH] vmi: pit override 2007-03-05 07:57:52 -08:00
timer.h i386: move PIT function declarations and constants to correct header file 2007-07-21 18:37:14 -07:00
timex.h [PATCH] Time: i386 Conversion - part 2: Rework TSC Support 2006-06-26 09:58:21 -07:00
tlb.h
tlbflush.h i386: add reference to the arguments 2007-07-21 18:37:10 -07:00
topology.h x86-64: introduce struct pci_sysdata to facilitate sharing of ->sysdata 2007-07-21 18:37:14 -07:00
tsc.h lguest: the host code 2007-07-19 10:04:52 -07:00
types.h [PATCH] Centralise definitions of sector_t and blkcnt_t 2006-12-04 19:41:15 -08:00
uaccess.h i386: replace hard-coded constant with appropriate macro from kernel.h 2007-07-21 18:37:13 -07:00
ucontext.h
unaligned.h
unistd.h sys_fallocate() implementation on i386, x86_64 and powerpc 2007-07-17 21:42:44 -04:00
unwind.h Remove stack unwinder for now 2006-12-15 08:47:51 -08:00
user.h
vga.h [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use 2006-06-22 15:05:58 -07:00
vic.h [VOYAGER] fix up ptregs removal mess 2006-10-12 22:25:03 -05:00
vm86.h [PATCH] i386: Update sys_vm86 to cope with changed pt_regs and %gs usage 2006-12-07 02:14:03 +01:00
vmi_time.h Add a sched_clock paravirt_op 2007-07-18 08:47:42 -07:00
vmi.h [PATCH] vmi: apic ops 2007-03-05 07:57:52 -08:00
voyager.h [VOYAGER] Convert the monitor thread to use the kthread API 2007-05-01 10:09:29 -05:00
xor.h