From: Oleg Nesterov <oleg@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org
Subject: [RFC PATCH 00/12 v3] ptrace: introduce task_struct->ptrace_cxt
Date: Sun, 31 May 2009 00:38:20 +0200 [thread overview]
Message-ID: <20090530223820.GA30474@redhat.com> (raw)
Changes:
04/12: move kfree() outside of task_lock() in alloc_ptrace_context().
But I misread your sugesstion:
> task_lock(tsk);
> if (likely(!tsk->ptrace_ctx)) {
> tsk->ptrace_ctx = ptrace_ctx;
> task_unlock(tsk);
> return 0;
> }
>
> task_unlock(tsk);
> kfree(ptrace_ctx);
Just can't do that. I hate multiple unlocks very much. So it
becomes:
task_lock(tsk);
if (likely(!tsk->ptrace_ctx)) {
tsk->ptrace_ctx = ptrace_ctx;
ptrace_ctx = NULL;
}
task_unlock(tsk);
kfree(ptrace_ctx);
kfree(NULL) is specially allowed.
05/12: Add the comment about tracehook_init_task to ptrace_init_task().
I didn't change the original comment, but imho it is confusing.
"immediately after adding @child to its parent's children list"
does not matter. What does matter, is that it is called before
this child is visible to the user-space and thus the unconditional
ptrace_link() is safe: nobody could attach before us.
08/12: No changes, but I think it better to change format_mca_init_stack()
right now. Imho it has nothing to do with tracehooks and it is the
last user of ->parent (except perhaps there are some in arch/ code
which should be tracehookfied).
09/12: Remove the stale "pt_" from the changelog.
Oleg.
next reply other threads:[~2009-05-30 22:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-30 22:38 Oleg Nesterov [this message]
2009-06-01 0:38 ` [RFC PATCH 00/12 v3] ptrace: introduce task_struct->ptrace_cxt 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=20090530223820.GA30474@redhat.com \
--to=oleg@redhat.com \
--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 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.