summaryrefslogtreecommitdiff
path: root/lib/rwsem-spinlock.c
diff options
context:
space:
mode:
authorakpm@osdl.org <akpm@osdl.org>2005-05-01 08:58:47 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 08:58:47 -0700
commitd59dd4620fb8d6422555a9e2b82a707718e68327 (patch)
tree78205657d24efcaa3f8314064951ac3814ed95a7 /lib/rwsem-spinlock.c
parent0d8d4d42f2d00eb65262b49f4edd4cf7ef4eb6fc (diff)
downloadlinux-3.10-d59dd4620fb8d6422555a9e2b82a707718e68327.tar.gz
linux-3.10-d59dd4620fb8d6422555a9e2b82a707718e68327.tar.bz2
linux-3.10-d59dd4620fb8d6422555a9e2b82a707718e68327.zip
[PATCH] use smp_mb/wmb/rmb where possible
Replace a number of memory barriers with smp_ variants. This means we won't take the unnecessary hit on UP machines. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'lib/rwsem-spinlock.c')
-rw-r--r--lib/rwsem-spinlock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rwsem-spinlock.c b/lib/rwsem-spinlock.c
index 21f0db2c971..40ffde940a8 100644
--- a/lib/rwsem-spinlock.c
+++ b/lib/rwsem-spinlock.c
@@ -76,7 +76,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int wakewrite)
list_del(&waiter->list);
tsk = waiter->task;
/* Don't touch waiter after ->task has been NULLed */
- mb();
+ smp_mb();
waiter->task = NULL;
wake_up_process(tsk);
put_task_struct(tsk);
@@ -91,7 +91,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int wakewrite)
list_del(&waiter->list);
tsk = waiter->task;
- mb();
+ smp_mb();
waiter->task = NULL;
wake_up_process(tsk);
put_task_struct(tsk);
@@ -123,7 +123,7 @@ __rwsem_wake_one_writer(struct rw_semaphore *sem)
list_del(&waiter->list);
tsk = waiter->task;
- mb();
+ smp_mb();
waiter->task = NULL;
wake_up_process(tsk);
put_task_struct(tsk);