From: Oleg Nesterov <oleg@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Ingo Molnar <mingo@elte.hu>, Roland McGrath <roland@redhat.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] ptrace: wait_task_zombie: s/->parent/->real_parent/
Date: Mon, 25 May 2009 22:21:45 +0200 [thread overview]
Message-ID: <20090525202145.GA25243@redhat.com> (raw)
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);
}
/*
next reply other threads:[~2009-05-25 20:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 20:21 Oleg Nesterov [this message]
2009-05-26 20:23 ` [PATCH 1/1] ptrace: wait_task_zombie: s/->parent/->real_parent/ Roland McGrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090525202145.GA25243@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox