]> asedeno.scripts.mit.edu Git - linux.git/commit
cpuset: Add an error state to cpuset.sched.partition
authorWaiman Long <longman@redhat.com>
Thu, 8 Nov 2018 15:08:39 +0000 (10:08 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 8 Nov 2018 20:27:29 +0000 (12:27 -0800)
commit3881b86128d0be22e8947ac1fca0429c74bf055e
tree32e73652de4bb1fb83aa7459fd5313587d6b273e
parentee8dde0cd2ce78b62d16aec1c29960b64380e634
cpuset: Add an error state to cpuset.sched.partition

When external events like CPU offlining or user events like changing
the cpu list of an ancestor cpuset happen, update_cpumasks_hier()
will be called to update the effective cpus of each of the affected
cpusets. That will then call update_parent_subparts_cpumask() if
partitions are impacted.

Currently, these events may cause update_parent_subparts_cpumask()
to return error if none of the requested cpus are available or it will
consume all the cpus in the parent partition root. Handling these errors
is problematic as the states may become inconsistent.

Instead of letting update_parent_subparts_cpumask() return error, a new
error state (-1) is added to the partition_root_state flag to designate
the fact that the partition is no longer valid. IOW, it is no longer a
real partition root, but the CS_CPU_EXCLUSIVE flag will still be set
as it can be changed back to a real one if favorable change happens
later on.

This new error state is set internally and user cannot write this new
value to "cpuset.sched.partition".

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