diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/cgroups/cgroups.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index c0358c30c64f..fd588ff0e296 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -23,6 +23,7 @@ CONTENTS: | |||
23 | 2.1 Basic Usage | 23 | 2.1 Basic Usage |
24 | 2.2 Attaching processes | 24 | 2.2 Attaching processes |
25 | 2.3 Mounting hierarchies by name | 25 | 2.3 Mounting hierarchies by name |
26 | 2.4 Notification API | ||
26 | 3. Kernel API | 27 | 3. Kernel API |
27 | 3.1 Overview | 28 | 3.1 Overview |
28 | 3.2 Synchronization | 29 | 3.2 Synchronization |
@@ -435,6 +436,25 @@ you give a subsystem a name. | |||
435 | The name of the subsystem appears as part of the hierarchy description | 436 | The name of the subsystem appears as part of the hierarchy description |
436 | in /proc/mounts and /proc/<pid>/cgroups. | 437 | in /proc/mounts and /proc/<pid>/cgroups. |
437 | 438 | ||
439 | 2.4 Notification API | ||
440 | -------------------- | ||
441 | |||
442 | There is mechanism which allows to get notifications about changing | ||
443 | status of a cgroup. | ||
444 | |||
445 | To register new notification handler you need: | ||
446 | - create a file descriptor for event notification using eventfd(2); | ||
447 | - open a control file to be monitored (e.g. memory.usage_in_bytes); | ||
448 | - write "<event_fd> <control_fd> <args>" to cgroup.event_control. | ||
449 | Interpretation of args is defined by control file implementation; | ||
450 | |||
451 | eventfd will be woken up by control file implementation or when the | ||
452 | cgroup is removed. | ||
453 | |||
454 | To unregister notification handler just close eventfd. | ||
455 | |||
456 | NOTE: Support of notifications should be implemented for the control | ||
457 | file. See documentation for the subsystem. | ||
438 | 458 | ||
439 | 3. Kernel API | 459 | 3. Kernel API |
440 | ============= | 460 | ============= |