]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man7/cgroups.7
random.7: srcfix
[thirdparty/man-pages.git] / man7 / cgroups.7
1 .\" Copyright (C) 2015 Serge Hallyn <serge@hallyn.com>
2 .\" and Copyright (C) 2016 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .TH CGROUPS 7 2016-07-17 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 cgroups \- Linux control groups
29 .SH DESCRIPTION
30 Control cgroups, usually referred to as cgroups,
31 are a Linux kernel feature which allow processes to
32 be organized into hierarchical groups whose usage of
33 various types of resources can then be limited and monitored.
34 The kernel's cgroup interface is provided through
35 a pseudo-filesystem called cgroupfs.
36 Grouping is implemented in the core cgroup kernel code,
37 while resource tracking and limits are implemented in
38 a set of per-resource-type subsystems (memory, CPU, and so on).
39 .\"
40 .SS Terminology
41 A
42 .I cgroup
43 is a collection of processes that are bound to a set of
44 limits or parameters defined via the cgroup filesystem.
45
46 A
47 .I subsystem
48 is a kernel component that modifies the behavior of
49 the processes in a cgroup.
50 Various subsystems have been implemented, making it possible to do things
51 such as limiting the amount of CPU time and memory available to a cgroup,
52 accounting for the CPU time used by a cgroup,
53 and freezing and resuming execution of the processes in a cgroup.
54 Subsystems are sometimes also known as
55 .IR "resource controllers"
56 (or simply, controllers).
57
58 The cgroups for a controller are arranged in a
59 .IR hierarchy .
60 This hierarchy is defined by creating, removing, and
61 renaming subdirectories within the cgroup filesystem.
62 At each level of the hierarchy, attributes (e.g., limits) can be defined.
63 The limits, control, and accounting provided by cgroups generally have
64 effect throughout the subhierarchy underneath the cgroup where the
65 attributes are defined.
66 Thus, for example, the limits placed on
67 a cgroup at a higher level in the hierarchy cannot be exceeded
68 by descendant cgroups.
69 .\"
70 .SS Cgroups version 1 and version 2
71 The initial release of the cgroups implementation was in Linux 2.6.24.
72 Over time, various cgroup controllers have been added
73 to allow the management of various types of resources.
74 However, the development of these controllers was largely uncoordinated,
75 with the result that many inconsistencies arose between controllers
76 and management of the cgroup hierarchies became rather complex.
77 (A longer description of these problems can be found in
78 the kernel source file
79 .IR Documentation/cgroup\-v2.txt .)
80
81 Because of the problems with the initial cgroups implementation
82 (cgroups version 1),
83 starting in Linux 3.10, work began on a new,
84 orthogonal implementation to remedy these problems.
85 Initially marked experimental, and hidden behind the
86 .I "\-o\ __DEVEL__sane_behavior"
87 mount option, the new version (cgroups version 2)
88 was eventually made official with the release of Linux 4.5.
89 Differences between the two versions are described in the text below.
90
91 Although cgroups v2 is intended as a replacement for cgroups v1,
92 the older system continues to exist
93 (and for compatibility reasons is unlikely to be removed).
94 Currently, cgroups v2 implements only a subset of the controllers
95 available in cgroups v1.
96 The two systems are implemented so that both v1 controllers and
97 v2 controllers can be mounted on the same system.
98 Thus, for example, it is possible to use those controllers
99 that are supported under version 2,
100 while also using version 1 controllers
101 where version 2 does not yet support those controllers.
102 The only restriction here is that a controller can't be simultaneously
103 employed in both a cgroups v1 hierarchy and in the cgroups v2 hierarchy.
104 .\"
105 .SS Cgroups version 1
106 Under cgroups v1, each controller may be mounted against a separate
107 cgroup filesystem that provides its own hierarchical organization of the
108 processes on the system.
109 It is also possible comount multiple (or even all) cgroups v1 controllers
110 against the same cgroup filesystem, meaning that the comounted controllers
111 manage the same hierarchical organization of processes.
112
113 For each mounted hierarchy,
114 the directory tree mirrors the control group hierarchy.
115 Each control group is represented by a directory, with each of its child
116 control cgroups represented as a child directory.
117 For instance,
118 .IR /user/joe/1.session
119 represents control group
120 .IR 1.session ,
121 which is a child of cgroup
122 .IR joe ,
123 which is a child of
124 .IR /user .
125 Under each cgroup directory is a set of files which can be read or
126 written to, reflecting resource limits and a few general cgroup
127 properties.
128
129 In addition, in cgroups v1,
130 cgroups can be mounted with no bound controller, in which case
131 they serve only to track processes.
132 (See the discussion of release notification below.)
133 An example of this is the
134 .I name=systemd
135 cgroup which is used by
136 .BR systemd (1)
137 to track services and user sessions.
138 .\"
139 .SS Tasks (threads) versus processes
140 In cgroups v1, a distinction is drawn between
141 .I processes
142 and
143 .IR tasks .
144 In this view, a process can consist of multiple tasks
145 (more commonly called threads, from a user-space perspective,
146 and called such in the remainder of this man page).
147 In cgroups v1, it is possible to independently manipulate
148 the cgroup memberships of the threads in a process.
149 Because this ability caused certain problems,
150 .\" FIXME Add some text describing why this was a problem.
151 the ability to independently manipulate the cgroup memberships
152 of the threads in a process has been removed in cgroups v2.
153 Cgroups v2 allows manipulation of cgroup membership only for processes
154 (which has the effect of changing the cgroup membership of
155 all threads in the process).
156 .\"
157 .SS Mounting v1 controllers
158 The use of cgroups requires a kernel built with the
159 .BR CONFIG_CGROUP\option.
160 In addition, each of the v1 controllers has an associated
161 configuration option that must be set in order to employ that controller.
162
163 In order to use a v1 controller,
164 it must be mounted against a cgroup filesystem.
165 The usual place for such mounts is under a
166 .BR tmpfs (5)
167 filesystem mounted at
168 .IR /sys/fs/cgroup .
169 Thus, one might mount the
170 .I cpu
171 controller as follows:
172
173 .nf
174 .in +4n
175 mount \-t cgroup \-o cpu none /sys/fs/cgroup/cpu
176 .in
177 .fi
178
179 It is possible to comount multiple controllers against the same hierarchy.
180 For example, here the
181 .IR cpu
182 and
183 .IR cpuacct
184 controllers are comounted against a single hierarchy:
185
186 .nf
187 .in +4n
188 mount \-t cgroup \-o cpu,cpuacct none /sys/fs/cgroup/cpu,cpuacct
189 .in
190 .fi
191
192 Comounting controllers has the effect that a process is in the same cgroup for
193 all of the comounted controllers.
194 Separately mounting controllers allows a process to
195 be in cgroup
196 .I /foo1
197 for one controller while being in
198 .I /foo2/foo3
199 for another.
200
201 It is possible to comount all v1 controllers against the same hierarchy:
202
203 .nf
204 .in +4n
205 mount \-t cgroup \-o all cgroup /sys/fs/cgroup
206 .in
207 .fi
208
209 (One can achieve the same result by omitting
210 .IR "\-o all" ,
211 since it is the default if no controllers are explicitly specified.)
212
213 It is not possible to mount the same controller
214 against multiple cgroup hierarchies.
215 For example, it is not possible to mount both the
216 .I cpu
217 and
218 .I cpuacct
219 controllers against one hierarchy, and to mount the
220 .I cpu
221 controller alone against another hierarchy.
222 It is possible to create multiple mount points with exactly
223 the same set of comounted controllers.
224 However, in this case all that results is multiple mount points
225 providing a view of the same hierarchy.
226
227 Note that on many systems, the v1 controllers are automatically mounted under
228 .IR /sys/fs/cgroup ;
229 in particular,
230 .BR systemd (1)
231 automatically creates such mount points.
232 .\"
233 .SS Cgroups version 1 controllers
234 Each of the cgroups version 1 controllers is governed
235 by a kernel configuration option (listed below).
236 Additionally, the availability of the cgroups feature is governed by the
237 .BR CONFIG_CGROUPS
238 kernel configuration option.
239 .TP
240 .IR cpu " (since Linux 2.6.24; " \fBCONFIG_CGROUP_SCHED\fP )
241 Cgroups can be guaranteed a minimum number of "CPU shares"
242 when a system is busy.
243 This does not limit a cgroup's CPU usage if the CPUs are not busy.
244
245 Further information can be found in the kernel source file
246 .IR Documentation/scheduler/sched\-bwc.txt .
247 .TP
248 .IR cpuacct " (since Linux 2.6.24; " \fBCONFIG_CGROUP_CPUACCT\fP )
249 This provides accounting for CPU usage by groups of processes.
250
251 Further information can be found in the kernel source file
252 .IR Documentation/cgroup\-v1/cpuacct.txt .
253 .TP
254 .IR cpuset " (since Linux 2.6.24; " \fBCONFIG_CPUSETS\fP )
255 This cgroup can be used to bind the processes in a cgroup to
256 a specified set of CPUs and NUMA nodes.
257
258 Further information can be found in the kernel source file
259 .IR Documentation/cgroup\-v1/cpusets.txt .
260 .TP
261 .IR memory " (since Linux 2.6.25; " \fBCONFIG_MEMCG\fP )
262 The memory controller supports reporting and limiting of process memory, kernel
263 memory, and swap used by cgroups.
264
265 Further information can be found in the kernel source file
266 .IR Documentation/cgroup\-v1/memory.txt .
267 .TP
268 .IR devices " (since Linux 2.6.26; " \fBCONFIG_CGROUP_DEVICE\fP )
269 This supports controlling which processes may create (mknod) devices as
270 well as open them for reading or writing.
271 The policies may be specified as whitelists and blacklists.
272 Hierarchy is enforced, so new rules must not
273 violate existing rules for the target or ancestor cgroups.
274
275 Further information can be found in the kernel source file
276 .IR Documentation/cgroup-v1/devices.txt .
277 .TP
278 .IR freezer " (since Linux 2.6.28; " \fBCONFIG_CGROUP_FREEZER\fP )
279 The
280 .IR freezer
281 cgroup can suspend and restore (resume) all processes in a cgroup.
282 Freezing a cgroup
283 .I /A
284 also causes its children, for example, processes in
285 .IR /A/B ,
286 to be frozen.
287
288 Further information can be found in the kernel source file
289 .IR Documentation/cgroup-v1/freezer-subsystem.txt .
290 .TP
291 .IR net_cls " (since Linux 2.6.29; " \fBCONFIG_CGROUP_NET_CLASSID\fP )
292 This places a classid, specified for the cgroup, on network packets
293 created by a cgroup.
294 These classids can then be used in firewall rules,
295 as well as used to shape traffic using
296 .BR tc (8).
297 This applies only to packets
298 leaving the cgroup, not to traffic arriving at the cgroup.
299
300 Further information can be found in the kernel source file
301 .IR Documentation/cgroup-v1/net_cls.txt .
302 .TP
303 .IR blkio " (since Linux 2.6.33; " \fBCONFIG_BLK_CGROUP\fP )
304 The
305 .I blkio
306 cgroup controls and limits access to specified block devices by
307 applying IO control in the form of throttling and upper limits against leaf
308 nodes and intermediate nodes in the storage hierarchy.
309
310 Two policies are available.
311 The first is a proportional-weight time-based division
312 of disk implemented with CFQ.
313 This is in effect for leaf nodes using CFQ.
314 The second is a throttling policy which specifies
315 upper I/O rate limits on a device.
316
317 Further information can be found in the kernel source file
318 .IR Documentation/cgroup-v1/blkio-controller.txt .
319 .TP
320 .IR perf_event " (since Linux 2.6.39; " \fBCONFIG_CGROUP_PERF\fP )
321 This controller allows
322 .I perf
323 monitoring of the set of processes grouped in a cgroup.
324
325 Further information can be found in the kernel source file
326 .IR tools/perf/Documentation/perf-record.txt .
327 .TP
328 .IR net_prio " (since Linux 3.3; " \fBCONFIG_CGROUP_NET_PRIO\fP )
329 This allows priorities to be specified, per network interface, for cgroups.
330
331 Further information can be found in the kernel source file
332 .IR Documentation/cgroup-v1/net_prio.txt .
333 .TP
334 .IR hugetlb " (since Linux 3.5; " \fBCONFIG_CGROUP_HUGETLB\fP )
335 This supports limiting the use of huge pages by cgroups.
336
337 Further information can be found in the kernel source file
338 .IR Documentation/cgroup-v1/hugetlb.txt .
339 .TP
340 .IR pids " (since Linux 4.3; " \fBCONFIG_CGROUP_PIDS\fP )
341 This controller permits limiting the number of process that may be created
342 in a cgroup (and its descendants).
343
344 Further information can be found in the kernel source file
345 .IR Documentation/cgroup-v1/pids.txt .
346 .\"
347 .SS Creating cgroups and moving processes
348 A cgroup filesystem initially contains a single root cgroup, '/',
349 which all processes belong to.
350 A new cgroup is created by creating a directory in the cgroup filesystem:
351
352 mkdir /sys/fs/cgroup/cpu/cg1
353
354 This creates a new empty cgroup.
355
356 A process may be moved to this cgroup by writing its PID into the cgroup's
357 .I cgroup.procs
358 file:
359
360 echo $$ > /sys/fs/cgroup/cpu/cg1/cgroup.procs
361
362 Only one PID at a time should be written to this file.
363
364 Writing the value 0 to a
365 .IR cgroup.procs
366 file causes the writing process to be moved to the corresponding cgroup.
367
368 When writing a PID into the
369 .IR cgroup.procs ,
370 all threads in the process are moved into the new cgroup at once.
371
372 Within a hierarchy, a process can be a member of exactly one cgroup.
373 Writing a process's PID to a
374 .IR cgroup.procs
375 file automatically removes it from the cgroup of
376 which it was previously a member.
377
378 The
379 .I cgroup.procs
380 file can be read to obtain a list of the processes that are
381 members of a cgroup.
382 The returned list of PIDs is not guaranteed to be in order.
383 Nor is it guaranteed to be free of duplicates.
384 (For example, a PID may be recycled while reading from the list.)
385
386 In cgroups v1 (but not cgroups v2), an individual thread can be moved to
387 another cgroup by writing its thread ID
388 (i.e., the kernel thread ID returned by
389 .BR clone (2)
390 and
391 .BR gettid (2))
392 to the
393 .IR tasks
394 file in a cgroup directory.
395 This file can be read to discover the set of threads
396 that are members of the cgroup.
397 This file is not present in cgroup v2 directories.
398 .\"
399 .SS Removing cgroups
400 To remove a cgroup,
401 it must first have no child cgroups and contain no (nonzombie) processes.
402 So long as that is the case, one can simply
403 remove the corresponding directory pathname.
404 Note that files in a cgroup directory cannot and need not be
405 removed.
406 .\"
407 .SS Cgroups v1 release notification
408 Two files can be used to determine whether the kernel provides
409 notifications when a cgroup becomes empty.
410 A cgroup is considered to be empty when it contains no child
411 cgroups and no member processes.
412
413 A special file in the root directory of each cgroup hierarchy,
414 .IR release_agent ,
415 can be used to register the pathname of a program that may be invoked when
416 a cgroup in the hierarchy becomes empty.
417 The pathname of the newly empty cgroup (relative to the cgroup mount point)
418 is provided as the sole command-line argument when the
419 .IR release_agent
420 program is invoked.
421 The
422 .IR release_agent
423 program might remove the cgroup directory,
424 or perhaps repopulate with a process.
425
426 The default value of the
427 .IR release_agent
428 file is empty, meaning that no release agent is invoked.
429
430 Whether or not the
431 .IR release_agent
432 program is invoked when a particular cgroup becomes empty is determined
433 by the value in the
434 .IR notify_on_release
435 file in the corresponding cgroup directory.
436 If this file contains the value 0, then the
437 .IR release_agent
438 program is not invoked.
439 If it contains the value 1, the
440 .IR release_agent
441 program is invoked.
442 The default value for this file in the root cgroup is 0.
443 At the time when a new cgroup is created,
444 the value in this file is inherited from the corresponding file
445 in the parent cgroup.
446 .\"
447 .SS Cgroups version 2
448 In cgroups v2,
449 all mounted controllers reside in a single unified hierarchy.
450 While (different) controllers may be simultaneously
451 mounted under the v1 and v2 hierarchies,
452 it is not possible to mount the same controller simultaneously
453 under both the v1 and the v2 hierarchies.
454
455 The new behaviors in cgroups v2 are summarized here,
456 and in some cases elaborated in the following subsections.
457 .IP 1. 3
458 Cgroups v2 provides a unified hierarchy against
459 which all controllers are mounted.
460 .IP 2.
461 "Internal" processes are not permitted.
462 With the exception of the root cgroup, processes may reside
463 only in leaf nodes (cgroups that do not themselves contain child cgroups).
464 .IP 3.
465 Active cgroups must be specified via the files
466 .IR cgroup.controllers
467 and
468 .IR cgroup.subtree_control .
469 .IP 4.
470 The
471 .I tasks
472 file has been removed.
473 In addition, the
474 .I cgroup.clone_children
475 file that is employed by the
476 .I cpuset
477 controller has been removed.
478 .IP 5.
479 An improved mechanism for notification of empty cgroups is provided by the
480 .IR cgroup.events
481 file.
482 .PP
483 For more changes, see the
484 .I Documentation/cgroup-v2.txt
485 file in the kernel source.
486 .\"
487 .SS Cgroups v2 unified hierarchy
488 In cgroups v1, the ability to mount different controllers
489 against different hierarchies was intended to allow great flexibility
490 for application design.
491 In practice, though, the flexibility turned out to less useful than expected,
492 and in many cases added complexity.
493 Therefore, in cgroups v2,
494 all available controllers are mounted against a single hierarchy.
495 The available controllers are automatically mounted,
496 meaning that it is not necessary (or possible) to specify the controllers
497 when mounting the cgroup v2 filesystem using a command such as the following:
498
499 mount -t cgroup2 none /mnt/cgroup2
500
501 A cgroup v2 controller is available only if it is not currently in use
502 via a mount against a cgroup v1 hierarchy.
503 Or, to put things another way, it is not possible to employ
504 the same controller against both a v1 hierarchy and the unified v2 hierarchy.
505 .\"
506 .SS Cgroups v2 """no internal processes""" rule
507 With the exception of the root cgroup, processes may reside
508 only in leaf nodes (cgroups that do not themselves contain child cgroups).
509 This avoids the need to decide how to partition resources between
510 processes which are members of cgroup A and processes in child cgroups of A.
511
512 For instance, if cgroup
513 .I /cg1/cg2
514 exists, then a process may reside in
515 .IR /cg1/cg2 ,
516 but not in
517 .IR /cg1 .
518 This is to avoid an ambiguity in cgroups v1
519 with respect to the delegation of resources between processes in
520 .I /cg1
521 and its child cgroups.
522 The recommended approach in cgroups v2 is to create a subdirectory called
523 .I leaf
524 for any nonleaf cgroup which should contain processes, but no child cgroups.
525 Thus, processes which previously would have gone into
526 .I /cg1
527 would now go into
528 .IR /cg1/leaf .
529 This has the advantage of making explicit
530 the relationship between processes in
531 .I /cg1/leaf
532 and
533 .IR /cg1 's
534 other children.
535 .\"
536 .SS Cgroups v2 subtree control
537 When a cgroup
538 .I A/b
539 is created, its
540 .IR cgroup.controllers
541 file contains the list of controllers which were active in its parent, A.
542 This is the list of controllers which are available to this cgroup.
543 No controllers are active until they are enabled through the
544 .IR cgroup.subtree_control
545 file, by writing the list of space-delimited names of the controllers,
546 each preceded by '+' (to enable) or '\-' (to disable).
547 If the
548 .I freezer
549 controller is not enabled in
550 .IR /A/B ,
551 then it cannot be enabled in
552 .IR /A/B/C .
553 .\"
554 .SS Cgroups v2 cgroup.events file
555 With cgroups v2, a new mechanism is provided to obtain notification
556 about when a cgroup becomes empty.
557 The cgroups v1
558 .IR release_agent
559 and
560 .IR notify_on_release
561 files are removed, and replaced by a new, more general-purpose file,
562 .IR cgroup.events .
563 This file contains key-value pairs
564 (delimited by newline characters, with the key and value separated by spaces)
565 that identify events or state for a cgroup.
566 Currently, only one key appears in this file,
567 .IR populated ,
568 which has either the value 0,
569 meaning that the cgroup (and its descendants)
570 contain no (nonzombie) processes,
571 or 1, meaning that the cgroup contains member processes.
572
573 The
574 .IR cgroup.events
575 file can be monitored, in order to receive notification when a cgroup
576 transitions between the populated and unpopulated states (or vice versa).
577 When monitoring this file using
578 .BR inotify (7),
579 transitions generate
580 .BR IN_MODIFY
581 events, and when monitoring the file using
582 .BR poll (2),
583 transitions generate
584 .B POLLPRI
585 events.
586
587 The cgroups v2
588 .IR notify_on_release
589 mechanism offers at least two advantages over the cgroups v1
590 .IR release_agent
591 mechanism.
592 First, it allows for cheaper notification,
593 since a single process can monitor multiple
594 .IR cgroup.events
595 files.
596 By contrast, the cgroups v1 mechanism requires the creation
597 of a process for each notification.
598 Second, notification can be delegated to a process that lives inside
599 a container associated with the newly empty cgroup.
600 .\"
601 .SS /proc files
602 .TP
603 .IR /proc/cgroups " (since Linux 2.6.24)"
604 This file contains information about the controllers
605 that are compiled into the kernel.
606 An example of the contents of this file (reformatted for readability)
607 is the following:
608
609 .nf
610 .in +4n
611 #subsys_name hierarchy num_cgroups enabled
612 cpuset 4 1 1
613 cpu 8 1 1
614 cpuacct 8 1 1
615 blkio 6 1 1
616 memory 3 1 1
617 devices 10 84 1
618 freezer 7 1 1
619 net_cls 9 1 1
620 perf_event 5 1 1
621 net_prio 9 1 1
622 hugetlb 0 1 0
623 pids 2 1 1
624 .in
625 .fi
626
627 The fields in this file are, from left to right:
628 .RS
629 .IP 1. 3
630 The name of the controller.
631 .IP 2.
632 The unique ID of the cgroup hierarchy on which this controller is mounted.
633 If multiple cgroups v1 controllers are bound to the same hierarchy,
634 then each will show the same hierarchy ID in this field.
635 The value in this field will be 0 if:
636 .RS 5
637 .IP a) 3
638 the controller is not mounted on a cgroups v1 hierarchy;
639 .IP b)
640 the controller is bound to the cgroups v2 single unified hierarchy; or
641 .IP c)
642 the controller is disabled (see below).
643 .RE
644 .IP 3.
645 The number of control groups in this hierarchy using this controller.
646 .IP 4.
647 This field contains the value 1 if this controller is enabled,
648 or 0 if it has been disabled (via the
649 .IR cgroup_disable
650 kernel command-line boot parameter).
651 .RE
652 .TP
653 .IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
654 This file describes control groups to which the process
655 with the corresponding PID belongs.
656 The displayed information differs for
657 cgroups version 1 and version 2 hierarchies.
658
659 For each cgroup hierarchy of which the process is a member,
660 there is one entry containing three
661 colon-separated fields of the form:
662
663 hierarchy-ID:controller-list:cgroup-path
664
665 For example:
666 .nf
667 .ft CW
668
669 5:cpuacct,cpu,cpuset:/daemons
670 .ft
671 .fi
672 .IP
673 The colon-separated fields are, from left to right:
674 .RS
675 .IP 1. 3
676 For cgroups version 1 hierarchies,
677 this field contains a unique hierarchy ID number
678 that can be matched to a hierarchy ID in
679 .IR /proc/cgroups .
680 For the cgroups version 2 hierarchy, this field contains the value 0.
681 .IP 2.
682 For cgroups version 1 hierarchies,
683 this field contains a comma-separated list of the controllers
684 bound to the hierarchy.
685 For the cgroups version 2 hierarchy, this field is empty.
686 .IP 3.
687 This field contains the pathname of the control group in the hierarchy
688 to which the process belongs.
689 This pathname is relative to the mount point of the hierarchy.
690 .RE
691 .SH ERRORS
692 The following errors can occur for
693 .BR mount (2):
694 .TP
695 .B EBUSY
696 An attempt to mount a cgroup version 1 filesystem specified neither the
697 .I name=
698 option (to mount a named hierarchy) nor a controller name (or
699 .IR all ).
700 .SH NOTES
701 A child process created via
702 .BR fork (2)
703 inherits its parent's cgroup memberships.
704 A process's cgroup memberships are preserved across
705 .BR execve (2).
706 .SH SEE ALSO
707 .BR prlimit (1),
708 .BR systemd (1),
709 .BR clone (2),
710 .BR ioprio_set (2),
711 .BR perf_event_open (2),
712 .BR setrlimit (2),
713 .BR cgroup_namespaces (7),
714 .BR cpuset (7),
715 .BR namespaces (7),
716 .BR sched (7),
717 .BR user_namespaces (7)