mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/debug: Print tgid in sched_show_task()
@ 2023-07-20  8:05 Yajun Deng
  2023-10-05  8:59 ` [tip: sched/core] sched/debug: Print 'tgid' " tip-bot2 for Yajun Deng
  2023-10-07 17:10 ` tip-bot2 for Yajun Deng
  0 siblings, 2 replies; 3+ messages in thread
From: Yajun Deng @ 2023-07-20  8:05 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid
  Cc: linux-kernel, Yajun Deng

Multiple blocked tasks are printed when the system hangs. They may have
the same parent pid, but belong to different task groups.

Printing tgid lets users better know whether these tasks are from the same
task group or not.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 kernel/sched/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9020d34b22fe..80feede4e7c3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -9187,9 +9187,9 @@ void sched_show_task(struct task_struct *p)
 	if (pid_alive(p))
 		ppid = task_pid_nr(rcu_dereference(p->real_parent));
 	rcu_read_unlock();
-	pr_cont(" stack:%-5lu pid:%-5d ppid:%-6d flags:0x%08lx\n",
-		free, task_pid_nr(p), ppid,
-		read_task_thread_flags(p));
+	pr_cont(" stack:%-5lu pid:%-5d tgid:%-5d ppid:%-6d flags:0x%08lx\n",
+		free, task_pid_nr(p), task_tgid_nr(p),
+		ppid, read_task_thread_flags(p));
 
 	print_worker_info(KERN_INFO, p);
 	print_stop_info(KERN_INFO, p);
-- 
2.25.1


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

* [tip: sched/core] sched/debug: Print 'tgid' in sched_show_task()
  2023-07-20  8:05 [PATCH] sched/debug: Print tgid in sched_show_task() Yajun Deng
@ 2023-10-05  8:59 ` tip-bot2 for Yajun Deng
  2023-10-07 17:10 ` tip-bot2 for Yajun Deng
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Yajun Deng @ 2023-10-05  8:59 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Yajun Deng, Ingo Molnar, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     9b46f1abc6d4e855ebd91b011aa3b49042bad7e4
Gitweb:        https://git.kernel.org/tip/9b46f1abc6d4e855ebd91b011aa3b49042bad7e4
Author:        Yajun Deng <yajun.deng@linux.dev>
AuthorDate:    Thu, 20 Jul 2023 16:05:16 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Thu, 05 Oct 2023 10:49:56 +02:00

sched/debug: Print 'tgid' in sched_show_task()

Multiple blocked tasks are printed when the system hangs. They may have
the same parent pid, but belong to different task groups.

Printing tgid lets users better know whether these tasks are from the same
task group or not.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230720080516.1515297-1-yajun.deng@linux.dev
---
 kernel/sched/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f5783cb..cf6d3fd 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -9089,9 +9089,9 @@ void sched_show_task(struct task_struct *p)
 	if (pid_alive(p))
 		ppid = task_pid_nr(rcu_dereference(p->real_parent));
 	rcu_read_unlock();
-	pr_cont(" stack:%-5lu pid:%-5d ppid:%-6d flags:0x%08lx\n",
-		free, task_pid_nr(p), ppid,
-		read_task_thread_flags(p));
+	pr_cont(" stack:%-5lu pid:%-5d tgid:%-5d ppid:%-6d flags:0x%08lx\n",
+		free, task_pid_nr(p), task_tgid_nr(p),
+		ppid, read_task_thread_flags(p));
 
 	print_worker_info(KERN_INFO, p);
 	print_stop_info(KERN_INFO, p);

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

* [tip: sched/core] sched/debug: Print 'tgid' in sched_show_task()
  2023-07-20  8:05 [PATCH] sched/debug: Print tgid in sched_show_task() Yajun Deng
  2023-10-05  8:59 ` [tip: sched/core] sched/debug: Print 'tgid' " tip-bot2 for Yajun Deng
@ 2023-10-07 17:10 ` tip-bot2 for Yajun Deng
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Yajun Deng @ 2023-10-07 17:10 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Yajun Deng, Ingo Molnar, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     bc87127a45928de5fdf0ec39d7a86e1edd0e179e
Gitweb:        https://git.kernel.org/tip/bc87127a45928de5fdf0ec39d7a86e1edd0e179e
Author:        Yajun Deng <yajun.deng@linux.dev>
AuthorDate:    Thu, 20 Jul 2023 16:05:16 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Sat, 07 Oct 2023 11:33:28 +02:00

sched/debug: Print 'tgid' in sched_show_task()

Multiple blocked tasks are printed when the system hangs. They may have
the same parent pid, but belong to different task groups.

Printing tgid lets users better know whether these tasks are from the same
task group or not.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230720080516.1515297-1-yajun.deng@linux.dev
---
 kernel/sched/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f5783cb..cf6d3fd 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -9089,9 +9089,9 @@ void sched_show_task(struct task_struct *p)
 	if (pid_alive(p))
 		ppid = task_pid_nr(rcu_dereference(p->real_parent));
 	rcu_read_unlock();
-	pr_cont(" stack:%-5lu pid:%-5d ppid:%-6d flags:0x%08lx\n",
-		free, task_pid_nr(p), ppid,
-		read_task_thread_flags(p));
+	pr_cont(" stack:%-5lu pid:%-5d tgid:%-5d ppid:%-6d flags:0x%08lx\n",
+		free, task_pid_nr(p), task_tgid_nr(p),
+		ppid, read_task_thread_flags(p));
 
 	print_worker_info(KERN_INFO, p);
 	print_stop_info(KERN_INFO, p);

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

end of thread, other threads:[~2023-10-07 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20  8:05 [PATCH] sched/debug: Print tgid in sched_show_task() Yajun Deng
2023-10-05  8:59 ` [tip: sched/core] sched/debug: Print 'tgid' " tip-bot2 for Yajun Deng
2023-10-07 17:10 ` tip-bot2 for Yajun Deng

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®