public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC,PATCH 2/2] kill_pid_info: don't take now unneeded tasklist_lock
@ 2008-03-04 18:57 Oleg Nesterov
  2008-03-06 10:56 ` Roland McGrath
  2008-03-17 11:30 ` Atsushi Tsuji
  0 siblings, 2 replies; 9+ messages in thread
From: Oleg Nesterov @ 2008-03-04 18:57 UTC (permalink / raw)
  To: Andrew Morton, Roland McGrath
  Cc: Eric W. Biederman, Davide Libenzi, Ingo Molnar, Jiri Kosina,
	Linus Torvalds, Pavel Emelyanov, linux-kernel

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>

--- 25/include/linux/signal.h~1__KILL_NO_TASKLIST	2008-02-15 16:59:17.000000000 +0300
+++ 25/include/linux/signal.h	2008-03-04 21:43:25.000000000 +0300
@@ -362,8 +362,6 @@ int unhandled_signal(struct task_struct 
 #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))
--- 25/kernel/signal.c~1__KILL_NO_TASKLIST	2008-03-04 21:24:20.000000000 +0300
+++ 25/kernel/signal.c	2008-03-04 21:44:58.000000000 +0300
@@ -1030,9 +1030,6 @@ int kill_pid_info(int sig, struct siginf
 	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) {
@@ -1046,10 +1043,8 @@ retry:
 			 */
 			goto retry;
 	}
-
-	if (unlikely(sig_needs_tasklist(sig)))
-		read_unlock(&tasklist_lock);
 	rcu_read_unlock();
+
 	return error;
 }
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-03-19 23:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-04 18:57 [RFC,PATCH 2/2] kill_pid_info: don't take now unneeded tasklist_lock Oleg Nesterov
2008-03-06 10:56 ` Roland McGrath
2008-03-17 11:30 ` Atsushi Tsuji
2008-03-17 17:01   ` Oleg Nesterov
2008-03-18 14:44     ` [PATCH] signals: check_kill_permission: check session under tasklist_lock Oleg Nesterov
2008-03-18 20:03       ` serge
2008-03-18 20:17         ` Oleg Nesterov
2008-03-18 23:14           ` serge
2008-03-19  2:19       ` Atsushi Tsuji

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox