[PATCH V2] sched, autogroup: always show autogroup name insched_debug
From: Yong Zhang
Date: Tue Feb 22 2011 - 07:10:17 EST
On Tue, Feb 22, 2011 at 10:56:06AM +0100, Peter Zijlstra wrote:
> On Tue, 2011-02-22 at 11:13 +0800, Yong Zhang wrote:
> > So show autogroup name always. But for the root group,
> > its name will dance between "cfs_rq[cpu]:" and
> > "cfs_rq[cpu]:/autogroup-0" according to
> > sysctl_sched_autogroup_enabled.
>
> Would it make sense to force the root group to always be a !autogroup?
Hmmm, I think it's ok.
---
From: Yong Zhang <yong.zhang0@xxxxxxxxx>
Subject: [PATCH] sched, autogroup: always show autogroup name in sched_debug
When autogroup is disabled, there will be lots of group
named "cfs_rq[cpu]:", thus will lead to confusion for
who read it.
And for now, autogroup runtime disable/enable will
not take effect immediately on current live processes,
so there maybe still have some processes attaching to
its autogroup.
So show autogroup name always. But for the root group,
its name will always be "cfs_rq[cpu]:/".
Signed-off-by: Yong Zhang <yong.zhang0@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
---
kernel/sched_autogroup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/kernel/sched_autogroup.c b/kernel/sched_autogroup.c
index 9fb6562..5b9a317 100644
--- a/kernel/sched_autogroup.c
+++ b/kernel/sched_autogroup.c
@@ -258,9 +258,7 @@ void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m)
#ifdef CONFIG_SCHED_DEBUG
static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
{
- int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled);
-
- if (!enabled || !tg->autogroup)
+ if (!tg->autogroup || !tg->autogroup->id)
return 0;
return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/