mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* PATCH: fix task state reporting
@ 2002-10-17 20:38 Russell King
  2002-10-17 21:02 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Russell King @ 2002-10-17 20:38 UTC (permalink / raw)
  To: Linux Kernel List, Linus Torvalds

Hi,

While running a test here, I noticed that some threads kept entering
"T" state according to ps aux.  However, rather than stop, they'd
disappear on the next process listing, as though they weren't stopped.

Further investigation revealed the following when suspending processes:

root      1497  3.8  1.7  1472  544 ttyp1    Z    00:05   0:21 find / -name pro

Yes, 'Z' for suspended, 'T' for zombie.  Something smells fishy here.

#define TASK_RUNNING		0
#define TASK_INTERRUPTIBLE	1
#define TASK_UNINTERRUPTIBLE	2
#define TASK_STOPPED		4
#define TASK_ZOMBIE		8
#define TASK_DEAD		16

So that's R S D T Z W, but sched.c contains R S D Z T W (Z and T
reversed).  This patch corrects sched.c.  (Should we correct
the order of bits in sched.h instead?)

--- orig/kernel/sched.c	Wed Oct 16 09:17:13 2002
+++ linux/kernel/sched.c	Thu Oct 17 21:32:42 2002
@@ -1798,7 +1798,7 @@
 	unsigned long free = 0;
 	task_t *relative;
 	int state;
-	static const char * stat_nam[] = { "R", "S", "D", "Z", "T", "W" };
+	static const char * stat_nam[] = { "R", "S", "D", "T", "Z", "W" };
 
 	printk("%-13.13s ", p->comm);
 	state = p->state ? __ffs(p->state) + 1 : 0;

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


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

end of thread, other threads:[~2002-10-17 20:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-17 20:38 PATCH: fix task state reporting Russell King
2002-10-17 21:02 ` Daniel Jacobowitz

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®