mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched: clarify ptrace's effect on task_struct->parent
@ 2026-09-10  4:17 Ziran Zhang
  2026-09-10 12:54 ` Oleg Nesterov
  2026-09-10 13:30 ` [PATCH v2] " Ziran Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Ziran Zhang @ 2026-09-10  4:17 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Oleg Nesterov, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, K Prateek Nayak, linux-kernel,
	Ziran Zhang

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.

Signed-off-by: Ziran Zhang <zhangcoder@yeah.net>
---
 include/linux/sched.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 705970d07..977859a63 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1093,7 +1093,11 @@ struct task_struct {
 	/* Real parent process: */
 	struct task_struct __rcu	*real_parent;
 
-	/* Recipient of SIGCHLD, wait4() reports: */
+	/*
+	 * Recipient of SIGCHLD, wait4() reports. Normally the same as
+	 * real_parent, but temporarily replaced by the tracer while the
+	 * task is ptraced.
+	 */
 	struct task_struct __rcu	*parent;
 
 	/*
-- 
2.51.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-10 13:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-10  4:17 [PATCH] sched: clarify ptrace's effect on task_struct->parent Ziran Zhang
2026-09-10 12:54 ` Oleg Nesterov
2026-09-10 13:16   ` Ziran Zhang
2026-09-10 13:30 ` [PATCH v2] " Ziran Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®