memcg: improve performance in moving swap charge
[deliverable/linux.git] / Documentation / cgroups / cgroups.txt
CommitLineData
ddbcc7e8
PM
1 CGROUPS
2 -------
3
45ce80fb
LZ
4Written by Paul Menage <menage@google.com> based on
5Documentation/cgroups/cpusets.txt
ddbcc7e8
PM
6
7Original copyright statements from cpusets.txt:
8Portions Copyright (C) 2004 BULL SA.
9Portions Copyright (c) 2004-2006 Silicon Graphics, Inc.
10Modified by Paul Jackson <pj@sgi.com>
11Modified by Christoph Lameter <clameter@sgi.com>
12
13CONTENTS:
14=========
15
161. Control Groups
17 1.1 What are cgroups ?
18 1.2 Why are cgroups needed ?
19 1.3 How are cgroups implemented ?
20 1.4 What does notify_on_release do ?
21 1.5 How do I use cgroups ?
222. Usage Examples and Syntax
23 2.1 Basic Usage
24 2.2 Attaching processes
8ca712ea 25 2.3 Mounting hierarchies by name
ddbcc7e8
PM
263. Kernel API
27 3.1 Overview
28 3.2 Synchronization
29 3.3 Subsystem API
304. Questions
31
321. Control Groups
d19e0583 33=================
ddbcc7e8
PM
34
351.1 What are cgroups ?
36----------------------
37
38Control Groups provide a mechanism for aggregating/partitioning sets of
39tasks, and all their future children, into hierarchical groups with
40specialized behaviour.
41
42Definitions:
43
44A *cgroup* associates a set of tasks with a set of parameters for one
45or more subsystems.
46
47A *subsystem* is a module that makes use of the task grouping
48facilities provided by cgroups to treat groups of tasks in
49particular ways. A subsystem is typically a "resource controller" that
50schedules a resource or applies per-cgroup limits, but it may be
51anything that wants to act on a group of processes, e.g. a
52virtualization subsystem.
53
54A *hierarchy* is a set of cgroups arranged in a tree, such that
55every task in the system is in exactly one of the cgroups in the
56hierarchy, and a set of subsystems; each subsystem has system-specific
57state attached to each cgroup in the hierarchy. Each hierarchy has
58an instance of the cgroup virtual filesystem associated with it.
59
caa790ba 60At any one time there may be multiple active hierarchies of task
ddbcc7e8
PM
61cgroups. Each hierarchy is a partition of all tasks in the system.
62
63User level code may create and destroy cgroups by name in an
64instance of the cgroup virtual file system, specify and query to
65which cgroup a task is assigned, and list the task pids assigned to
66a cgroup. Those creations and assignments only affect the hierarchy
67associated with that instance of the cgroup file system.
68
69On their own, the only use for cgroups is for simple job
70tracking. The intention is that other subsystems hook into the generic
71cgroup support to provide new attributes for cgroups, such as
72accounting/limiting the resources which processes in a cgroup can
45ce80fb 73access. For example, cpusets (see Documentation/cgroups/cpusets.txt) allows
ddbcc7e8
PM
74you to associate a set of CPUs and a set of memory nodes with the
75tasks in each cgroup.
76
771.2 Why are cgroups needed ?
78----------------------------
79
80There are multiple efforts to provide process aggregations in the
81Linux kernel, mainly for resource tracking purposes. Such efforts
82include cpusets, CKRM/ResGroups, UserBeanCounters, and virtual server
83namespaces. These all require the basic notion of a
84grouping/partitioning of processes, with newly forked processes ending
85in the same group (cgroup) as their parent process.
86
87The kernel cgroup patch provides the minimum essential kernel
88mechanisms required to efficiently implement such groups. It has
89minimal impact on the system fast paths, and provides hooks for
90specific subsystems such as cpusets to provide additional behaviour as
91desired.
92
93Multiple hierarchy support is provided to allow for situations where
94the division of tasks into cgroups is distinctly different for
95different subsystems - having parallel hierarchies allows each
96hierarchy to be a natural division of tasks, without having to handle
97complex combinations of tasks that would be present if several
98unrelated subsystems needed to be forced into the same tree of
99cgroups.
100
101At one extreme, each resource controller or subsystem could be in a
102separate hierarchy; at the other extreme, all subsystems
103would be attached to the same hierarchy.
104
105As an example of a scenario (originally proposed by vatsa@in.ibm.com)
106that can benefit from multiple hierarchies, consider a large
107university server with various users - students, professors, system
108tasks etc. The resource planning for this server could be along the
109following lines:
110
111 CPU : Top cpuset
112 / \
113 CPUSet1 CPUSet2
114 | |
115 (Profs) (Students)
116
117 In addition (system tasks) are attached to topcpuset (so
118 that they can run anywhere) with a limit of 20%
119
120 Memory : Professors (50%), students (30%), system (20%)
121
122 Disk : Prof (50%), students (30%), system (20%)
123
124 Network : WWW browsing (20%), Network File System (60%), others (20%)
125 / \
126 Prof (15%) students (5%)
127
caa790ba 128Browsers like Firefox/Lynx go into the WWW network class, while (k)nfsd go
ddbcc7e8
PM
129into NFS network class.
130
caa790ba 131At the same time Firefox/Lynx will share an appropriate CPU/Memory class
ddbcc7e8
PM
132depending on who launched it (prof/student).
133
134With the ability to classify tasks differently for different resources
135(by putting those resource subsystems in different hierarchies) then
136the admin can easily set up a script which receives exec notifications
137and depending on who is launching the browser he can
138
139 # echo browser_pid > /mnt/<restype>/<userclass>/tasks
140
141With only a single hierarchy, he now would potentially have to create
142a separate cgroup for every browser launched and associate it with
143approp network and other resource class. This may lead to
144proliferation of such cgroups.
145
146Also lets say that the administrator would like to give enhanced network
147access temporarily to a student's browser (since it is night and the user
d19e0583 148wants to do online gaming :)) OR give one of the students simulation
ddbcc7e8
PM
149apps enhanced CPU power,
150
d19e0583 151With ability to write pids directly to resource classes, it's just a
ddbcc7e8
PM
152matter of :
153
154 # echo pid > /mnt/network/<new_class>/tasks
155 (after some time)
156 # echo pid > /mnt/network/<orig_class>/tasks
157
158Without this ability, he would have to split the cgroup into
159multiple separate ones and then associate the new cgroups with the
160new resource classes.
161
162
163
1641.3 How are cgroups implemented ?
165---------------------------------
166
167Control Groups extends the kernel as follows:
168
169 - Each task in the system has a reference-counted pointer to a
170 css_set.
171
172 - A css_set contains a set of reference-counted pointers to
173 cgroup_subsys_state objects, one for each cgroup subsystem
174 registered in the system. There is no direct link from a task to
175 the cgroup of which it's a member in each hierarchy, but this
176 can be determined by following pointers through the
177 cgroup_subsys_state objects. This is because accessing the
178 subsystem state is something that's expected to happen frequently
179 and in performance-critical code, whereas operations that require a
180 task's actual cgroup assignments (in particular, moving between
817929ec
PM
181 cgroups) are less common. A linked list runs through the cg_list
182 field of each task_struct using the css_set, anchored at
183 css_set->tasks.
ddbcc7e8
PM
184
185 - A cgroup hierarchy filesystem can be mounted for browsing and
186 manipulation from user space.
187
188 - You can list all the tasks (by pid) attached to any cgroup.
189
190The implementation of cgroups requires a few, simple hooks
191into the rest of the kernel, none in performance critical paths:
192
193 - in init/main.c, to initialize the root cgroups and initial
194 css_set at system boot.
195
196 - in fork and exit, to attach and detach a task from its css_set.
197
198In addition a new file system, of type "cgroup" may be mounted, to
199enable browsing and modifying the cgroups presently known to the
200kernel. When mounting a cgroup hierarchy, you may specify a
201comma-separated list of subsystems to mount as the filesystem mount
202options. By default, mounting the cgroup filesystem attempts to
203mount a hierarchy containing all registered subsystems.
204
205If an active hierarchy with exactly the same set of subsystems already
206exists, it will be reused for the new mount. If no existing hierarchy
207matches, and any of the requested subsystems are in use in an existing
208hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy
209is activated, associated with the requested subsystems.
210
211It's not currently possible to bind a new subsystem to an active
212cgroup hierarchy, or to unbind a subsystem from an active cgroup
213hierarchy. This may be possible in future, but is fraught with nasty
214error-recovery issues.
215
216When a cgroup filesystem is unmounted, if there are any
217child cgroups created below the top-level cgroup, that hierarchy
218will remain active even though unmounted; if there are no
219child cgroups then the hierarchy will be deactivated.
220
221No new system calls are added for cgroups - all support for
222querying and modifying cgroups is via this cgroup file system.
223
224Each task under /proc has an added file named 'cgroup' displaying,
225for each active hierarchy, the subsystem names and the cgroup name
226as the path relative to the root of the cgroup file system.
227
228Each cgroup is represented by a directory in the cgroup file system
229containing the following files describing that cgroup:
230
7823da36
PM
231 - tasks: list of tasks (by pid) attached to that cgroup. This list
232 is not guaranteed to be sorted. Writing a thread id into this file
233 moves the thread into this cgroup.
234 - cgroup.procs: list of tgids in the cgroup. This list is not
235 guaranteed to be sorted or free of duplicate tgids, and userspace
236 should sort/uniquify the list if this property is required.
237 Writing a tgid into this file moves all threads with that tgid into
238 this cgroup.
d19e0583
LZ
239 - notify_on_release flag: run the release agent on exit?
240 - release_agent: the path to use for release notifications (this file
241 exists in the top cgroup only)
ddbcc7e8
PM
242
243Other subsystems such as cpusets may add additional files in each
d19e0583 244cgroup dir.
ddbcc7e8
PM
245
246New cgroups are created using the mkdir system call or shell
247command. The properties of a cgroup, such as its flags, are
248modified by writing to the appropriate file in that cgroups
249directory, as listed above.
250
251The named hierarchical structure of nested cgroups allows partitioning
252a large system into nested, dynamically changeable, "soft-partitions".
253
254The attachment of each task, automatically inherited at fork by any
255children of that task, to a cgroup allows organizing the work load
256on a system into related sets of tasks. A task may be re-attached to
257any other cgroup, if allowed by the permissions on the necessary
258cgroup file system directories.
259
260When a task is moved from one cgroup to another, it gets a new
261css_set pointer - if there's an already existing css_set with the
262desired collection of cgroups then that group is reused, else a new
b851ee79
LZ
263css_set is allocated. The appropriate existing css_set is located by
264looking into a hash table.
ddbcc7e8 265
817929ec
PM
266To allow access from a cgroup to the css_sets (and hence tasks)
267that comprise it, a set of cg_cgroup_link objects form a lattice;
268each cg_cgroup_link is linked into a list of cg_cgroup_links for
d19e0583 269a single cgroup on its cgrp_link_list field, and a list of
817929ec
PM
270cg_cgroup_links for a single css_set on its cg_link_list.
271
272Thus the set of tasks in a cgroup can be listed by iterating over
273each css_set that references the cgroup, and sub-iterating over
274each css_set's task set.
275
ddbcc7e8
PM
276The use of a Linux virtual file system (vfs) to represent the
277cgroup hierarchy provides for a familiar permission and name space
278for cgroups, with a minimum of additional kernel code.
279
2801.4 What does notify_on_release do ?
281------------------------------------
282
ddbcc7e8
PM
283If the notify_on_release flag is enabled (1) in a cgroup, then
284whenever the last task in the cgroup leaves (exits or attaches to
285some other cgroup) and the last child cgroup of that cgroup
286is removed, then the kernel runs the command specified by the contents
287of the "release_agent" file in that hierarchy's root directory,
288supplying the pathname (relative to the mount point of the cgroup
289file system) of the abandoned cgroup. This enables automatic
290removal of abandoned cgroups. The default value of
291notify_on_release in the root cgroup at system boot is disabled
292(0). The default value of other cgroups at creation is the current
293value of their parents notify_on_release setting. The default value of
294a cgroup hierarchy's release_agent path is empty.
295
2961.5 How do I use cgroups ?
297--------------------------
298
299To start a new job that is to be contained within a cgroup, using
300the "cpuset" cgroup subsystem, the steps are something like:
301
302 1) mkdir /dev/cgroup
303 2) mount -t cgroup -ocpuset cpuset /dev/cgroup
304 3) Create the new cgroup by doing mkdir's and write's (or echo's) in
305 the /dev/cgroup virtual file system.
306 4) Start a task that will be the "founding father" of the new job.
307 5) Attach that task to the new cgroup by writing its pid to the
308 /dev/cgroup tasks file for that cgroup.
309 6) fork, exec or clone the job tasks from this founding father task.
310
311For example, the following sequence of commands will setup a cgroup
312named "Charlie", containing just CPUs 2 and 3, and Memory Node 1,
313and then start a subshell 'sh' in that cgroup:
314
315 mount -t cgroup cpuset -ocpuset /dev/cgroup
316 cd /dev/cgroup
317 mkdir Charlie
318 cd Charlie
0f146a76
DG
319 /bin/echo 2-3 > cpuset.cpus
320 /bin/echo 1 > cpuset.mems
ddbcc7e8
PM
321 /bin/echo $$ > tasks
322 sh
323 # The subshell 'sh' is now running in cgroup Charlie
324 # The next line should display '/Charlie'
325 cat /proc/self/cgroup
326
3272. Usage Examples and Syntax
328============================
329
3302.1 Basic Usage
331---------------
332
333Creating, modifying, using the cgroups can be done through the cgroup
334virtual filesystem.
335
caa790ba 336To mount a cgroup hierarchy with all available subsystems, type:
ddbcc7e8
PM
337# mount -t cgroup xxx /dev/cgroup
338
339The "xxx" is not interpreted by the cgroup code, but will appear in
340/proc/mounts so may be any useful identifying string that you like.
341
342To mount a cgroup hierarchy with just the cpuset and numtasks
343subsystems, type:
b6719ec1 344# mount -t cgroup -o cpuset,memory hier1 /dev/cgroup
ddbcc7e8
PM
345
346To change the set of subsystems bound to a mounted hierarchy, just
347remount with different options:
b6719ec1 348# mount -o remount,cpuset,ns hier1 /dev/cgroup
ddbcc7e8 349
b6719ec1
LZ
350Now memory is removed from the hierarchy and ns is added.
351
352Note this will add ns to the hierarchy but won't remove memory or
353cpuset, because the new options are appended to the old ones:
354# mount -o remount,ns /dev/cgroup
355
356To Specify a hierarchy's release_agent:
357# mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \
358 xxx /dev/cgroup
359
360Note that specifying 'release_agent' more than once will return failure.
ddbcc7e8
PM
361
362Note that changing the set of subsystems is currently only supported
363when the hierarchy consists of a single (root) cgroup. Supporting
364the ability to arbitrarily bind/unbind subsystems from an existing
365cgroup hierarchy is intended to be implemented in the future.
366
367Then under /dev/cgroup you can find a tree that corresponds to the
368tree of the cgroups in the system. For instance, /dev/cgroup
369is the cgroup that holds the whole system.
370
b6719ec1
LZ
371If you want to change the value of release_agent:
372# echo "/sbin/new_release_agent" > /dev/cgroup/release_agent
373
374It can also be changed via remount.
375
ddbcc7e8
PM
376If you want to create a new cgroup under /dev/cgroup:
377# cd /dev/cgroup
378# mkdir my_cgroup
379
380Now you want to do something with this cgroup.
381# cd my_cgroup
382
383In this directory you can find several files:
384# ls
7823da36 385cgroup.procs notify_on_release tasks
d19e0583 386(plus whatever files added by the attached subsystems)
ddbcc7e8
PM
387
388Now attach your shell to this cgroup:
389# /bin/echo $$ > tasks
390
391You can also create cgroups inside your cgroup by using mkdir in this
392directory.
393# mkdir my_sub_cs
394
395To remove a cgroup, just use rmdir:
396# rmdir my_sub_cs
397
398This will fail if the cgroup is in use (has cgroups inside, or
399has processes attached, or is held alive by other subsystem-specific
400reference).
401
4022.2 Attaching processes
403-----------------------
404
405# /bin/echo PID > tasks
406
407Note that it is PID, not PIDs. You can only attach ONE task at a time.
408If you have several tasks to attach, you have to do it one after another:
409
410# /bin/echo PID1 > tasks
411# /bin/echo PID2 > tasks
412 ...
413# /bin/echo PIDn > tasks
414
bef67c5a
LZ
415You can attach the current shell task by echoing 0:
416
417# echo 0 > tasks
418
c6d57f33
PM
4192.3 Mounting hierarchies by name
420--------------------------------
421
422Passing the name=<x> option when mounting a cgroups hierarchy
423associates the given name with the hierarchy. This can be used when
424mounting a pre-existing hierarchy, in order to refer to it by name
425rather than by its set of active subsystems. Each hierarchy is either
426nameless, or has a unique name.
427
428The name should match [\w.-]+
429
430When passing a name=<x> option for a new hierarchy, you need to
431specify subsystems manually; the legacy behaviour of mounting all
432subsystems when none are explicitly specified is not supported when
433you give a subsystem a name.
434
435The name of the subsystem appears as part of the hierarchy description
436in /proc/mounts and /proc/<pid>/cgroups.
437
438
ddbcc7e8
PM
4393. Kernel API
440=============
441
4423.1 Overview
443------------
444
445Each kernel subsystem that wants to hook into the generic cgroup
446system needs to create a cgroup_subsys object. This contains
447various methods, which are callbacks from the cgroup system, along
448with a subsystem id which will be assigned by the cgroup system.
449
450Other fields in the cgroup_subsys object include:
451
452- subsys_id: a unique array index for the subsystem, indicating which
d19e0583 453 entry in cgroup->subsys[] this subsystem should be managing.
ddbcc7e8 454
d19e0583
LZ
455- name: should be initialized to a unique subsystem name. Should be
456 no longer than MAX_CGROUP_TYPE_NAMELEN.
ddbcc7e8 457
d19e0583
LZ
458- early_init: indicate if the subsystem needs early initialization
459 at system boot.
ddbcc7e8
PM
460
461Each cgroup object created by the system has an array of pointers,
462indexed by subsystem id; this pointer is entirely managed by the
463subsystem; the generic cgroup code will never touch this pointer.
464
4653.2 Synchronization
466-------------------
467
468There is a global mutex, cgroup_mutex, used by the cgroup
469system. This should be taken by anything that wants to modify a
470cgroup. It may also be taken to prevent cgroups from being
471modified, but more specific locks may be more appropriate in that
472situation.
473
474See kernel/cgroup.c for more details.
475
476Subsystems can take/release the cgroup_mutex via the functions
ddbcc7e8
PM
477cgroup_lock()/cgroup_unlock().
478
479Accessing a task's cgroup pointer may be done in the following ways:
480- while holding cgroup_mutex
481- while holding the task's alloc_lock (via task_lock())
482- inside an rcu_read_lock() section via rcu_dereference()
483
4843.3 Subsystem API
d19e0583 485-----------------
ddbcc7e8
PM
486
487Each subsystem should:
488
489- add an entry in linux/cgroup_subsys.h
490- define a cgroup_subsys object called <name>_subsys
491
e6a1105b 492If a subsystem can be compiled as a module, it should also have in its
cf5d5941
BB
493module initcall a call to cgroup_load_subsys(), and in its exitcall a
494call to cgroup_unload_subsys(). It should also set its_subsys.module =
495THIS_MODULE in its .c file.
e6a1105b 496
ddbcc7e8
PM
497Each subsystem may export the following methods. The only mandatory
498methods are create/destroy. Any others that are null are presumed to
499be successful no-ops.
500
d19e0583
LZ
501struct cgroup_subsys_state *create(struct cgroup_subsys *ss,
502 struct cgroup *cgrp)
8dc4f3e1 503(cgroup_mutex held by caller)
ddbcc7e8
PM
504
505Called to create a subsystem state object for a cgroup. The
506subsystem should allocate its subsystem state object for the passed
507cgroup, returning a pointer to the new object on success or a
508negative error code. On success, the subsystem pointer should point to
509a structure of type cgroup_subsys_state (typically embedded in a
510larger subsystem-specific object), which will be initialized by the
511cgroup system. Note that this will be called at initialization to
512create the root subsystem state for this subsystem; this case can be
513identified by the passed cgroup object having a NULL parent (since
514it's the root of the hierarchy) and may be an appropriate place for
515initialization code.
516
d19e0583 517void destroy(struct cgroup_subsys *ss, struct cgroup *cgrp)
8dc4f3e1 518(cgroup_mutex held by caller)
ddbcc7e8 519
8dc4f3e1
PM
520The cgroup system is about to destroy the passed cgroup; the subsystem
521should do any necessary cleanup and free its subsystem state
522object. By the time this method is called, the cgroup has already been
523unlinked from the file system and from the child list of its parent;
524cgroup->parent is still valid. (Note - can also be called for a
525newly-created cgroup if an error occurs after this subsystem's
526create() method has been called for the new cgroup).
ddbcc7e8 527
ec64f515 528int pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
d19e0583
LZ
529
530Called before checking the reference count on each subsystem. This may
531be useful for subsystems which have some extra references even if
ec64f515
KH
532there are not tasks in the cgroup. If pre_destroy() returns error code,
533rmdir() will fail with it. From this behavior, pre_destroy() can be
534called multiple times against a cgroup.
d19e0583
LZ
535
536int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
be367d09 537 struct task_struct *task, bool threadgroup)
8dc4f3e1 538(cgroup_mutex held by caller)
ddbcc7e8
PM
539
540Called prior to moving a task into a cgroup; if the subsystem
541returns an error, this will abort the attach operation. If a NULL
542task is passed, then a successful result indicates that *any*
543unspecified task can be moved into the cgroup. Note that this isn't
544called on a fork. If this method returns 0 (success) then this should
2468c723
DN
545remain valid while the caller holds cgroup_mutex and it is ensured that either
546attach() or cancel_attach() will be called in future. If threadgroup is
be367d09
BB
547true, then a successful result indicates that all threads in the given
548thread's threadgroup can be moved together.
ddbcc7e8 549
2468c723
DN
550void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
551 struct task_struct *task, bool threadgroup)
552(cgroup_mutex held by caller)
553
554Called when a task attach operation has failed after can_attach() has succeeded.
555A subsystem whose can_attach() has some side-effects should provide this
556function, so that the subsytem can implement a rollback. If not, not necessary.
557This will be called only about subsystems whose can_attach() operation have
558succeeded.
559
d19e0583 560void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
be367d09
BB
561 struct cgroup *old_cgrp, struct task_struct *task,
562 bool threadgroup)
18e7f1f0 563(cgroup_mutex held by caller)
ddbcc7e8
PM
564
565Called after the task has been attached to the cgroup, to allow any
566post-attachment activity that requires memory allocations or blocking.
be367d09
BB
567If threadgroup is true, the subsystem should take care of all threads
568in the specified thread's threadgroup. Currently does not support any
569subsystem that might need the old_cgrp for every thread in the group.
ddbcc7e8
PM
570
571void fork(struct cgroup_subsy *ss, struct task_struct *task)
ddbcc7e8 572
e8d55fde 573Called when a task is forked into a cgroup.
ddbcc7e8
PM
574
575void exit(struct cgroup_subsys *ss, struct task_struct *task)
ddbcc7e8 576
d19e0583 577Called during task exit.
ddbcc7e8 578
d19e0583 579int populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
18e7f1f0 580(cgroup_mutex held by caller)
ddbcc7e8
PM
581
582Called after creation of a cgroup to allow a subsystem to populate
583the cgroup directory with file entries. The subsystem should make
584calls to cgroup_add_file() with objects of type cftype (see
585include/linux/cgroup.h for details). Note that although this
586method can return an error code, the error code is currently not
587always handled well.
588
d19e0583 589void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp)
18e7f1f0 590(cgroup_mutex held by caller)
697f4161 591
caa790ba 592Called at the end of cgroup_clone() to do any parameter
697f4161
PM
593initialization which might be required before a task could attach. For
594example in cpusets, no task may attach before 'cpus' and 'mems' are set
595up.
596
ddbcc7e8 597void bind(struct cgroup_subsys *ss, struct cgroup *root)
999cd8a4 598(cgroup_mutex and ss->hierarchy_mutex held by caller)
ddbcc7e8
PM
599
600Called when a cgroup subsystem is rebound to a different hierarchy
601and root cgroup. Currently this will only involve movement between
602the default hierarchy (which never has sub-cgroups) and a hierarchy
603that is being created/destroyed (and hence has no sub-cgroups).
604
6054. Questions
606============
607
608Q: what's up with this '/bin/echo' ?
609A: bash's builtin 'echo' command does not check calls to write() against
610 errors. If you use it in the cgroup file system, you won't be
611 able to tell whether a command succeeded or failed.
612
613Q: When I attach processes, only the first of the line gets really attached !
614A: We can only return one error code per call to write(). So you should also
615 put only ONE pid.
616
This page took 0.306298 seconds and 5 git commands to generate.