kill_pid_info: don't take now unneeded tasklist_lock
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 30 Apr 2008 07:52:45 +0000 (00:52 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Apr 2008 15:29:34 +0000 (08:29 -0700)
Previously handle_stop_signal(SIGCONT) could drop ->siglock.  That is why
kill_pid_info(SIGCONT) takes tasklist_lock to make sure the target task can't
go away after unlock.  Not needed now.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/signal.h
kernel/signal.c

index 42d2e0a948f4866533c7211c031362c8246b542a..84f997f8aa53cfcc8b04ff86bb4b0263f0e7dc1a 100644 (file)
@@ -362,8 +362,6 @@ int unhandled_signal(struct task_struct *tsk, int sig);
 #define sig_kernel_stop(sig) \
        (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_STOP_MASK))
 
-#define sig_needs_tasklist(sig)        ((sig) == SIGCONT)
-
 #define sig_user_defined(t, signr) \
        (((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_DFL) &&  \
         ((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN))
index 115c04f3f143dda03fbd48964b33f1e85f8f85f1..ce53ab19c21d99f1ae37c13d6b66b8ac98cca6c9 100644 (file)
@@ -1039,9 +1039,6 @@ int kill_pid_info(int sig, struct siginfo *info, struct pid *pid)
        struct task_struct *p;
 
        rcu_read_lock();
-       if (unlikely(sig_needs_tasklist(sig)))
-               read_lock(&tasklist_lock);
-
 retry:
        p = pid_task(pid, PIDTYPE_PID);
        if (p) {
@@ -1055,10 +1052,8 @@ retry:
                         */
                        goto retry;
        }
-
-       if (unlikely(sig_needs_tasklist(sig)))
-               read_unlock(&tasklist_lock);
        rcu_read_unlock();
+
        return error;
 }