<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">

Sometimes a big sysrq-T trace can show lots of tasks in ' R ' state, and it
is hard to tell which one is actually stuck, spinning in-kernel.

On uniprocessor show_task() will say "current", but that soesn't work on SMP.

So add a new column `has_cpu' which tells you that this task is one which is
currently occupying a CPU.


 kernel/sched.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN kernel/sched.c~show_task-on-runqueue kernel/sched.c
--- 25/kernel/sched.c~show_task-on-runqueue	2003-10-02 01:51:40.000000000 -0700
+++ 25-akpm/kernel/sched.c	2003-10-02 01:51:40.000000000 -0700
@@ -2467,6 +2467,8 @@ static void show_task(task_t * p)
 	else
 		printk(" %016lx ", thread_saved_pc(p));
 #endif
+	if (p-&gt;array)
+		printk("has_cpu ");
 	printk("%5d %6d ", p-&gt;pid, p-&gt;parent-&gt;pid);
 	if ((relative = eldest_child(p)))
 		printk("%5d ", relative-&gt;pid);

_
</pre></body></html>