]> asedeno.scripts.mit.edu Git - linux.git/commit
cpuset: Add new v2 cpuset.sched.partition flag
authorWaiman Long <longman@redhat.com>
Thu, 8 Nov 2018 15:08:38 +0000 (10:08 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 8 Nov 2018 20:27:28 +0000 (12:27 -0800)
commitee8dde0cd2ce78b62d16aec1c29960b64380e634
tree2501587a2dcc7089da131f29a080552cce8dce29
parentbf92370c035d5ed73a90927450c20a07adf08cfd
cpuset: Add new v2 cpuset.sched.partition flag

A new cpuset.sched.partition boolean flag is added to cpuset v2.
This new flag, if set, indicates that the cgroup is the root of a
new scheduling domain or partition that includes itself and all its
descendants except those that are scheduling domain roots themselves
and their descendants.

With this new flag, one can directly create as many partitions as
necessary without ever using the v1 trick of turning off load balancing
in specific cpusets to create partitions as a side effect.

This new flag is owned by the parent and will cause the CPUs in the
cpuset to be removed from the effective CPUs of its parent.

This is implemented internally by adding a new subparts_cpus mask that
holds the CPUs belonging to child partitions so that:

        subparts_cpus | effective_cpus = cpus_allowed
        subparts_cpus & effective_cpus = 0

This new flag can only be turned on in a cpuset if its parent is a
partition root itself. The state of this flag cannot be changed if the
cpuset has children.

Once turned on, further changes to "cpuset.cpus" is allowed as long
as there is at least one CPU left that can be granted from the parent
and a child partition root cannot use up all the CPUs in the parent's
effective_cpus.

Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset.c