From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>, Waiman Long <longman@redhat.com>
Cc: Li Zefan <lizefan@huawei.com>,
Johannes Weiner <hannes@cmpxchg.org>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH cgroup/for-4.21 1/2] cpuset: Minor cgroup2 interface updates
Date: Tue, 13 Nov 2018 12:13:39 -0800 [thread overview]
Message-ID: <20181113201339.GN2509588@devbig004.ftw2.facebook.com> (raw)
From b1e3aeb11c5e86ee0988a038c4e7682d6beaa977 Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Tue, 13 Nov 2018 12:03:33 -0800
* Rename the partition file from "cpuset.sched.partition" to
"cpuset.cpus.partition".
* When writing to the partition file, drop "0" and "1" and only accept
"member" and "root".
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Waiman Long <longman@redhat.com>
---
Two minor cpuset interface followup patches. Applying to
cgroup/for-4.21.
Thanks.
Documentation/admin-guide/cgroup-v2.rst | 6 +++---
kernel/cgroup/cpuset.c | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index f83a5231bbe3..07e06136a550 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1708,15 +1708,15 @@ Cpuset Interface Files
Its value will be affected by memory nodes hotplug events.
- cpuset.sched.partition
+ cpuset.cpus.partition
A read-write single value file which exists on non-root
cpuset-enabled cgroups. This flag is owned by the parent cgroup
and is not delegatable.
It accepts only the following input values when written to.
- "root" or "1" - a paritition root
- "member" or "0" - a non-root member of a partition
+ "root" - a paritition root
+ "member" - a non-root member of a partition
When set to be a partition root, the current cgroup is the
root of a new partition or scheduling domain that comprises
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index b897314bab53..1151e93d71b6 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2468,11 +2468,11 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf,
buf = strstrip(buf);
/*
- * Convert "root"/"1" to 1, and convert "member"/"0" to 0.
+ * Convert "root" to ENABLED, and convert "member" to DISABLED.
*/
- if (!strcmp(buf, "root") || !strcmp(buf, "1"))
+ if (!strcmp(buf, "root"))
val = PRS_ENABLED;
- else if (!strcmp(buf, "member") || !strcmp(buf, "0"))
+ else if (!strcmp(buf, "member"))
val = PRS_DISABLED;
else
return -EINVAL;
@@ -2631,7 +2631,7 @@ static struct cftype dfl_files[] = {
},
{
- .name = "sched.partition",
+ .name = "cpus.partition",
.seq_show = sched_partition_show,
.write = sched_partition_write,
.private = FILE_PARTITION_ROOT,
--
2.17.1
next reply other threads:[~2018-11-13 20:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 20:13 Tejun Heo [this message]
2018-11-13 20:16 ` [PATCH cgroup/for-4.21 2/2] cgroup: Add .__DEBUG__. prefix to debug file names Tejun Heo
2018-11-20 12:46 ` Peter Zijlstra
2018-11-14 2:09 ` [PATCH cgroup/for-4.21 1/2] cpuset: Minor cgroup2 interface updates Waiman Long
2018-11-20 12:46 ` Peter Zijlstra
2018-11-20 15:44 ` Tejun Heo
2018-11-20 17:19 ` Peter Zijlstra
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=20181113201339.GN2509588@devbig004.ftw2.facebook.com \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=longman@redhat.com \
--cc=peterz@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.