Re: [PATCH v2] sched: clarify ptrace's effect on task_struct->parent

From: Oleg Nesterov

Date: Mon Nov 23 2026 - 11:23:36 EST


On 11/23, Ziran Zhang wrote:
>
> > The current comment for the parent field does not explain that it can be
> > temporarily replaced by the tracer when the task is being ptraced.
> >
> > This can lead to confusion, so clarify the comment to document this
> > important behavior.
> >
> > No functional change.
> >
> > Suggested-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> > Signed-off-by: Ziran Zhang <zhangcoder@xxxxxxxx>
> > ---
> > Changes in v2:
> > - Use Oleg's minimal wording suggestion to adjust comment.
> >
> > include/linux/sched.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/sched.h b/include/linux/sched.h
> > index 705970d07..8aad8a8ef 100644
> > --- a/include/linux/sched.h
> > +++ b/include/linux/sched.h
> > @@ -1093,7 +1093,7 @@ struct task_struct {
> > /* Real parent process: */
> > struct task_struct __rcu *real_parent;
> >
> > - /* Recipient of SIGCHLD, wait4() reports: */
> > + /* Recipient of SIGCHLD, wait4() reports: ->real_parent or ptracer */
> > struct task_struct __rcu *parent;
> >
> > /*
> > --
> > 2.51.0
>
> Ping on this v2 patch. Suggested-by ptrace maintainer since September.

Well, I only suggested to simplify the comment you proposed in V1 ;)
So please remove the Suggested-by tag, feel free to add

Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>