Skip to content

Commit

Permalink
locking/spinlock: Update spin_unlock_wait() users
Browse files Browse the repository at this point in the history
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) <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jun 14, 2016
1 parent 726328d commit be3e784
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ static void sem_wait_array(struct sem_array *sma)
sem = sma->sem_base + i;
spin_unlock_wait(&sem->lock);
}
smp_acquire__after_ctrl_dep();
}

/*
Expand Down
8 changes: 6 additions & 2 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,14 @@ void do_exit(long code)

exit_signals(tsk); /* sets PF_EXITING */
/*
* tsk->flags are checked in the futex code to protect against
* an exiting task cleaning up the robust pi futexes.
* Ensure that all new tsk->pi_lock acquisitions must observe
* PF_EXITING. Serializes against futex.c:attach_to_pi_owner().
*/
smp_mb();
/*
* Ensure that we must observe the pi_state in exit_mm() ->
* mm_release() -> exit_pi_state_list().
*/
raw_spin_unlock_wait(&tsk->pi_lock);

if (unlikely(in_atomic())) {
Expand Down
1 change: 0 additions & 1 deletion kernel/task_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ void task_work_run(void)
* fail, but it can play with *work and other entries.
*/
raw_spin_unlock_wait(&task->pi_lock);
smp_mb();

do {
next = work->next;
Expand Down

0 comments on commit be3e784

Please sign in to comment.