diff options
author | Peter Zijlstra <peterz@infradead.org> | 2016-05-24 08:45:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-06-14 05:55:15 -0400 |
commit | be3e7844980352756de4261b276ee2ba5be7a26b (patch) | |
tree | 977f32f488649a6c77dcec9190d36fddc3df6b69 | |
parent | 726328d92a42b6d4b76078e2659f43067f82c4e8 (diff) |
locking/spinlock: Update spin_unlock_wait() users
With the modified semantics of spin_unlock_wait() a number of
explicit barriers can be removed. Also update the comment for the
do_exit() usecase, as that was somewhat stale/obscure.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
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>
-rw-r--r-- | ipc/sem.c | 1 | ||||
-rw-r--r-- | kernel/exit.c | 8 | ||||
-rw-r--r-- | kernel/task_work.c | 1 |
3 files changed, 6 insertions, 4 deletions
@@ -282,7 +282,6 @@ static void sem_wait_array(struct sem_array *sma) | |||
282 | sem = sma->sem_base + i; | 282 | sem = sma->sem_base + i; |
283 | spin_unlock_wait(&sem->lock); | 283 | spin_unlock_wait(&sem->lock); |
284 | } | 284 | } |
285 | smp_acquire__after_ctrl_dep(); | ||
286 | } | 285 | } |
287 | 286 | ||
288 | /* | 287 | /* |
diff --git a/kernel/exit.c b/kernel/exit.c index 9e6e1356e6bb..0b40791b9e70 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -700,10 +700,14 @@ void do_exit(long code) | |||
700 | 700 | ||
701 | exit_signals(tsk); /* sets PF_EXITING */ | 701 | exit_signals(tsk); /* sets PF_EXITING */ |
702 | /* | 702 | /* |
703 | * tsk->flags are checked in the futex code to protect against | 703 | * Ensure that all new tsk->pi_lock acquisitions must observe |
704 | * an exiting task cleaning up the robust pi futexes. | 704 | * PF_EXITING. Serializes against futex.c:attach_to_pi_owner(). |
705 | */ | 705 | */ |
706 | smp_mb(); | 706 | smp_mb(); |
707 | /* | ||
708 | * Ensure that we must observe the pi_state in exit_mm() -> | ||
709 | * mm_release() -> exit_pi_state_list(). | ||
710 | */ | ||
707 | raw_spin_unlock_wait(&tsk->pi_lock); | 711 | raw_spin_unlock_wait(&tsk->pi_lock); |
708 | 712 | ||
709 | if (unlikely(in_atomic())) { | 713 | if (unlikely(in_atomic())) { |
diff --git a/kernel/task_work.c b/kernel/task_work.c index 53fa971d000d..6ab4842b00e8 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c | |||
@@ -108,7 +108,6 @@ void task_work_run(void) | |||
108 | * fail, but it can play with *work and other entries. | 108 | * fail, but it can play with *work and other entries. |
109 | */ | 109 | */ |
110 | raw_spin_unlock_wait(&task->pi_lock); | 110 | raw_spin_unlock_wait(&task->pi_lock); |
111 | smp_mb(); | ||
112 | 111 | ||
113 | do { | 112 | do { |
114 | next = work->next; | 113 | next = work->next; |