@@ -364,6 +364,13 @@ constraint, a threaded controller must be able to handle competition
364364between threads in a non-leaf cgroup and its child cgroups. Each
365365threaded controller defines how such competitions are handled.
366366
367+ Currently, the following controllers are threaded and can be enabled
368+ in a threaded cgroup::
369+
370+ - cpu
371+ - cpuset
372+ - perf_event
373+ - pids
367374
368375[Un]populated Notification
369376--------------------------
@@ -2226,6 +2233,49 @@ Cpuset Interface Files
22262233
22272234 Its value will be affected by memory nodes hotplug events.
22282235
2236+ cpuset.cpus.exclusive
2237+ A read-write multiple values file which exists on non-root
2238+ cpuset-enabled cgroups.
2239+
2240+ It lists all the exclusive CPUs that are allowed to be used
2241+ to create a new cpuset partition. Its value is not used
2242+ unless the cgroup becomes a valid partition root. See the
2243+ "cpuset.cpus.partition" section below for a description of what
2244+ a cpuset partition is.
2245+
2246+ When the cgroup becomes a partition root, the actual exclusive
2247+ CPUs that are allocated to that partition are listed in
2248+ "cpuset.cpus.exclusive.effective" which may be different
2249+ from "cpuset.cpus.exclusive". If "cpuset.cpus.exclusive"
2250+ has previously been set, "cpuset.cpus.exclusive.effective"
2251+ is always a subset of it.
2252+
2253+ Users can manually set it to a value that is different from
2254+ "cpuset.cpus". The only constraint in setting it is that the
2255+ list of CPUs must be exclusive with respect to its sibling.
2256+
2257+ For a parent cgroup, any one of its exclusive CPUs can only
2258+ be distributed to at most one of its child cgroups. Having an
2259+ exclusive CPU appearing in two or more of its child cgroups is
2260+ not allowed (the exclusivity rule). A value that violates the
2261+ exclusivity rule will be rejected with a write error.
2262+
2263+ The root cgroup is a partition root and all its available CPUs
2264+ are in its exclusive CPU set.
2265+
2266+ cpuset.cpus.exclusive.effective
2267+ A read-only multiple values file which exists on all non-root
2268+ cpuset-enabled cgroups.
2269+
2270+ This file shows the effective set of exclusive CPUs that
2271+ can be used to create a partition root. The content of this
2272+ file will always be a subset of "cpuset.cpus" and its parent's
2273+ "cpuset.cpus.exclusive.effective" if its parent is not the root
2274+ cgroup. It will also be a subset of "cpuset.cpus.exclusive"
2275+ if it is set. If "cpuset.cpus.exclusive" is not set, it is
2276+ treated to have an implicit value of "cpuset.cpus" in the
2277+ formation of local partition.
2278+
22292279 cpuset.cpus.partition
22302280 A read-write single value file which exists on non-root
22312281 cpuset-enabled cgroups. This flag is owned by the parent cgroup
@@ -2239,26 +2289,41 @@ Cpuset Interface Files
22392289 "isolated" Partition root without load balancing
22402290 ========== =====================================
22412291
2242- The root cgroup is always a partition root and its state
2243- cannot be changed. All other non-root cgroups start out as
2244- "member".
2292+ A cpuset partition is a collection of cpuset-enabled cgroups with
2293+ a partition root at the top of the hierarchy and its descendants
2294+ except those that are separate partition roots themselves and
2295+ their descendants. A partition has exclusive access to the
2296+ set of exclusive CPUs allocated to it. Other cgroups outside
2297+ of that partition cannot use any CPUs in that set.
2298+
2299+ There are two types of partitions - local and remote. A local
2300+ partition is one whose parent cgroup is also a valid partition
2301+ root. A remote partition is one whose parent cgroup is not a
2302+ valid partition root itself. Writing to "cpuset.cpus.exclusive"
2303+ is optional for the creation of a local partition as its
2304+ "cpuset.cpus.exclusive" file will assume an implicit value that
2305+ is the same as "cpuset.cpus" if it is not set. Writing the
2306+ proper "cpuset.cpus.exclusive" values down the cgroup hierarchy
2307+ before the target partition root is mandatory for the creation
2308+ of a remote partition.
2309+
2310+ Currently, a remote partition cannot be created under a local
2311+ partition. All the ancestors of a remote partition root except
2312+ the root cgroup cannot be a partition root.
2313+
2314+ The root cgroup is always a partition root and its state cannot
2315+ be changed. All other non-root cgroups start out as "member".
22452316
22462317 When set to "root", the current cgroup is the root of a new
2247- partition or scheduling domain that comprises itself and all
2248- its descendants except those that are separate partition roots
2249- themselves and their descendants.
2318+ partition or scheduling domain. The set of exclusive CPUs is
2319+ determined by the value of its "cpuset.cpus.exclusive.effective".
22502320
2251- When set to "isolated", the CPUs in that partition root will
2321+ When set to "isolated", the CPUs in that partition will
22522322 be in an isolated state without any load balancing from the
22532323 scheduler. Tasks placed in such a partition with multiple
22542324 CPUs should be carefully distributed and bound to each of the
22552325 individual CPUs for optimal performance.
22562326
2257- The value shown in "cpuset.cpus.effective" of a partition root
2258- is the CPUs that the partition root can dedicate to a potential
2259- new child partition root. The new child subtracts available
2260- CPUs from its parent "cpuset.cpus.effective".
2261-
22622327 A partition root ("root" or "isolated") can be in one of the
22632328 two possible states - valid or invalid. An invalid partition
22642329 root is in a degraded state where some state information may
@@ -2281,37 +2346,33 @@ Cpuset Interface Files
22812346 In the case of an invalid partition root, a descriptive string on
22822347 why the partition is invalid is included within parentheses.
22832348
2284- For a partition root to become valid, the following conditions
2349+ For a local partition root to be valid, the following conditions
22852350 must be met.
22862351
2287- 1) The "cpuset.cpus" is exclusive with its siblings , i.e. they
2288- are not shared by any of its siblings (exclusivity rule).
2289- 2) The parent cgroup is a valid partition root.
2290- 3) The "cpuset.cpus" is not empty and must contain at least
2291- one of the CPUs from parent's "cpuset.cpus", i.e. they overlap.
2292- 4) The "cpuset.cpus.effective" cannot be empty unless there is
2352+ 1) The parent cgroup is a valid partition root.
2353+ 2) The "cpuset.cpus.exclusive.effective" file cannot be empty,
2354+ though it may contain offline CPUs.
2355+ 3) The "cpuset.cpus.effective" cannot be empty unless there is
22932356 no task associated with this partition.
22942357
2295- External events like hotplug or changes to "cpuset.cpus" can
2296- cause a valid partition root to become invalid and vice versa.
2297- Note that a task cannot be moved to a cgroup with empty
2298- "cpuset.cpus.effective".
2358+ For a remote partition root to be valid, all the above conditions
2359+ except the first one must be met.
22992360
2300- For a valid partition root with the sibling cpu exclusivity
2301- rule enabled, changes made to "cpuset.cpus" that violate the
2302- exclusivity rule will invalidate the partition as well as its
2303- sibling partitions with conflicting cpuset.cpus values. So
2304- care must be taking in changing "cpuset.cpus".
2361+ External events like hotplug or changes to "cpuset.cpus" or
2362+ "cpuset.cpus.exclusive" can cause a valid partition root to
2363+ become invalid and vice versa. Note that a task cannot be
2364+ moved to a cgroup with empty "cpuset.cpus.effective".
23052365
23062366 A valid non-root parent partition may distribute out all its CPUs
2307- to its child partitions when there is no task associated with it.
2367+ to its child local partitions when there is no task associated
2368+ with it.
23082369
2309- Care must be taken to change a valid partition root to
2310- "member" as all its child partitions, if present, will become
2370+ Care must be taken to change a valid partition root to "member"
2371+ as all its child local partitions, if present, will become
23112372 invalid causing disruption to tasks running in those child
23122373 partitions. These inactivated partitions could be recovered if
23132374 their parent is switched back to a partition root with a proper
2314- set of "cpuset.cpus".
2375+ value in "cpuset.cpus" or "cpuset.cpus.exclusive ".
23152376
23162377 Poll and inotify events are triggered whenever the state of
23172378 "cpuset.cpus.partition" changes. That includes changes caused
@@ -2321,6 +2382,11 @@ Cpuset Interface Files
23212382 to "cpuset.cpus.partition" without the need to do continuous
23222383 polling.
23232384
2385+ A user can pre-configure certain CPUs to an isolated state
2386+ with load balancing disabled at boot time with the "isolcpus"
2387+ kernel boot command line option. If those CPUs are to be put
2388+ into a partition, they have to be used in an isolated partition.
2389+
23242390
23252391Device controller
23262392-----------------
0 commit comments