[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230905133243.91107-1-longman@redhat.com>
Date: Tue, 5 Sep 2023 09:32:36 -0400
From: Waiman Long <longman@...hat.com>
To: Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>,
Christian Brauner <brauner@...nel.org>,
Jonathan Corbet <corbet@....net>, Shuah Khan <shuah@...nel.org>
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Michal Koutný <mkoutny@...e.com>,
Giuseppe Scrivano <gscrivan@...hat.com>,
Waiman Long <longman@...hat.com>
Subject: [PATCH v8 0/7] cgroup/cpuset: Support remote partitions
v8:
- Add a new patch 1 to fix a load balance state problem.
- Add new test cases to the test script and fixes some bugs in error
handling.
v7:
- https://lore.kernel.org/lkml/d0380dfa-ee2e-e492-38e3-31bf6644e511@redhat.com/
- Fix a compilation problem in patch 1 & a memory allocation bug in
patch 2.
- Change exclusive_cpus type to cpumask_var_t to match other cpumasks
and make code more consistent.
v6:
- https://lore.kernel.org/lkml/20230713172601.3285847-1-longman@redhat.com/
- Add another read-only cpuset.cpus.exclusive.effective control file
to expose the effective set of exclusive CPUs.
- Update the documentation and test accordingly.
This patch series introduces new cpuset control
files "cpuset.cpus.exclusive" (read-write) and
"cpuset.cpus.exclusive.effective" (read only) for better control of
which exclusive CPUs are being distributed down the cgroup hierarchy
for creating cpuset partition.
Any one of the exclusive CPUs can only be distributed to at most one
child cpuset. Invalid input to "cpuset.cpus.exclusive" that violates the
sibling exclusivity rule will be rejected. This new control files has
no effect on the behavior of the cpuset until it turns into a partition
root. At that point, its effective CPUs will be set to its exclusive
CPUs unless some of them are offline.
This patch series also introduces a new category of cpuset partition
called remote partitions. The existing partition category where the
partition roots have to be clustered around the root cgroup in a
hierarchical way is now referred to as local partitions.
A remote partition can be formed far from the root cgroup with no
partition root parent. While local partitions can be created without
touching "cpuset.cpus.exclusive" as it can be set automatically
if a cpuset becomes a local partition root. Properly setting
"cpuset.cpus.exclusive" values down the hierarchy are required to create
a remote partition.
Both scheduling and isolated partitions can be formed as a remote
partition. A local partition can be created under a remote partition.
A remote partition, however, cannot be formed under a local partition
for now.
Modern container orchestration tools like Kubernetes use the cgroup
hierarchy to manage different containers. And it is relying on other
middleware like systemd to help managing it. If a container needs to
use isolated CPUs, it is hard to get those with the local partitions
as it will require the administrative parent cgroup to be a partition
root too which tool like systemd may not be ready to manage.
With this patch series, we allow the creation of remote partition
far from the root. The container management tool can manage the
"cpuset.cpus.exclusive" file without impacting the other cpuset
files that are managed by other middlewares. Of course, invalid
"cpuset.cpus.exclusive" values will be rejected.
Waiman Long (7):
cgroup/cpuset: Fix load balance state in update_partition_sd_lb()
cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2
cgroup/cpuset: Add cpuset.cpus.exclusive for v2
cgroup/cpuset: Introduce remote partition
cgroup/cpuset: Check partition conflict with housekeeping setup
cgroup/cpuset: Documentation update for partition
cgroup/cpuset: Extend test_cpuset_prs.sh to test remote partition
Documentation/admin-guide/cgroup-v2.rst | 123 +-
kernel/cgroup/cpuset.c | 1279 ++++++++++++-----
.../selftests/cgroup/test_cpuset_prs.sh | 458 ++++--
3 files changed, 1366 insertions(+), 494 deletions(-)
--
2.31.1
Powered by blists - more mailing lists