mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5 V5] Clarify/standardize memory barriers for lock/unlock
@ 2016-08-31 13:42 Manfred Spraul
  2016-08-31 13:42 ` [PATCH 1/5] ipc/sem.c: Remove smp_rmb() from complexmode_enter() Manfred Spraul
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Manfred Spraul @ 2016-08-31 13:42 UTC (permalink / raw)
  To: benh, paulmck, Ingo Molnar, Boqun Feng, Peter Zijlstra, Andrew Morton
  Cc: LKML, 1vier1, Davidlohr Bueso, Manfred Spraul

Hi,

V5: Major restructuring based on input from Peter and Davidlohr.

As discussed before:
If a high-scalability locking scheme is built with multiple
spinlocks, then often additional memory barriers are required.

The documentation was not as clear as possible, and memory
barriers were missing / superfluous in the implementation.

Patch 1: sem.c: Remove the smp_rmb() after spin_unlock_wait().
Patch 2: Documentation
Patch 3: Add spinlock_store_acquire(), update ipc/sem.c
Patch 4: Move smp_mb__after_unlock_lock to <linux/spinlock.h>
Patch 5: Fix memory ordering for nf_conntrack

The patches are safe for all architectures, the default is smp_mb().

Patch 5 is larger than required, it rewrites the conntrack logic
with the code from ipc/sem.c. I think the new code is simpler
and more realtime-friendly.

@Peter: A hint if qspinlocks can omit the smp_mb() would be
appreciated (everywhere or x86-only).
The comments on top of queued_spin_unlock_wait() had convinced
me that no additional barrier is required.
But the comment also convinced me that on x86, no further
barrier would be required for a full smp_mb() - and there you
wrote that this is wrong.

@Andrew: The patches are relative to mmots.
Could you include them in your tree, with the target of including in
linux-next?

--
	Manfred

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-08-31 14:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-31 13:42 [PATCH 0/5 V5] Clarify/standardize memory barriers for lock/unlock Manfred Spraul
2016-08-31 13:42 ` [PATCH 1/5] ipc/sem.c: Remove smp_rmb() from complexmode_enter() Manfred Spraul
2016-08-31 13:42 ` [PATCH 2/5] spinlock: Document memory barrier rules for spin_lock and spin_unlock() Manfred Spraul
2016-08-31 13:42 ` [PATCH 3/5] spinlock: define spinlock_store_acquire Manfred Spraul
2016-08-31 13:42 ` [PATCH 4/5] spinlock.h: Move smp_mb__after_unlock_lock to spinlock.h Manfred Spraul
2016-08-31 13:42 ` [PATCH 5/5] net/netfilter/nf_conntrack_core: update memory barriers Manfred Spraul
2016-08-31 14:15   ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®