public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ia64: ptrace_attach_sync_user_rbs: use ->sighand instead of ->signal to check the task is alive
@ 2009-02-03 23:17 Oleg Nesterov
  2009-02-05  3:15 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2009-02-03 23:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Ingo Molnar, Lin Ming, Peter Zijlstra, Roland McGrath,
	Zhang, Yanmin, linux-kernel

No functional changes.

It doesn't matter which pointer to check under tasklist to ensure the task
was not released, ->signal or ->sighand. But we are going to make ->signal
refcountable, change the code to use ->sighand.

Actually, this code doesn't need tasklist_lock and this check at all, it
should be converted to use lock_task_sighand().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>

--- 6.29-rc3/arch/ia64/kernel/ptrace.c~1_IA64_PTRACE	2008-12-02 17:12:35.000000000 +0100
+++ 6.29-rc3/arch/ia64/kernel/ptrace.c	2009-02-03 23:55:41.000000000 +0100
@@ -640,7 +640,7 @@ ptrace_attach_sync_user_rbs (struct task
 	 */
 
 	read_lock(&tasklist_lock);
-	if (child->signal) {
+	if (child->sighand) {
 		spin_lock_irq(&child->sighand->siglock);
 		if (child->state == TASK_STOPPED &&
 		    !test_and_set_tsk_thread_flag(child, TIF_RESTORE_RSE)) {
@@ -664,7 +664,7 @@ ptrace_attach_sync_user_rbs (struct task
 	 * job control stop, so that SIGCONT can be used to wake it up.
 	 */
 	read_lock(&tasklist_lock);
-	if (child->signal) {
+	if (child->sighand) {
 		spin_lock_irq(&child->sighand->siglock);
 		if (child->state == TASK_TRACED &&
 		    (child->signal->flags & SIGNAL_STOP_STOPPED)) {


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

* Re: [PATCH 1/2] ia64: ptrace_attach_sync_user_rbs: use ->sighand instead of ->signal to check the task is alive
  2009-02-03 23:17 [PATCH 1/2] ia64: ptrace_attach_sync_user_rbs: use ->sighand instead of ->signal to check the task is alive Oleg Nesterov
@ 2009-02-05  3:15 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2009-02-05  3:15 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: Andrew Morton, Ingo Molnar, Lin Ming, Peter Zijlstra,
	Zhang, Yanmin, linux-kernel

> Actually, this code doesn't need tasklist_lock and this check at all, it
> should be converted to use lock_task_sighand().

Might as well just do that, it's a harmless enough change.  For other
trivial no-op cleanup while you are there, task_is_stopped() and
task_is_traced() are the norm now.


Thanks,
Roland

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

end of thread, other threads:[~2009-02-05  3:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 23:17 [PATCH 1/2] ia64: ptrace_attach_sync_user_rbs: use ->sighand instead of ->signal to check the task is alive Oleg Nesterov
2009-02-05  3:15 ` Roland McGrath

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