aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-04-06 15:18:06 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-07 13:06:51 -0400
commit35f6f753b79705bc4b62da5dcc218d75ffa88370 (patch)
treefae64e1ebcc00b2768689a3e24f956ce0a431513 /kernel
parent7f30e49ee1c2c1e95ce9d2ccce5221ddb793dd60 (diff)
[PATCH] sched: get rid of p->children use in show_task()
the p->parent PID printout gives us all the information about the task tree that we need - the eldest_child()/older_sibling()/ younger_sibling() printouts are mostly historic and i do not remember ever having used those fields. (IMO in fact they confuse the SysRq-T output.) So remove them. This code has sentimental value though, those fields and printouts are one of the oldest ones still surviving from Linux v0.95's kernel/sched.c: if (p->p_ysptr || p->p_osptr) printk(" Younger sib=%d, older sib=%d\n\r", p->p_ysptr ? p->p_ysptr->pid : -1, p->p_osptr ? p->p_osptr->pid : -1); else printk("\n\r"); written 15 years ago, in early 1992. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus 'snif' Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index a4ca632c477c..cdad3b04242a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4687,27 +4687,6 @@ out_unlock:
4687 return retval; 4687 return retval;
4688} 4688}
4689 4689
4690static inline struct task_struct *eldest_child(struct task_struct *p)
4691{
4692 if (list_empty(&p->children))
4693 return NULL;
4694 return list_entry(p->children.next,struct task_struct,sibling);
4695}
4696
4697static inline struct task_struct *older_sibling(struct task_struct *p)
4698{
4699 if (p->sibling.prev==&p->parent->children)
4700 return NULL;
4701 return list_entry(p->sibling.prev,struct task_struct,sibling);
4702}
4703
4704static inline struct task_struct *younger_sibling(struct task_struct *p)
4705{
4706 if (p->sibling.next==&p->parent->children)
4707 return NULL;
4708 return list_entry(p->sibling.next,struct task_struct,sibling);
4709}
4710
4711static const char stat_nam[] = "RSDTtZX"; 4690static const char stat_nam[] = "RSDTtZX";
4712 4691
4713static void show_task(struct task_struct *p) 4692static void show_task(struct task_struct *p)
@@ -4738,19 +4717,7 @@ static void show_task(struct task_struct *p)
4738 free = (unsigned long)n - (unsigned long)end_of_stack(p); 4717 free = (unsigned long)n - (unsigned long)end_of_stack(p);
4739 } 4718 }
4740#endif 4719#endif
4741 printk("%5lu %5d %6d ", free, p->pid, p->parent->pid); 4720 printk("%5lu %5d %6d", free, p->pid, p->parent->pid);
4742 if ((relative = eldest_child(p)))
4743 printk("%5d ", relative->pid);
4744 else
4745 printk(" ");
4746 if ((relative = younger_sibling(p)))
4747 printk("%7d", relative->pid);
4748 else
4749 printk(" ");
4750 if ((relative = older_sibling(p)))
4751 printk(" %5d", relative->pid);
4752 else
4753 printk(" ");
4754 if (!p->mm) 4721 if (!p->mm)
4755 printk(" (L-TLB)\n"); 4722 printk(" (L-TLB)\n");
4756 else 4723 else