Thread (18 messages) 18 messages, 2 authors, 2018-08-03
STALE2871d

[PATCH 08/15] seqlock: provide the same ordering semantics as mainline

From: Tom Zanussi <hidden>
Date: 2018-08-02 22:26:39
Also in: lkml
Subsystem: locking primitives, the rest · Maintainers: Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Linus Torvalds

From: Julia Cartwright <redacted>

The mainline implementation of read_seqbegin() orders prior loads w.r.t.
the read-side critical section.  Fixup the RT writer-boosting
implementation to provide the same guarantee.

Also, while we're here, update the usage of ACCESS_ONCE() to use
READ_ONCE().

Fixes: e69f15cf77c23 ("seqlock: Prevent rt starvation")
Cc: stable-rt@vger.kernel.org
Signed-off-by: Julia Cartwright <redacted>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
(cherry picked from commit afa4c06b89a3c0fb7784ff900ccd707bef519cb7)
Signed-off-by: Tom Zanussi <redacted>
---
 include/linux/seqlock.h | 1 +
 1 file changed, 1 insertion(+)
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 4acd0e2fb5cb..efa234031230 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -338,6 +338,7 @@ repeat:
 		spin_unlock_wait(&sl->lock);
 		goto repeat;
 	}
+	smp_rmb();
 	return ret;
 }
 #endif
-- 
2.14.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help