aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDipankar Sarma <dipankar@in.ibm.com>2004-08-22 22:58:51 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:58:51 -0700
commit5dae7a69a46f3a9f6562a4702f8beaa7f77e94f6 (patch)
tree40daf62eb530c10372f9cb90f600a0b040c5e725 /arch
parent9711268caede0cbd322244d70145a6e914fac52e (diff)
downloadhistory-5dae7a69a46f3a9f6562a4702f8beaa7f77e94f6.tar.gz
[PATCH] rcu: abstracted RCU dereferencing
Use abstracted RCU API to dereference RCU protected data. Hides barrier details. Patch from Paul McKenney. This patch introduced an rcu_dereference() macro that replaces most uses of smp_read_barrier_depends(). The new macro has the advantage of explicitly documenting which pointers are protected by RCU -- in contrast, it is sometimes difficult to figure out which pointer is being protected by a given smp_read_barrier_depends() call. Signed-off-by: Paul McKenney <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/kernel/mce.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 3bb678f1eb60aa..0399360a18eb2c 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -48,8 +48,7 @@ static void mce_log(struct mce *mce)
mce->finished = 0;
smp_wmb();
for (;;) {
- entry = mcelog.next;
- read_barrier_depends();
+ entry = rcu_dereference(mcelog.next);
/* When the buffer fills up discard new entries. Assume
that the earlier errors are the more interesting. */
if (entry >= MCE_LOG_LEN) {
@@ -333,9 +332,8 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize, loff
int i, err;
down(&mce_read_sem);
- next = mcelog.next;
- read_barrier_depends();
-
+ next = rcu_dereference(mcelog.next);
+
/* Only supports full reads right now */
if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) {
up(&mce_read_sem);