[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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
[email protected] 2005-05-01 08:58:47 -07:00 • committed by Linus Torvalds
commit d59dd4620f
11 changed files with 31 additions and 31 deletions

View file

@ -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);