diff options
author | akpm@osdl.org <akpm@osdl.org> | 2005-05-01 11:58:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:58:47 -0400 |
commit | d59dd4620fb8d6422555a9e2b82a707718e68327 (patch) | |
tree | 78205657d24efcaa3f8314064951ac3814ed95a7 /lib | |
parent | 0d8d4d42f2d00eb65262b49f4edd4cf7ef4eb6fc (diff) |
[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')
-rw-r--r-- | lib/rwsem-spinlock.c | 6 | ||||
-rw-r--r-- | lib/rwsem.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/rwsem-spinlock.c b/lib/rwsem-spinlock.c index 21f0db2c9711..40ffde940a86 100644 --- a/lib/rwsem-spinlock.c +++ b/lib/rwsem-spinlock.c | |||
@@ -76,7 +76,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int wakewrite) | |||
76 | list_del(&waiter->list); | 76 | list_del(&waiter->list); |
77 | tsk = waiter->task; | 77 | tsk = waiter->task; |
78 | /* Don't touch waiter after ->task has been NULLed */ | 78 | /* Don't touch waiter after ->task has been NULLed */ |
79 | mb(); | 79 | smp_mb(); |
80 | waiter->task = NULL; | 80 | waiter->task = NULL; |
81 | wake_up_process(tsk); | 81 | wake_up_process(tsk); |
82 | put_task_struct(tsk); | 82 | put_task_struct(tsk); |
@@ -91,7 +91,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int wakewrite) | |||
91 | 91 | ||
92 | list_del(&waiter->list); | 92 | list_del(&waiter->list); |
93 | tsk = waiter->task; | 93 | tsk = waiter->task; |
94 | mb(); | 94 | smp_mb(); |
95 | waiter->task = NULL; | 95 | waiter->task = NULL; |
96 | wake_up_process(tsk); | 96 | wake_up_process(tsk); |
97 | put_task_struct(tsk); | 97 | put_task_struct(tsk); |
@@ -123,7 +123,7 @@ __rwsem_wake_one_writer(struct rw_semaphore *sem) | |||
123 | list_del(&waiter->list); | 123 | list_del(&waiter->list); |
124 | 124 | ||
125 | tsk = waiter->task; | 125 | tsk = waiter->task; |
126 | mb(); | 126 | smp_mb(); |
127 | waiter->task = NULL; | 127 | waiter->task = NULL; |
128 | wake_up_process(tsk); | 128 | wake_up_process(tsk); |
129 | put_task_struct(tsk); | 129 | put_task_struct(tsk); |
diff --git a/lib/rwsem.c b/lib/rwsem.c index 7644089ec8fa..62fa4eba9ffe 100644 --- a/lib/rwsem.c +++ b/lib/rwsem.c | |||
@@ -74,7 +74,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading) | |||
74 | */ | 74 | */ |
75 | list_del(&waiter->list); | 75 | list_del(&waiter->list); |
76 | tsk = waiter->task; | 76 | tsk = waiter->task; |
77 | mb(); | 77 | smp_mb(); |
78 | waiter->task = NULL; | 78 | waiter->task = NULL; |
79 | wake_up_process(tsk); | 79 | wake_up_process(tsk); |
80 | put_task_struct(tsk); | 80 | put_task_struct(tsk); |
@@ -117,7 +117,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading) | |||
117 | waiter = list_entry(next, struct rwsem_waiter, list); | 117 | waiter = list_entry(next, struct rwsem_waiter, list); |
118 | next = waiter->list.next; | 118 | next = waiter->list.next; |
119 | tsk = waiter->task; | 119 | tsk = waiter->task; |
120 | mb(); | 120 | smp_mb(); |
121 | waiter->task = NULL; | 121 | waiter->task = NULL; |
122 | wake_up_process(tsk); | 122 | wake_up_process(tsk); |
123 | put_task_struct(tsk); | 123 | put_task_struct(tsk); |