From: tip-bot for Will Deacon <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
hpa@zytor.com, torvalds@linux-foundation.org,
will.deacon@arm.com, paulmck@linux.vnet.ibm.com,
mingo@kernel.org, tglx@linutronix.de
Subject: [tip:locking/core] locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
Date: Tue, 24 Oct 2017 05:46:34 -0700 [thread overview]
Message-ID: <tip-76ebbe78f7390aee075a7f3768af197ded1bdfbb@git.kernel.org> (raw)
In-Reply-To: <1508840570-22169-3-git-send-email-will.deacon@arm.com>
Commit-ID: 76ebbe78f7390aee075a7f3768af197ded1bdfbb
Gitweb: https://git.kernel.org/tip/76ebbe78f7390aee075a7f3768af197ded1bdfbb
Author: Will Deacon <will.deacon@arm.com>
AuthorDate: Tue, 24 Oct 2017 11:22:47 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 24 Oct 2017 13:17:32 +0200
locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
In preparation for the removal of lockless_dereference(), which is the
same as READ_ONCE() on all architectures other than Alpha, add an
implicit smp_read_barrier_depends() to READ_ONCE() so that it can be
used to head dependency chains on all architectures.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1508840570-22169-3-git-send-email-will.deacon@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
include/linux/compiler.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 0808318..7d7b77d 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -242,6 +242,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
__read_once_size(&(x), __u.__c, sizeof(x)); \
else \
__read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
+ smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \
__u.__val; \
})
#define READ_ONCE(x) __READ_ONCE(x, 1)
next prev parent reply other threads:[~2017-10-24 12:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 10:22 [PATCH v2 0/5] Get rid of lockless_dereference() Will Deacon
2017-10-24 10:22 ` [PATCH v2 1/5] linux/compiler.h: Split into compiler.h and compiler_types.h Will Deacon
2017-10-24 12:46 ` [tip:locking/core] " tip-bot for Will Deacon
2017-10-24 10:22 ` [PATCH v2 2/5] locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE() Will Deacon
2017-10-24 12:46 ` tip-bot for Will Deacon [this message]
2017-10-24 10:22 ` [PATCH v2 3/5] locking/barriers: Convert users of lockless_dereference() " Will Deacon
2017-10-24 12:47 ` [tip:locking/core] " tip-bot for Will Deacon
2017-10-24 10:22 ` [PATCH v2 4/5] locking/barriers: Kill lockless_dereference() Will Deacon
2017-10-24 12:47 ` [tip:locking/core] " tip-bot for Will Deacon
2017-10-24 10:22 ` [PATCH v2 5/5] alpha: atomics: Add smp_read_barrier_depends() to release/relaxed atomics Will Deacon
2017-10-24 12:47 ` [tip:locking/core] locking/atomics/alpha: Add smp_read_barrier_depends() to _release()/_relaxed() atomics tip-bot for Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-76ebbe78f7390aee075a7f3768af197ded1bdfbb@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome