• Waiman Long's avatar
    cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2 · 0c7f293e
    Waiman Long authored
    The creation of a cpuset partition means dedicating a set of exclusive
    CPUs to be used by a particular partition only. These exclusive CPUs
    will not be used by any cpusets outside of that partition.
    
    To enable more flexibility in creating partitions, we need a way to
    distribute exclusive CPUs that can be used in new partitions. Currently,
    we have a subparts_cpus cpumask in struct cpuset that tracks only
    the exclusive CPUs used by all the sub-partitions underneath a given
    cpuset.
    
    This patch reworks the way we do exclusive CPUs tracking. The
    subparts_cpus is now renamed to effective_xcpus which tracks the
    exclusive CPUs allocated to a partition root including those that are
    further distributed down to sub-partitions underneath it. IOW, it also
    includes the exclusive CPUs used by the current partition root. Note
    that effective_xcpus can contain offline CPUs and it will always be a
    subset of cpus_allowed.
    
    The renamed effective_xcpus is now exposed via a new read-only
    "cpuset.cpus.exclusive.effective" control file. The new effective_xcpus
    cpumask should be set to cpus_allowed when a cpuset becomes a partition
    root and be cleared if it is not a valid partition root.
    
    In the next patch, we will enable write to another new control file to
    enable further control of what can get into effective_xcpus.
    Signed-off-by: default avatarWaiman Long <longman@redhat.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    0c7f293e
cpuset.c 121 KB