aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org> 2016-06-10 10:53:46 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2016-06-10 10:53:46 -0700
commit02b07bde619e179bf7ac0e073d28e2e038dfab77 (patch)
tree47f3ce1a56cb4c7dd46f208d6c13208ef7ec900f /include/linux
parentMerge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/ker... (diff)
parentfutex: Calculate the futex key based on a tail page for file-based futexes (diff)
downloadlinux-02b07bde619e179bf7ac0e073d28e2e038dfab77.tar.gz
linux-02b07bde619e179bf7ac0e073d28e2e038dfab77.tar.bz2
linux-02b07bde619e179bf7ac0e073d28e2e038dfab77.zip
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Ingo Molnar: "Misc fixes: - a file-based futex fix - one more spin_unlock_wait() fix - a ww-mutex deadlock detection improvement/fix - and a raw_read_seqcount_latch() barrier fix" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: futex: Calculate the futex key based on a tail page for file-based futexes locking/qspinlock: Fix spin_unlock_wait() some more locking/ww_mutex: Report recursive ww_mutex locking early locking/seqcount: Re-fix raw_read_seqcount_latch()
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/seqlock.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 7973a821ac58..ead97654c4e9 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -277,7 +277,10 @@ static inline void raw_write_seqcount_barrier(seqcount_t *s)
static inline int raw_read_seqcount_latch(seqcount_t *s)
{
- return lockless_dereference(s)->sequence;
+ int seq = READ_ONCE(s->sequence);
+ /* Pairs with the first smp_wmb() in raw_write_seqcount_latch() */
+ smp_read_barrier_depends();
+ return seq;
}
/**
@@ -331,7 +334,7 @@ static inline int raw_read_seqcount_latch(seqcount_t *s)
* unsigned seq, idx;
*
* do {
- * seq = lockless_dereference(latch)->seq;
+ * seq = raw_read_seqcount_latch(&latch->seq);
*
* idx = seq & 0x01;
* entry = data_query(latch->data[idx], ...);