cpuset: Minor cgroup2 interface updates
authorTejun Heo <tj@kernel.org>
Tue, 13 Nov 2018 20:03:33 +0000 (12:03 -0800)
committerTejun Heo <tj@kernel.org>
Tue, 13 Nov 2018 20:09:48 +0000 (12:09 -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>
Documentation/admin-guide/cgroup-v2.rst
kernel/cgroup/cpuset.c

index f83a5231bbe365d44b3c66499e8832730f5b5c6d..07e06136a550b90b49b4163356f13b7a6ae00882 100644 (file)
@@ -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
index b897314bab53094422ccbb44b0c0df6c87a4aa5e..1151e93d71b65c73a2e552cb17a79df84b198374 100644 (file)
@@ -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,