lkml.org 
[lkml]   [2016]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/7 V6] Clarify/standardize memory barriers for lock/unlock
Date
Hi,

Based on the new consensus:
- spin_unlock_wait() is spin_lock();spin_unlock();
- no guarantees are provided by spin_is_locked().
- the acquire during spin_lock() is for the load, not for the store.

Summary:
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: Update ipc/sem.c based on rules above
Patch 4: Move smp_mb__after_unlock_lock to <linux/spinlock.h>
Patch 5: Fix memory ordering for nf_conntrack
Patch 6: nf_conntrack: Remove smp_rmb() after spin_unlock_wait()
Patch 7: nf_conntrack: Remove smp_mb() after spin_lock().

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.

@netfilter team: Over which tree should the patch be sent?
Usually, I ask Andrew to merge my patches (as there is no
maintainer tree for ipc).

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


--
Manfred

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.692 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site