• Waiman Long's avatar
    cgroup/cpuset: Allow no-task partition to have empty cpuset.cpus.effective · e2d59900
    Waiman Long authored
    Currently, a partition root cannot have empty "cpuset.cpus.effective".
    As a result, a parent partition root cannot distribute out all its
    CPUs to child partitions with no CPUs left. However in most cases,
    there shouldn't be any tasks associated with intermediate nodes of the
    default hierarchy. So the current rule is too restrictive and can waste
    valuable CPU resource.
    
    To address this issue, we are now allowing a partition to have empty
    "cpuset.cpus.effective" as long as it has no task. Since cpuset is
    threaded, no-internal-process rule does not apply. So it is possible
    to have tasks in a partition root with child sub-partitions even though
    that should be uncommon.
    
    A parent partition with no task can now have all its CPUs distributed out
    to its child partitions. The top cpuset always have some house-keeping
    tasks running and so its list of effective cpu can't be empty.
    
    Once a partition with empty "cpuset.cpus.effective" is formed, no
    new task can be moved into it until "cpuset.cpus.effective" becomes
    non-empty.
    Signed-off-by: default avatarWaiman Long <longman@redhat.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    e2d59900
cpuset.c 106 KB