aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2007-02-10 04:44:56 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:26 -0500
commit0c12b51712ced2c0d89a8ec3d546ed810f86d33e (patch)
tree6d9baefd3148da87686ee259f51c35853377db1a /kernel/signal.c
parentb963a8441cb95999c97bea379607071a869c65f0 (diff)
[PATCH] kill_pid_info: kill acquired_tasklist_lock
Kill acquired_tasklist_lock, sig_needs_tasklist() is very cheap nowadays. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 5630255d2e2a..ea4632bd40a0 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1119,19 +1119,18 @@ kill_pg_info(int sig, struct siginfo *info, pid_t pgrp)
1119int kill_pid_info(int sig, struct siginfo *info, struct pid *pid) 1119int kill_pid_info(int sig, struct siginfo *info, struct pid *pid)
1120{ 1120{
1121 int error; 1121 int error;
1122 int acquired_tasklist_lock = 0;
1123 struct task_struct *p; 1122 struct task_struct *p;
1124 1123
1125 rcu_read_lock(); 1124 rcu_read_lock();
1126 if (unlikely(sig_needs_tasklist(sig))) { 1125 if (unlikely(sig_needs_tasklist(sig)))
1127 read_lock(&tasklist_lock); 1126 read_lock(&tasklist_lock);
1128 acquired_tasklist_lock = 1; 1127
1129 }
1130 p = pid_task(pid, PIDTYPE_PID); 1128 p = pid_task(pid, PIDTYPE_PID);
1131 error = -ESRCH; 1129 error = -ESRCH;
1132 if (p) 1130 if (p)
1133 error = group_send_sig_info(sig, info, p); 1131 error = group_send_sig_info(sig, info, p);
1134 if (unlikely(acquired_tasklist_lock)) 1132
1133 if (unlikely(sig_needs_tasklist(sig)))
1135 read_unlock(&tasklist_lock); 1134 read_unlock(&tasklist_lock);
1136 rcu_read_unlock(); 1135 rcu_read_unlock();
1137 return error; 1136 return error;