Re: [PATCH v2] sched: clarify ptrace's effect on task_struct->parent
From: Ziran Zhang
Date: Mon Nov 23 2026 - 06:14:17 EST
> 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.
Sorry for the noise.
Link: https://lore.kernel.org/all/20260910133027.8453-1-zhangcoder@xxxxxxxx/
Thanks,
Ziran Zhang