Commit 6ca25b55 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

kill_pid_info: don't take now unneeded tasklist_lock

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: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e4420551
...@@ -362,8 +362,6 @@ int unhandled_signal(struct task_struct *tsk, int sig); ...@@ -362,8 +362,6 @@ int unhandled_signal(struct task_struct *tsk, int sig);
#define sig_kernel_stop(sig) \ #define sig_kernel_stop(sig) \
(((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_STOP_MASK)) (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_STOP_MASK))
#define sig_needs_tasklist(sig) ((sig) == SIGCONT)
#define sig_user_defined(t, signr) \ #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_DFL) && \
((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN)) ((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN))
......
...@@ -1039,9 +1039,6 @@ int kill_pid_info(int sig, struct siginfo *info, struct pid *pid) ...@@ -1039,9 +1039,6 @@ int kill_pid_info(int sig, struct siginfo *info, struct pid *pid)
struct task_struct *p; struct task_struct *p;
rcu_read_lock(); rcu_read_lock();
if (unlikely(sig_needs_tasklist(sig)))
read_lock(&tasklist_lock);
retry: retry:
p = pid_task(pid, PIDTYPE_PID); p = pid_task(pid, PIDTYPE_PID);
if (p) { if (p) {
...@@ -1055,10 +1052,8 @@ retry: ...@@ -1055,10 +1052,8 @@ retry:
*/ */
goto retry; goto retry;
} }
if (unlikely(sig_needs_tasklist(sig)))
read_unlock(&tasklist_lock);
rcu_read_unlock(); rcu_read_unlock();
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment