projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
602b859
)
ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem()
author
Herton R. Krzesinski
<
[email protected]
>
Fri, 14 Aug 2015 22:35:05 +0000
(15:35 -0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 14 Aug 2015 22:56:32 +0000
(15:56 -0700)
After we acquire the sma->sem_perm lock in exit_sem(), we are protected
against a racing IPC_RMID operation. Also at that point, we are the last
user of sem_undo_list. Therefore it isn't required that we acquire or use
ulp->lock.
Signed-off-by: Herton R. Krzesinski <
[email protected]
>
Acked-by: Manfred Spraul <
[email protected]
>
Cc: Davidlohr Bueso <
[email protected]
>
Cc: Rafael Aquini <
[email protected]
>
CC: Aristeu Rozanski <
[email protected]
>
Cc: David Jeffery <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
ipc/sem.c
patch
|
blob
|
history
diff --git
a/ipc/sem.c
b/ipc/sem.c
index a37aaeb02561bf541e6b0ca28a8f6a42dacf4f89..178f303deea51ecb8a93b4a9352793bb6ae4aafc 100644
(file)
--- a/
ipc/sem.c
+++ b/
ipc/sem.c
@@
-2123,9
+2123,11
@@
void exit_sem(struct task_struct *tsk)
ipc_assert_locked_object(&sma->sem_perm);
list_del(&un->list_id);
- spin_lock(&ulp->lock);
+ /* we are the last process using this ulp, acquiring ulp->lock
+ * isn't required. Besides that, we are also protected against
+ * IPC_RMID as we hold sma->sem_perm lock now
+ */
list_del_rcu(&un->list_proc);
- spin_unlock(&ulp->lock);
/* perform adjustments registered in un */
for (i = 0; i < sma->sem_nsems; i++) {