diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/cgroups/memory.txt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 1f59a1a38bd9..268ab08222dd 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -468,7 +468,24 @@ Note: More type of pages(e.g. file cache, shmem,) will be supported by other | |||
468 | - All of moving charge operations are done under cgroup_mutex. It's not good | 468 | - All of moving charge operations are done under cgroup_mutex. It's not good |
469 | behavior to hold the mutex too long, so we may need some trick. | 469 | behavior to hold the mutex too long, so we may need some trick. |
470 | 470 | ||
471 | 9. TODO | 471 | 9. Memory thresholds |
472 | |||
473 | Memory controler implements memory thresholds using cgroups notification | ||
474 | API (see cgroups.txt). It allows to register multiple memory and memsw | ||
475 | thresholds and gets notifications when it crosses. | ||
476 | |||
477 | To register a threshold application need: | ||
478 | - create an eventfd using eventfd(2); | ||
479 | - open memory.usage_in_bytes or memory.memsw.usage_in_bytes; | ||
480 | - write string like "<event_fd> <memory.usage_in_bytes> <threshold>" to | ||
481 | cgroup.event_control. | ||
482 | |||
483 | Application will be notified through eventfd when memory usage crosses | ||
484 | threshold in any direction. | ||
485 | |||
486 | It's applicable for root and non-root cgroup. | ||
487 | |||
488 | 10. TODO | ||
472 | 489 | ||
473 | 1. Add support for accounting huge pages (as a separate controller) | 490 | 1. Add support for accounting huge pages (as a separate controller) |
474 | 2. Make per-cgroup scanner reclaim not-shared pages first | 491 | 2. Make per-cgroup scanner reclaim not-shared pages first |