mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Glauber Costa <glommer@openvz.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Turner <pjt@google.com>,
	linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	devel@openvz.org
Subject: [PATCH cgroup/for-3.11] cgroup: disallow cpuacct if sane_behavior
Date: Wed, 5 Jun 2013 19:46:26 -0700	[thread overview]
Message-ID: <20130606024626.GT10693@mtj.dyndns.org> (raw)

cpuacct causes duplicate accountings on the scheduler and cpu will
provide equivalent stats.  Optimizations for cases where cpu and
cpuacct are co-mounted are being worked on but we want to deprecate it
eventually.  Let's disallow cpuacct if __DEVEL__sane_behavior.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Glauber Costa <glommer@openvz.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 include/linux/cgroup.h |    3 +++
 kernel/cgroup.c        |    5 +++++
 2 files changed, 8 insertions(+)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index d0ad379..6c3bbdb 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -280,6 +280,9 @@ enum {
 	 * - memcg: use_hierarchy is on by default and the cgroup file for
 	 *   the flag is not created.
 	 *
+	 * - cpuacct: No longer supported.  cpu will have matching stats.
+	 *   Use those instead.
+	 *
 	 * The followings are planned changes.
 	 *
 	 * - release_agent will be disallowed once replacement notification
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index bc53d50..5c746eb 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1256,6 +1256,11 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
 			pr_err("cgroup: sane_behavior: clone_children is not allowed\n");
 			return -EINVAL;
 		}
+
+		if (test_bit(cpuacct_subsys_id, &opts->subsys_mask)) {
+			pr_err("cgroup: sane_behavior: cpuacct is no longer available, use stats from cpu instead\n");
+			return -EINVAL;
+		}
 	}
 
 	/*

                 reply	other threads:[~2013-06-06  2:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20130606024626.GT10693@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=cgroups@vger.kernel.org \
    --cc=devel@openvz.org \
    --cc=fweisbec@gmail.com \
    --cc=glommer@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pjt@google.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

all inboxes | Powered by JetHome®