linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v14 00/12] Enable cpuset controller in default hierarchy
@ 2018-10-15 20:29 Waiman Long
  2018-10-15 20:29 ` [PATCH v14 01/12] cpuset: " Waiman Long
                   ` (12 more replies)
  0 siblings, 13 replies; 39+ messages in thread
From: Waiman Long @ 2018-10-15 20:29 UTC (permalink / raw)
  To: Tejun Heo, Li Zefan, Johannes Weiner, Peter Zijlstra, Ingo Molnar
  Cc: cgroups, linux-kernel, linux-doc, kernel-team, pjt, luto,
	Mike Galbraith, torvalds, Roman Gushchin, Juri Lelli,
	Patrick Bellasi, Tom Hromatka, Waiman Long

v14:
 - Fix a bug about cpumask handling in patch 4 by using
   CONFIG_CPUMASK_OFFSTACK #ifdef block.
 - Add patch 12 to show descriptive name when reading
   cpuset.sched.partition (suggested by Tejun).
 - Change the function prototype of free_cpumasks() to match that of
   alloc_cpumasks() (suggested by Tom Hromatka).

v13:
 - A major rewrite of the partition code so that there will be no
   auto-turning off anymore. Instead, the partition root can enter into
   an error state that can be restored back to a partition root later on.
 - Patches 1 and 9 are the same as previous version, the rests are
   either new or substantially revised.

v12:
 - Take out the debugging patch to print partitions.
 - Add a patch to force turning off partition flag if newly modified CPU
   list doesn't meet the requirement of being a partition root.
 - Remove some unneeded checking code in update_reserved_cpumask().

v11:
 - Change the "domain_root" name to "partition" as suggested by Peter and
   update the documentation and code accordingly.
 - Remove the dying cgroup check in update_reserved_cpus() as the check
   may not be needed after all.
 - Document the effect of losing CPU affinity after offling all the cpus
   in a partition.
 - There is no other major code changes in this version.

v11 patch: https://lkml.org/lkml/2018/6/24/30
v12 patch: https://lkml.org/lkml/2018/8/27/423
v13 patch: https://lkml.org/lkml/2018/10/12/861

The purpose of this patchset is to provide a basic set of cpuset control
files for cgroup v2. This basic set includes the non-root "cpus",
"mems" and "sched.partition". The "cpus.effective" and "mems.effective"
will appear in all cpuset-enabled cgroups.

The new control file that is unique to v2 is "sched.partition". It is
a tristate flag file that designates if a cgroup is the root of a new
scheduling domain or partition with its own set of unique list of CPUs
from scheduling perspective disjointed from other partitions. An user
can write only "1" or "0" into this file to turn on and off partition root.
Depending on circumstances, a partition root may become erroneous and has
a flag value of -1. However, if condition becomes favorable again, it can
be changed back to a partition root automatically.

The root cgroup is always a partition root. Multiple levels of partitions
are supported with some limitations. So a container partition root can
behave like a real root.

When a partition root cgroup is removed, its list of exclusive CPUs
will be returned back to the parent's cpus.effective automatically.

A container root can be a partition root with sub-partitions
created underneath it. One difference from the real root is that the
"cpuset.sched.partition" flag isn't present in the real root, but is
present in a container root. This is also true for other cpuset control
files as well as those from the other controllers. This is a general
issue that is not going to be addressed here in this patchset.

This patchset does not exclude the possibility of adding more features
in the future after careful consideration.

Patch 1 enables cpuset in cgroup v2 with cpus, mems and their effective
counterparts.

Patch 2 defines new data structures to support partitioning.

Patch 3 simplifies the allocation and freeing of cpumasks in the cpuset
code and prepares for use by subsequent patches.

Patch 4 adds a new "sched.partition" control file for setting up multiple
scheduling domains or partitions. A partition root implies cpu_exclusive.

Patch 5 makes new "sched.partition" file to have a new error value of -1
which indicates that the partition root enters into an erroneous state
where some of the constraints of a partition root (like cpu_exclusive)
will still hold but it is not a real partition root anymore. This allows
the cpuset to change back to a partition root later on automatically
if the conditions become favorable again.

Patch 6 adds tracking of the number of cpusets that use the parent's
effective_cpus in order to make sure that those cpusets will be properly
updated if their parents effective cpus changes because of changes in
sibling partitions.

Patch 7 makes the hotplug code deal with partition root properly.

Patch 8 updates the scheduling domain genaration code to work with
the new partition feature.

Patch 9 exposes cpus.effective and mems.effective to the root cgroup
as enabling child partitions will take CPUs away from the root cgroup.
So it will be nice to monitor what CPUs are left there.

Patch 10 updates the cgroup v2 documentation file with information
about the new "sched.partition" file.

Patch 11 adds a new read-only "cpus.subpartitions" file that list the
CPUs in the subparts_cpus mask in the cpuset data structure when the
command line option "cgroup_debug" is specified. This is mostly used
for debugging and verification purposes.

Patch 12 changes the output of reading cpuset.sched.partition from
integer to a descriptive text similar to what cgroup.type is doing.

A test script with various cpuset configurations was run on both regular
and debug kernels with this patchset applied to verify that the cpusets
behaved appropriate without unexpected error.

Waiman Long (12):
  cpuset: Enable cpuset controller in default hierarchy
  cpuset: Define data structures to support scheduling partition
  cpuset: Simply allocation and freeing of cpumasks
  cpuset: Add new v2 cpuset.sched.partition flag
  cpuset: Add an error state to cpuset.sched.partition
  cpuset: Track cpusets that use parent's effective_cpus
  cpuset: Make CPU hotplug work with partition
  cpuset: Make generate_sched_domains() work with partition
  cpuset: Expose cpus.effective and mems.effective on cgroup v2 root
  cpuset: Add documentation about the new "cpuset.sched.partition" flag
  cpuset: Expose cpuset.cpus.subpartitions with cgroup_debug
  cpuset: Show descriptive text when reading cpuset.sched.partition

 Documentation/admin-guide/cgroup-v2.rst | 175 ++++-
 include/linux/cgroup-defs.h             |   1 +
 kernel/cgroup/cgroup-internal.h         |   2 +
 kernel/cgroup/cgroup.c                  |  14 +-
 kernel/cgroup/cpuset.c                  | 909 ++++++++++++++++++++++--
 kernel/cgroup/debug.c                   |   4 +-
 6 files changed, 1030 insertions(+), 75 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2018-11-08  9:41 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-15 20:29 [PATCH v14 00/12] Enable cpuset controller in default hierarchy Waiman Long
2018-10-15 20:29 ` [PATCH v14 01/12] cpuset: " Waiman Long
2018-10-15 20:29 ` [PATCH v14 02/12] cpuset: Define data structures to support scheduling partition Waiman Long
2018-10-15 20:29 ` [PATCH v14 03/12] cpuset: Simply allocation and freeing of cpumasks Waiman Long
2018-10-19 15:28   ` Tom Hromatka
2018-10-15 20:29 ` [PATCH v14 04/12] cpuset: Add new v2 cpuset.sched.partition flag Waiman Long
2018-11-06 11:35   ` Peter Zijlstra
2018-10-15 20:29 ` [PATCH v14 05/12] cpuset: Add an error state to cpuset.sched.partition Waiman Long
2018-11-06 11:37   ` Peter Zijlstra
2018-11-06 14:17     ` Waiman Long
2018-11-06 11:40   ` Peter Zijlstra
2018-11-07 23:13     ` Waiman Long
2018-11-06 11:40   ` Peter Zijlstra
2018-10-15 20:29 ` [PATCH v14 06/12] cpuset: Track cpusets that use parent's effective_cpus Waiman Long
2018-10-15 20:29 ` [PATCH v14 07/12] cpuset: Make CPU hotplug work with partition Waiman Long
2018-10-15 20:29 ` [PATCH v14 08/12] cpuset: Make generate_sched_domains() " Waiman Long
2018-10-15 20:29 ` [PATCH v14 09/12] cpuset: Expose cpus.effective and mems.effective on cgroup v2 root Waiman Long
2018-10-15 20:29 ` [PATCH v14 10/12] cpuset: Add documentation about the new "cpuset.sched.partition" flag Waiman Long
2018-11-06 11:50   ` Peter Zijlstra
2018-11-06 14:09     ` Waiman Long
2018-11-07 22:58     ` Waiman Long
2018-10-15 20:29 ` [PATCH v14 11/12] cpuset: Expose cpuset.cpus.subpartitions with cgroup_debug Waiman Long
2018-10-15 20:29 ` [PATCH v14 12/12] cpuset: Show descriptive text when reading cpuset.sched.partition Waiman Long
2018-10-17 15:08   ` Tejun Heo
2018-10-17 15:20     ` Waiman Long
2018-10-19 18:56     ` Waiman Long
2018-10-19 19:24       ` Tejun Heo
2018-10-19 19:32         ` Waiman Long
2018-11-02 14:34         ` Waiman Long
2018-11-06 11:52   ` Peter Zijlstra
2018-11-05 16:36 ` [PATCH v14 00/12] Enable cpuset controller in default hierarchy Tejun Heo
2018-11-05 16:57   ` Peter Zijlstra
2018-11-06 11:53   ` Peter Zijlstra
2018-11-06 11:55     ` Peter Zijlstra
2018-11-06 14:06       ` Waiman Long
     [not found]         ` <CAOS58YPye=7Ga+y-ujFsgHqo6vdVnjykmON1z+UjNQLvvM_g4w@mail.gmail.com>
2018-11-06 14:11           ` Tejun Heo
2018-11-07 21:32         ` Tejun Heo
2018-11-07 21:52           ` Waiman Long
2018-11-08  9:41           ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).