mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: axboe@kernel.dk
Cc: vgoyal@redhat.com, linux-kernel@vger.kernel.org,
	avanzini.arianna@gmail.com, kernel-team@fb.com,
	hannes@cmpxchg.org, lizefan@huawei.com, cgroups@vger.kernel.org,
	Tejun Heo <tj@kernel.org>
Subject: [PATCH 01/10] cgroup: don't print subsystems for the default hierarchy
Date: Fri, 24 Jul 2015 14:43:45 -0400	[thread overview]
Message-ID: <1437763434-28699-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1437763434-28699-1-git-send-email-tj@kernel.org>

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>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: cgroups@vger.kernel.org
---
 kernel/cgroup.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f89d929..6c85e6d 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1332,9 +1332,10 @@ static int cgroup_show_options(struct seq_file *seq,
 	struct cgroup_subsys *ss;
 	int ssid;
 
-	for_each_subsys(ss, ssid)
-		if (root->subsys_mask & (1 << ssid))
-			seq_printf(seq, ",%s", ss->name);
+	if (root != &cgrp_dfl_root)
+		for_each_subsys(ss, ssid)
+			if (root->subsys_mask & (1 << ssid))
+				seq_printf(seq, ",%s", ss->name);
 	if (root->flags & CGRP_ROOT_NOPREFIX)
 		seq_puts(seq, ",noprefix");
 	if (root->flags & CGRP_ROOT_XATTR)
@@ -5136,9 +5137,11 @@ int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns,
 			continue;
 
 		seq_printf(m, "%d:", root->hierarchy_id);
-		for_each_subsys(ss, ssid)
-			if (root->subsys_mask & (1 << ssid))
-				seq_printf(m, "%s%s", count++ ? "," : "", ss->name);
+		if (root != &cgrp_dfl_root)
+			for_each_subsys(ss, ssid)
+				if (root->subsys_mask & (1 << ssid))
+					seq_printf(m, "%s%s", count++ ? "," : "",
+						   ss->name);
 		if (strlen(root->name))
 			seq_printf(m, "%sname=%s", count ? "," : "",
 				   root->name);
-- 
2.4.3


  reply	other threads:[~2015-07-24 18:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 18:43 [PATCHSET block/for-4.3] blkcg: implement interface for the unified hierarchy Tejun Heo
2015-07-24 18:43 ` Tejun Heo [this message]
2015-07-29  1:18   ` [PATCH 01/10] cgroup: don't print subsystems for the default hierarchy Zefan Li
2015-08-18 21:01   ` Tejun Heo
2015-07-24 18:43 ` [PATCH 02/10] cgroup: introduce cgroup_subsys->legacy_name Tejun Heo
2015-07-28  6:39   ` Zefan Li
2015-07-28 15:23     ` Tejun Heo
2015-07-28 17:56   ` [PATCH v2 " Tejun Heo
2015-08-18 21:01     ` Tejun Heo
2015-07-29  1:18   ` [PATCH " Zefan Li
2015-07-24 18:43 ` [PATCH 03/10] blkcg: remove unnecessary NULL checks from __cfqg_set_weight_device() Tejun Heo
2015-07-24 18:43 ` [PATCH 04/10] blkcg: refine error codes returned during blkcg configuration Tejun Heo
2015-07-24 18:43 ` [PATCH 05/10] blkcg: rename subsystem name from blkio to io Tejun Heo
2015-07-24 18:43 ` [PATCH 06/10] blkcg: mark existing cftypes as legacy Tejun Heo
2015-07-24 18:43 ` [PATCH 07/10] blkcg: move body parsing from blkg_conf_prep() to its callers Tejun Heo
2015-07-24 18:43 ` [PATCH 08/10] blkcg: separate out tg_conf_updated() from tg_set_conf() Tejun Heo
2015-07-24 18:43 ` [PATCH 09/10] blkcg: misc preparations for unified hierarchy interface Tejun Heo
2015-07-24 18:43 ` [PATCH 10/10] blkcg: implement interface for the unified hierarchy Tejun Heo
2015-07-30 22:58   ` [PATCH v2 " Tejun Heo
2015-07-27 16:12 ` [PATCHSET block/for-4.3] " Vivek Goyal
2015-07-27 18:13   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437763434-28699-2-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=avanzini.arianna@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome