Commit 19a4fcb531659f2f7d18b5d04cee039176e9540d

Authored by Oleg Nesterov
Committed by Linus Torvalds
1 parent 932aeafbe8

[PATCH] kill sigqueue->lock

This lock is used in sigqueue_free(), but it is always equal to
current->sighand->siglock, so we don't need to keep it in the struct
sigqueue.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 4 additions and 7 deletions Side-by-side Diff

include/linux/signal.h
... ... @@ -25,7 +25,6 @@
25 25  
26 26 struct sigqueue {
27 27 struct list_head list;
28   - spinlock_t *lock;
29 28 int flags;
30 29 siginfo_t info;
31 30 struct user_struct *user;
... ... @@ -277,7 +277,6 @@
277 277 } else {
278 278 INIT_LIST_HEAD(&q->list);
279 279 q->flags = 0;
280   - q->lock = NULL;
281 280 q->user = get_uid(t->user);
282 281 }
283 282 return(q);
284 283  
... ... @@ -1371,11 +1370,12 @@
1371 1370 * pending queue.
1372 1371 */
1373 1372 if (unlikely(!list_empty(&q->list))) {
1374   - read_lock(&tasklist_lock);
1375   - spin_lock_irqsave(q->lock, flags);
  1373 + spinlock_t *lock = &current->sighand->siglock;
  1374 + read_lock(&tasklist_lock);
  1375 + spin_lock_irqsave(lock, flags);
1376 1376 if (!list_empty(&q->list))
1377 1377 list_del_init(&q->list);
1378   - spin_unlock_irqrestore(q->lock, flags);
  1378 + spin_unlock_irqrestore(lock, flags);
1379 1379 read_unlock(&tasklist_lock);
1380 1380 }
1381 1381 q->flags &= ~SIGQUEUE_PREALLOC;
... ... @@ -1414,7 +1414,6 @@
1414 1414 goto out;
1415 1415 }
1416 1416  
1417   - q->lock = &p->sighand->siglock;
1418 1417 list_add_tail(&q->list, &p->pending.list);
1419 1418 sigaddset(&p->pending.signal, sig);
1420 1419 if (!sigismember(&p->blocked, sig))
... ... @@ -1462,7 +1461,6 @@
1462 1461 * We always use the shared queue for process-wide signals,
1463 1462 * to avoid several races.
1464 1463 */
1465   - q->lock = &p->sighand->siglock;
1466 1464 list_add_tail(&q->list, &p->signal->shared_pending.list);
1467 1465 sigaddset(&p->signal->shared_pending.signal, sig);
1468 1466