diff options
Diffstat (limited to 'kernel/locking/osq_lock.c')
| -rw-r--r-- | kernel/locking/osq_lock.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c index c112d00341b0..dc85ee23a26f 100644 --- a/kernel/locking/osq_lock.c +++ b/kernel/locking/osq_lock.c | |||
| @@ -98,7 +98,7 @@ bool osq_lock(struct optimistic_spin_queue *lock) | |||
| 98 | 98 | ||
| 99 | prev = decode_cpu(old); | 99 | prev = decode_cpu(old); |
| 100 | node->prev = prev; | 100 | node->prev = prev; |
| 101 | ACCESS_ONCE(prev->next) = node; | 101 | WRITE_ONCE(prev->next, node); |
| 102 | 102 | ||
| 103 | /* | 103 | /* |
| 104 | * Normally @prev is untouchable after the above store; because at that | 104 | * Normally @prev is untouchable after the above store; because at that |
| @@ -109,7 +109,7 @@ bool osq_lock(struct optimistic_spin_queue *lock) | |||
| 109 | * cmpxchg in an attempt to undo our queueing. | 109 | * cmpxchg in an attempt to undo our queueing. |
| 110 | */ | 110 | */ |
| 111 | 111 | ||
| 112 | while (!ACCESS_ONCE(node->locked)) { | 112 | while (!READ_ONCE(node->locked)) { |
| 113 | /* | 113 | /* |
| 114 | * If we need to reschedule bail... so we can block. | 114 | * If we need to reschedule bail... so we can block. |
| 115 | */ | 115 | */ |
| @@ -148,7 +148,7 @@ unqueue: | |||
| 148 | * Or we race against a concurrent unqueue()'s step-B, in which | 148 | * Or we race against a concurrent unqueue()'s step-B, in which |
| 149 | * case its step-C will write us a new @node->prev pointer. | 149 | * case its step-C will write us a new @node->prev pointer. |
| 150 | */ | 150 | */ |
| 151 | prev = ACCESS_ONCE(node->prev); | 151 | prev = READ_ONCE(node->prev); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | /* | 154 | /* |
| @@ -170,8 +170,8 @@ unqueue: | |||
| 170 | * it will wait in Step-A. | 170 | * it will wait in Step-A. |
| 171 | */ | 171 | */ |
| 172 | 172 | ||
| 173 | ACCESS_ONCE(next->prev) = prev; | 173 | WRITE_ONCE(next->prev, prev); |
| 174 | ACCESS_ONCE(prev->next) = next; | 174 | WRITE_ONCE(prev->next, next); |
| 175 | 175 | ||
| 176 | return false; | 176 | return false; |
| 177 | } | 177 | } |
| @@ -193,11 +193,11 @@ void osq_unlock(struct optimistic_spin_queue *lock) | |||
| 193 | node = this_cpu_ptr(&osq_node); | 193 | node = this_cpu_ptr(&osq_node); |
| 194 | next = xchg(&node->next, NULL); | 194 | next = xchg(&node->next, NULL); |
| 195 | if (next) { | 195 | if (next) { |
| 196 | ACCESS_ONCE(next->locked) = 1; | 196 | WRITE_ONCE(next->locked, 1); |
| 197 | return; | 197 | return; |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | next = osq_wait_next(lock, node, NULL); | 200 | next = osq_wait_next(lock, node, NULL); |
| 201 | if (next) | 201 | if (next) |
| 202 | ACCESS_ONCE(next->locked) = 1; | 202 | WRITE_ONCE(next->locked, 1); |
| 203 | } | 203 | } |
