@@ -393,6 +393,13 @@ constraint, a threaded controller must be able to handle competition
393
393
between threads in a non-leaf cgroup and its child cgroups. Each
394
394
threaded controller defines how such competitions are handled.
395
395
396
+ Currently, the following controllers are threaded and can be enabled
397
+ in a threaded cgroup::
398
+
399
+ - cpu
400
+ - cpuset
401
+ - perf_event
402
+ - pids
396
403
397
404
[Un]populated Notification
398
405
--------------------------
@@ -2266,6 +2273,49 @@ Cpuset Interface Files
2266
2273
2267
2274
Its value will be affected by memory nodes hotplug events.
2268
2275
2276
+ cpuset.cpus.exclusive
2277
+ A read-write multiple values file which exists on non-root
2278
+ cpuset-enabled cgroups.
2279
+
2280
+ It lists all the exclusive CPUs that are allowed to be used
2281
+ to create a new cpuset partition. Its value is not used
2282
+ unless the cgroup becomes a valid partition root. See the
2283
+ "cpuset.cpus.partition" section below for a description of what
2284
+ a cpuset partition is.
2285
+
2286
+ When the cgroup becomes a partition root, the actual exclusive
2287
+ CPUs that are allocated to that partition are listed in
2288
+ "cpuset.cpus.exclusive.effective" which may be different
2289
+ from "cpuset.cpus.exclusive". If "cpuset.cpus.exclusive"
2290
+ has previously been set, "cpuset.cpus.exclusive.effective"
2291
+ is always a subset of it.
2292
+
2293
+ Users can manually set it to a value that is different from
2294
+ "cpuset.cpus". The only constraint in setting it is that the
2295
+ list of CPUs must be exclusive with respect to its sibling.
2296
+
2297
+ For a parent cgroup, any one of its exclusive CPUs can only
2298
+ be distributed to at most one of its child cgroups. Having an
2299
+ exclusive CPU appearing in two or more of its child cgroups is
2300
+ not allowed (the exclusivity rule). A value that violates the
2301
+ exclusivity rule will be rejected with a write error.
2302
+
2303
+ The root cgroup is a partition root and all its available CPUs
2304
+ are in its exclusive CPU set.
2305
+
2306
+ cpuset.cpus.exclusive.effective
2307
+ A read-only multiple values file which exists on all non-root
2308
+ cpuset-enabled cgroups.
2309
+
2310
+ This file shows the effective set of exclusive CPUs that
2311
+ can be used to create a partition root. The content of this
2312
+ file will always be a subset of "cpuset.cpus" and its parent's
2313
+ "cpuset.cpus.exclusive.effective" if its parent is not the root
2314
+ cgroup. It will also be a subset of "cpuset.cpus.exclusive"
2315
+ if it is set. If "cpuset.cpus.exclusive" is not set, it is
2316
+ treated to have an implicit value of "cpuset.cpus" in the
2317
+ formation of local partition.
2318
+
2269
2319
cpuset.cpus.partition
2270
2320
A read-write single value file which exists on non-root
2271
2321
cpuset-enabled cgroups. This flag is owned by the parent cgroup
@@ -2279,26 +2329,41 @@ Cpuset Interface Files
2279
2329
"isolated" Partition root without load balancing
2280
2330
========== =====================================
2281
2331
2282
- The root cgroup is always a partition root and its state
2283
- cannot be changed. All other non-root cgroups start out as
2284
- "member".
2332
+ A cpuset partition is a collection of cpuset-enabled cgroups with
2333
+ a partition root at the top of the hierarchy and its descendants
2334
+ except those that are separate partition roots themselves and
2335
+ their descendants. A partition has exclusive access to the
2336
+ set of exclusive CPUs allocated to it. Other cgroups outside
2337
+ of that partition cannot use any CPUs in that set.
2338
+
2339
+ There are two types of partitions - local and remote. A local
2340
+ partition is one whose parent cgroup is also a valid partition
2341
+ root. A remote partition is one whose parent cgroup is not a
2342
+ valid partition root itself. Writing to "cpuset.cpus.exclusive"
2343
+ is optional for the creation of a local partition as its
2344
+ "cpuset.cpus.exclusive" file will assume an implicit value that
2345
+ is the same as "cpuset.cpus" if it is not set. Writing the
2346
+ proper "cpuset.cpus.exclusive" values down the cgroup hierarchy
2347
+ before the target partition root is mandatory for the creation
2348
+ of a remote partition.
2349
+
2350
+ Currently, a remote partition cannot be created under a local
2351
+ partition. All the ancestors of a remote partition root except
2352
+ the root cgroup cannot be a partition root.
2353
+
2354
+ The root cgroup is always a partition root and its state cannot
2355
+ be changed. All other non-root cgroups start out as "member".
2285
2356
2286
2357
When set to "root", the current cgroup is the root of a new
2287
- partition or scheduling domain that comprises itself and all
2288
- its descendants except those that are separate partition roots
2289
- themselves and their descendants.
2358
+ partition or scheduling domain. The set of exclusive CPUs is
2359
+ determined by the value of its "cpuset.cpus.exclusive.effective".
2290
2360
2291
- When set to "isolated", the CPUs in that partition root will
2361
+ When set to "isolated", the CPUs in that partition will
2292
2362
be in an isolated state without any load balancing from the
2293
2363
scheduler. Tasks placed in such a partition with multiple
2294
2364
CPUs should be carefully distributed and bound to each of the
2295
2365
individual CPUs for optimal performance.
2296
2366
2297
- The value shown in "cpuset.cpus.effective" of a partition root
2298
- is the CPUs that the partition root can dedicate to a potential
2299
- new child partition root. The new child subtracts available
2300
- CPUs from its parent "cpuset.cpus.effective".
2301
-
2302
2367
A partition root ("root" or "isolated") can be in one of the
2303
2368
two possible states - valid or invalid. An invalid partition
2304
2369
root is in a degraded state where some state information may
@@ -2321,37 +2386,33 @@ Cpuset Interface Files
2321
2386
In the case of an invalid partition root, a descriptive string on
2322
2387
why the partition is invalid is included within parentheses.
2323
2388
2324
- For a partition root to become valid, the following conditions
2389
+ For a local partition root to be valid, the following conditions
2325
2390
must be met.
2326
2391
2327
- 1) The "cpuset.cpus" is exclusive with its siblings , i.e. they
2328
- are not shared by any of its siblings (exclusivity rule).
2329
- 2) The parent cgroup is a valid partition root.
2330
- 3) The "cpuset.cpus" is not empty and must contain at least
2331
- one of the CPUs from parent's "cpuset.cpus", i.e. they overlap.
2332
- 4) The "cpuset.cpus.effective" cannot be empty unless there is
2392
+ 1) The parent cgroup is a valid partition root.
2393
+ 2) The "cpuset.cpus.exclusive.effective" file cannot be empty,
2394
+ though it may contain offline CPUs.
2395
+ 3) The "cpuset.cpus.effective" cannot be empty unless there is
2333
2396
no task associated with this partition.
2334
2397
2335
- External events like hotplug or changes to "cpuset.cpus" can
2336
- cause a valid partition root to become invalid and vice versa.
2337
- Note that a task cannot be moved to a cgroup with empty
2338
- "cpuset.cpus.effective".
2398
+ For a remote partition root to be valid, all the above conditions
2399
+ except the first one must be met.
2339
2400
2340
- For a valid partition root with the sibling cpu exclusivity
2341
- rule enabled, changes made to "cpuset.cpus" that violate the
2342
- exclusivity rule will invalidate the partition as well as its
2343
- sibling partitions with conflicting cpuset.cpus values. So
2344
- care must be taking in changing "cpuset.cpus".
2401
+ External events like hotplug or changes to "cpuset.cpus" or
2402
+ "cpuset.cpus.exclusive" can cause a valid partition root to
2403
+ become invalid and vice versa. Note that a task cannot be
2404
+ moved to a cgroup with empty "cpuset.cpus.effective".
2345
2405
2346
2406
A valid non-root parent partition may distribute out all its CPUs
2347
- to its child partitions when there is no task associated with it.
2407
+ to its child local partitions when there is no task associated
2408
+ with it.
2348
2409
2349
- Care must be taken to change a valid partition root to
2350
- "member" as all its child partitions, if present, will become
2410
+ Care must be taken to change a valid partition root to "member"
2411
+ as all its child local partitions, if present, will become
2351
2412
invalid causing disruption to tasks running in those child
2352
2413
partitions. These inactivated partitions could be recovered if
2353
2414
their parent is switched back to a partition root with a proper
2354
- set of "cpuset.cpus".
2415
+ value in "cpuset.cpus" or "cpuset.cpus.exclusive ".
2355
2416
2356
2417
Poll and inotify events are triggered whenever the state of
2357
2418
"cpuset.cpus.partition" changes. That includes changes caused
@@ -2361,6 +2422,11 @@ Cpuset Interface Files
2361
2422
to "cpuset.cpus.partition" without the need to do continuous
2362
2423
polling.
2363
2424
2425
+ A user can pre-configure certain CPUs to an isolated state
2426
+ with load balancing disabled at boot time with the "isolcpus"
2427
+ kernel boot command line option. If those CPUs are to be put
2428
+ into a partition, they have to be used in an isolated partition.
2429
+
2364
2430
2365
2431
Device controller
2366
2432
-----------------
0 commit comments