android_kernel_xiaomi_sm8350/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
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
arch_hooks.h
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
bugs.h [PATCH] x86: update for i386 and x86-64 check_bugs 2007-05-02 19:27:16 +02:00
byteorder.h
cache.h
cacheflush.h
checksum.h
cmpxchg.h i386: Use patchable lock prefix in set_64bit 2007-07-22 11:03:38 -07:00
cpu.h
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
desc.h [PATCH] i386: Page-align the GDT 2007-05-02 19:27:15 +02:00
device.h
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
dmi.h
dwarf2.h
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
frame.i
futex.h
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
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
hypertransport.h
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
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
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
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
mc146818rtc.h i386: add cpu_relax() to cmos_lock() 2007-07-21 18:37:13 -07:00
mca_dma.h
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
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
mpspec.h
msgbuf.h
msidef.h
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
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
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
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
ptrace.h
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
rwsem.h
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
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
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
spinlock.h
srat.h
stacktrace.h
stat.h
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
thread_info.h remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
time.h
timer.h i386: move PIT function declarations and constants to correct header file 2007-07-21 18:37:14 -07:00
timex.h
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
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
user.h
vga.h
vic.h
vm86.h
vmi_time.h Add a sched_clock paravirt_op 2007-07-18 08:47:42 -07:00
vmi.h
voyager.h [VOYAGER] Convert the monitor thread to use the kthread API 2007-05-01 10:09:29 -05:00
xor.h