aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-08-18 16:58:16 -0400
committerTejun Heo <tj@kernel.org>2015-08-18 16:58:16 -0400
commitd98817d4961b9ef75062d1e129829d283b3dac57 (patch)
treea71076ebe528096084a1290d823c0251691e9172
parent731a981e1059dd68c97212ccc9c0e1f169c1a77b (diff)
cgroup: don't print subsystems for the default hierarchy
It doesn't make sense to print subsystems on mount option or /proc/PID/cgroup for the default hierarchy. * cgroup.controllers file at the root of the default hierarchy lists the currently attached controllers. * The default hierarchy is catch-all for unmounted subsystems. * The default hierarchy doesn't accept any mount options. Suppress subsystem printing on mount options and /proc/PID/cgroup for the default hierarchy. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: cgroups@vger.kernel.org
-rw-r--r--kernel/cgroup.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3f6641632f73..d9f854defa78 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1333,9 +1333,10 @@ static int cgroup_show_options(struct seq_file *seq,
1333 struct cgroup_subsys *ss; 1333 struct cgroup_subsys *ss;
1334 int ssid; 1334 int ssid;
1335 1335
1336 for_each_subsys(ss, ssid) 1336 if (root != &cgrp_dfl_root)
1337 if (root->subsys_mask & (1 << ssid)) 1337 for_each_subsys(ss, ssid)
1338 seq_printf(seq, ",%s", ss->name); 1338 if (root->subsys_mask & (1 << ssid))
1339 seq_printf(seq, ",%s", ss->name);
1339 if (root->flags & CGRP_ROOT_NOPREFIX) 1340 if (root->flags & CGRP_ROOT_NOPREFIX)
1340 seq_puts(seq, ",noprefix"); 1341 seq_puts(seq, ",noprefix");
1341 if (root->flags & CGRP_ROOT_XATTR) 1342 if (root->flags & CGRP_ROOT_XATTR)
@@ -5137,9 +5138,11 @@ int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns,
5137 continue; 5138 continue;
5138 5139
5139 seq_printf(m, "%d:", root->hierarchy_id); 5140 seq_printf(m, "%d:", root->hierarchy_id);
5140 for_each_subsys(ss, ssid) 5141 if (root != &cgrp_dfl_root)
5141 if (root->subsys_mask & (1 << ssid)) 5142 for_each_subsys(ss, ssid)
5142 seq_printf(m, "%s%s", count++ ? "," : "", ss->name); 5143 if (root->subsys_mask & (1 << ssid))
5144 seq_printf(m, "%s%s", count++ ? "," : "",
5145 ss->name);
5143 if (strlen(root->name)) 5146 if (strlen(root->name))
5144 seq_printf(m, "%sname=%s", count ? "," : "", 5147 seq_printf(m, "%sname=%s", count ? "," : "",
5145 root->name); 5148 root->name);