diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2015-05-12 04:51:55 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 02:32:00 -0400 |
| commit | b92b8b35a2e38bde319fd1d68ec84628c1f1b0fb (patch) | |
| tree | 45aea6d12a580b60848363c10dc355f3307ec1ff /kernel | |
| parent | ab3f02fc237211f0583c1e7ba3bf504747be9b8d (diff) | |
locking/arch: Rename set_mb() to smp_store_mb()
Since set_mb() is really about an smp_mb() -- not a IO/DMA barrier
like mb() rename it to match the recent smp_load_acquire() and
smp_store_release().
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/futex.c | 2 | ||||
| -rw-r--r-- | kernel/locking/qspinlock_paravirt.h | 2 | ||||
| -rw-r--r-- | kernel/sched/wait.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 2579e407ff67..55ca63ad9622 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
| @@ -2055,7 +2055,7 @@ static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q, | |||
| 2055 | { | 2055 | { |
| 2056 | /* | 2056 | /* |
| 2057 | * The task state is guaranteed to be set before another task can | 2057 | * The task state is guaranteed to be set before another task can |
| 2058 | * wake it. set_current_state() is implemented using set_mb() and | 2058 | * wake it. set_current_state() is implemented using smp_store_mb() and |
| 2059 | * queue_me() calls spin_unlock() upon completion, both serializing | 2059 | * queue_me() calls spin_unlock() upon completion, both serializing |
| 2060 | * access to the hash list and forcing another memory barrier. | 2060 | * access to the hash list and forcing another memory barrier. |
| 2061 | */ | 2061 | */ |
diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h index 27ab96dca68c..04ab18151cc8 100644 --- a/kernel/locking/qspinlock_paravirt.h +++ b/kernel/locking/qspinlock_paravirt.h | |||
| @@ -175,7 +175,7 @@ static void pv_wait_node(struct mcs_spinlock *node) | |||
| 175 | * | 175 | * |
| 176 | * Matches the xchg() from pv_kick_node(). | 176 | * Matches the xchg() from pv_kick_node(). |
| 177 | */ | 177 | */ |
| 178 | set_mb(pn->state, vcpu_halted); | 178 | smp_store_mb(pn->state, vcpu_halted); |
| 179 | 179 | ||
| 180 | if (!READ_ONCE(node->locked)) | 180 | if (!READ_ONCE(node->locked)) |
| 181 | pv_wait(&pn->state, vcpu_halted); | 181 | pv_wait(&pn->state, vcpu_halted); |
diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 852143a79f36..9bc82329eaad 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c | |||
| @@ -341,7 +341,7 @@ long wait_woken(wait_queue_t *wait, unsigned mode, long timeout) | |||
| 341 | * condition being true _OR_ WQ_FLAG_WOKEN such that we will not miss | 341 | * condition being true _OR_ WQ_FLAG_WOKEN such that we will not miss |
| 342 | * an event. | 342 | * an event. |
| 343 | */ | 343 | */ |
| 344 | set_mb(wait->flags, wait->flags & ~WQ_FLAG_WOKEN); /* B */ | 344 | smp_store_mb(wait->flags, wait->flags & ~WQ_FLAG_WOKEN); /* B */ |
| 345 | 345 | ||
| 346 | return timeout; | 346 | return timeout; |
| 347 | } | 347 | } |
| @@ -354,7 +354,7 @@ int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key) | |||
| 354 | * doesn't imply write barrier and the users expects write | 354 | * doesn't imply write barrier and the users expects write |
| 355 | * barrier semantics on wakeup functions. The following | 355 | * barrier semantics on wakeup functions. The following |
| 356 | * smp_wmb() is equivalent to smp_wmb() in try_to_wake_up() | 356 | * smp_wmb() is equivalent to smp_wmb() in try_to_wake_up() |
| 357 | * and is paired with set_mb() in wait_woken(). | 357 | * and is paired with smp_store_mb() in wait_woken(). |
| 358 | */ | 358 | */ |
| 359 | smp_wmb(); /* C */ | 359 | smp_wmb(); /* C */ |
| 360 | wait->flags |= WQ_FLAG_WOKEN; | 360 | wait->flags |= WQ_FLAG_WOKEN; |
