• Cliff Wickman's avatar
    hotplug cpu: move tasks in empty cpusets to parent · 956db3ca
    Cliff Wickman authored
    This patch corrects a situation that occurs when one disables all the cpus in
    a cpuset.
    
    Currently, the disabled (cpu-less) cpuset inherits the cpus of its parent,
    which is incorrect because it may then overlap its cpu-exclusive sibling.
    
    Tasks of an empty cpuset should be moved to the cpuset which is the parent of
    their current cpuset.  Or if the parent cpuset has no cpus, to its parent,
    etc.
    
    And the empty cpuset should be released (if it is flagged notify_on_release).
    
    Depends on the cgroup_scan_tasks() function (proposed by David Rientjes) to
    iterate through all tasks in the cpu-less cpuset.  We are deliberately
    avoiding a walk of the tasklist.
    
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: default avatarCliff Wickman <cpw@sgi.com>
    Cc: Paul Menage <menage@google.com>
    Cc: Paul Jackson <pj@sgi.com>
    Cc: David Rientjes <rientjes@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    956db3ca
cpuset.c 70.1 KB