* [PATCH 1/1] ptrace: wait_task_zombie: s/->parent/->real_parent/
@ 2009-05-25 20:21 Oleg Nesterov
2009-05-26 20:23 ` Roland McGrath
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2009-05-25 20:21 UTC (permalink / raw)
To: Andrew Morton
Cc: Christoph Hellwig, Ingo Molnar, Roland McGrath, linux-kernel
Change wait_task_zombie() to use ->real_parent instead of ->parent.
We could even use current afaics, but ->real_parent is more clean.
We know that the child is not ptrace_reparented() and thus they are
equal. But we should avoid using task_struct->parent, we are going
to remove it.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
--- PTRACE/kernel/exit.c~WAIT_NO_PARENT 2009-05-25 20:24:50.000000000 +0200
+++ PTRACE/kernel/exit.c 2009-05-25 21:47:24.000000000 +0200
@@ -1210,7 +1210,7 @@ static int wait_task_zombie(struct wait_
* p->signal fields, because they are only touched by
* __exit_signal, which runs with tasklist_lock
* write-locked anyway, and so is excluded here. We do
- * need to protect the access to p->parent->signal fields,
+ * need to protect the access to parent->signal fields,
* as other threads in the parent group can be right
* here reaping other children at the same time.
*
@@ -1219,8 +1219,8 @@ static int wait_task_zombie(struct wait_
* group including the group leader.
*/
thread_group_cputime(p, &cputime);
- spin_lock_irq(&p->parent->sighand->siglock);
- psig = p->parent->signal;
+ spin_lock_irq(&p->real_parent->sighand->siglock);
+ psig = p->real_parent->signal;
sig = p->signal;
psig->cutime =
cputime_add(psig->cutime,
@@ -1251,7 +1251,7 @@ static int wait_task_zombie(struct wait_
sig->oublock + sig->coublock;
task_io_accounting_add(&psig->ioac, &p->ioac);
task_io_accounting_add(&psig->ioac, &sig->ioac);
- spin_unlock_irq(&p->parent->sighand->siglock);
+ spin_unlock_irq(&p->real_parent->sighand->siglock);
}
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] ptrace: wait_task_zombie: s/->parent/->real_parent/
2009-05-25 20:21 [PATCH 1/1] ptrace: wait_task_zombie: s/->parent/->real_parent/ Oleg Nesterov
@ 2009-05-26 20:23 ` Roland McGrath
0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2009-05-26 20:23 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, Christoph Hellwig, Ingo Molnar, linux-kernel
> Change wait_task_zombie() to use ->real_parent instead of ->parent.
Acked-by: Roland McGrath <roland@redhat.com>
> We could even use current afaics, but ->real_parent is more clean.
Indeed, though the caller might not be ->real_parent, it will always be
one that shares ->signal with ->real_parent. But I agree that using
->real_parent is the clean way. Incidentally, as readability cleanup it
would make a lot of sense to move that block into a subroutine.
Thanks,
Roland
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-26 20:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-25 20:21 [PATCH 1/1] ptrace: wait_task_zombie: s/->parent/->real_parent/ Oleg Nesterov
2009-05-26 20:23 ` Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox