From: Will Deacon <will.deacon@arm.com>
To: mingo@kernel.org
Cc: linux-kernel@vger.kernel.org, Will Deacon <will.deacon@arm.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH v2 2/5] locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
Date: Tue, 24 Oct 2017 11:22:47 +0100
Message-ID: <1508840570-22169-3-git-send-email-will.deacon@arm.com> (raw)
In-Reply-To: <1508840570-22169-1-git-send-email-will.deacon@arm.com>
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.
Cc: Ingo Molnar <mingo@kernel.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
include/linux/compiler.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 08083186e54f..7d7b77da9716 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)
--
2.1.4
next prev parent reply index
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 ` Will Deacon [this message]
2017-10-24 12:46 ` [tip:locking/core] locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE() tip-bot for Will Deacon
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=1508840570-22169-3-git-send-email-will.deacon@arm.com \
--to=will.deacon@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.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
LKML Archive on lore.kernel.org
Archives are clonable:
git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
linux-kernel@vger.kernel.org
public-inbox-index lkml
Example config snippet for mirrors
Newsgroup available over NNTP:
nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git