From: Oleg Nesterov <oleg@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>, Ratan Nalumasu <rnalumasu@gmail.com>,
Vitaly Mayatskikh <vmayatsk@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC,PATCH 2/2] change __wake_up_parent() to use filtered wakeup
Date: Wed, 24 Jun 2009 19:13:57 +0200 [thread overview]
Message-ID: <20090624171357.GA30435@redhat.com> (raw)
In-Reply-To: <20090624194239.A29174059B@magilla.sf.frob.com>
On 06/24, Roland McGrath wrote:
>
> do_notify_parent_cldstop:
>
> if (task_ptrace(tsk))
> parent = tsk->parent;
> else {
> tsk = tsk->group_leader;
> parent = tsk->real_parent;
> }
> ...
> __wake_up_parent(tsk, parent);
>
> In the "else" case, parent is not necessarily tsk->parent. That is, if
> an untraced thread calls do_notify_parent_cldstop() but its group_leader
> is ptrace_reparented(). Then waitee->group_leader->real_parent is who
> gets the wakeup, but __wake_up_parent->child_wait_wakeup would check
> only waiter == waitee->group_leader->parent.
... and in this case we do not wake up ->group_leader->real_parent.
But this is fine? It doesn't make sense to wake up, wait_consider_task()
will notice task_ptrace() and do nothing?
I really need to think with a fresh head, but it seems to me we could add
BUG_ON(p->parent != parent) into wait_consider_task() after "if (ptrace...)"
check.
And this "proves" your check in child_wait_callback() is correct, with
__WNOTHREAD do_wait_thread(parent) is always called with parent ==
sleeper, the caller of do_wait().
No?
Btw, this reminds me that wait_consider_task() doesn't need the "parent"
argument. I noticed this after adding wait_opts, but forgot to send a
patch.
Oleg.
next prev parent reply other threads:[~2009-06-24 20:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-22 17:04 [RFC,PATCH 2/2] change __wake_up_parent() to use filtered wakeup Oleg Nesterov
2009-06-24 9:13 ` Roland McGrath
2009-06-24 15:21 ` Oleg Nesterov
2009-06-24 18:57 ` Roland McGrath
2009-06-24 16:11 ` Oleg Nesterov
2009-06-24 19:42 ` Roland McGrath
2009-06-24 17:13 ` Oleg Nesterov [this message]
2009-06-24 20:51 ` Roland McGrath
[not found] ` <93ad5f3f0906252111n48742b9ax8dc2ad35b30f4292@mail.gmail.com>
2009-06-29 3:38 ` Oleg Nesterov
2009-06-29 23:08 ` [rfc] do not place sub-threads on task_struct->children list Oleg Nesterov
2009-06-30 19:30 ` Roland McGrath
2009-07-01 5:40 ` Oleg Nesterov
2009-06-30 19:22 ` [RFC,PATCH 2/2] change __wake_up_parent() to use filtered wakeup 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=20090624171357.GA30435@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rnalumasu@gmail.com \
--cc=roland@redhat.com \
--cc=vmayatsk@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.