Commit 48a64642 authored by Waiman Long's avatar Waiman Long Committed by Chen Ridong
Browse files

cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2

mainline inclusion
from mainline-v6.7-rc1
commit 0c7f293efc87a06b51db9aa65256f8cb0a5a0a21
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I93ZFV

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0c7f293efc87a06b51db9aa65256f8cb0a5a0a21



----------------------------------------------------------------------

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>

Conflicts:
	kernel/cgroup/cpuset.c

Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
parent d34411e4
Loading
Loading
Loading
Loading
+421 −307

File changed.

Preview size limit exceeded, changes collapsed.