Skip to content

Commit

Permalink
ipc: Replace spin_unlock_wait() with lock/unlock pair
Browse files Browse the repository at this point in the history
There is no agreed-upon definition of spin_unlock_wait()'s semantics,
and it appears that all callers could do just as well with a lock/unlock
pair.  This commit therefore replaces the spin_unlock_wait() call in
exit_sem() with spin_lock() followed immediately by spin_unlock().
This should be safe from a performance perspective because exit_sem()
is rarely invoked in production.

Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Alan Stern <[email protected]>
Cc: Andrea Parri <[email protected]>
Cc: Linus Torvalds <[email protected]>
Acked-by: Manfred Spraul <[email protected]>
  • Loading branch information
paulmck committed Aug 17, 2017
1 parent 8083f29 commit e0892e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,8 @@ void exit_sem(struct task_struct *tsk)
* possibility where we exit while freeary() didn't
* finish unlocking sem_undo_list.
*/
spin_unlock_wait(&ulp->lock);
spin_lock(&ulp->lock);
spin_unlock(&ulp->lock);
rcu_read_unlock();
break;
}
Expand Down

0 comments on commit e0892e0

Please sign in to comment.