Skip to content

Commit b1e3aeb

Browse files
committed
cpuset: Minor cgroup2 interface updates
* 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>
1 parent 5cf8114 commit b1e3aeb

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎Documentation/admin-guide/cgroup-v2.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,15 +1708,15 @@ Cpuset Interface Files
17081708

17091709
Its value will be affected by memory nodes hotplug events.
17101710

1711-
cpuset.sched.partition
1711+
cpuset.cpus.partition
17121712
A read-write single value file which exists on non-root
17131713
cpuset-enabled cgroups. This flag is owned by the parent cgroup
17141714
and is not delegatable.
17151715

17161716
It accepts only the following input values when written to.
17171717

1718-
"root" or "1" - a paritition root
1719-
"member" or "0" - a non-root member of a partition
1718+
"root" - a paritition root
1719+
"member" - a non-root member of a partition
17201720

17211721
When set to be a partition root, the current cgroup is the
17221722
root of a new partition or scheduling domain that comprises

‎kernel/cgroup/cpuset.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,11 +2468,11 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf,
24682468
buf = strstrip(buf);
24692469

24702470
/*
2471-
* Convert "root"/"1" to 1, and convert "member"/"0" to 0.
2471+
* Convert "root" to ENABLED, and convert "member" to DISABLED.
24722472
*/
2473-
if (!strcmp(buf, "root") || !strcmp(buf, "1"))
2473+
if (!strcmp(buf, "root"))
24742474
val = PRS_ENABLED;
2475-
else if (!strcmp(buf, "member") || !strcmp(buf, "0"))
2475+
else if (!strcmp(buf, "member"))
24762476
val = PRS_DISABLED;
24772477
else
24782478
return -EINVAL;
@@ -2631,7 +2631,7 @@ static struct cftype dfl_files[] = {
26312631
},
26322632

26332633
{
2634-
.name = "sched.partition",
2634+
.name = "cpus.partition",
26352635
.seq_show = sched_partition_show,
26362636
.write = sched_partition_write,
26372637
.private = FILE_PARTITION_ROOT,

0 commit comments

Comments
 (0)