cpuset: Track cpusets that use parent's effective_cpus
authorWaiman Long <longman@redhat.com>
Thu, 8 Nov 2018 15:08:40 +0000 (10:08 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 8 Nov 2018 20:27:29 +0000 (12:27 -0800)
commit4716909cc5c566e946a3acc884bf5dc469812007
treec70f38e1cbfcee11095bc04615ca8114a2702593
parent3881b86128d0be22e8947ac1fca0429c74bf055e
cpuset: Track cpusets that use parent's effective_cpus

In the default hierarchy, a cpuset will use the parent's effective_cpus
if none of the requested CPUs can be granted from the parent. That can
be a problem if a parent is a partition root with children partition
roots. Changes to a parent's effective_cpus list due to changes in a
child partition root may not be properly reflected in a child cpuset
that use parent's effective_cpus because the cpu_exclusive rule of a
partition root will not guard against that.

In order to avoid the mismatch, two new tracking variables are added to
the cpuset structure to track if a cpuset uses parent's effective_cpus
and the number of children cpusets that use its effective_cpus. So
whenever cpumask changes are made to a parent, it will also check to
see if it has other children cpusets that use its effective_cpus and
call update_cpumasks_hier() if that is the case.

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