diff options
Diffstat (limited to 'Documentation/cgroups/memory.txt')
-rw-r--r-- | Documentation/cgroups/memory.txt | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 02ab997a1ed2..5b3fdda3ad6b 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt @@ -57,6 +57,7 @@ Brief summary of control files. memory.memsw.usage_in_bytes # show current res_counter usage for memory+Swap (See 5.5 for details) memory.limit_in_bytes # set/show limit of memory usage + memory.low_limit_in_bytes # set/show low limit for memory reclaim memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage memory.failcnt # show the number of memory usage hits limits memory.memsw.failcnt # show the number of memory+Swap hits limits @@ -236,23 +237,26 @@ it by cgroup. 2.5 Reclaim Each cgroup maintains a per cgroup LRU which has the same structure as -global VM. When a cgroup goes over its limit, we first try -to reclaim memory from the cgroup so as to make space for the new -pages that the cgroup has touched. If the reclaim is unsuccessful, -an OOM routine is invoked to select and kill the bulkiest task in the -cgroup. (See 10. OOM Control below.) - -The reclaim algorithm has not been modified for cgroups, except that -pages that are selected for reclaiming come from the per-cgroup LRU -list. - -NOTE: Reclaim does not work for the root cgroup, since we cannot set any -limits on the root cgroup. - -Note2: When panic_on_oom is set to "2", the whole system will panic. - -When oom event notifier is registered, event will be delivered. -(See oom_control section) +global VM. Cgroups can get reclaimed basically under two conditions + - under global memory pressure when all cgroups are reclaimed + proportionally wrt. their LRU size in a round robin fashion + - when a cgroup or its hierarchical parent (see 6. Hierarchical support) + hits hard limit. If the reclaim is unsuccessful, an OOM routine is invoked + to select and kill the bulkiest task in the hiearchy. (See 10. OOM Control + below.) + +Groups might be also protected from both global and limit reclaim by +low_limit_in_bytes knob. If the limit is non-zero the reclaim logic +doesn't include groups (and their subgroups - see 6. Hierarchy support) +which are bellow the low limit if there is other eligible cgroup in the +reclaimed hierarchy. If all groups which participate reclaim are under +their low limits then all of them are reclaimed and the low limit is +ignored. + +Note: When panic_on_oom is set to "2", the whole system will panic. + +When oom event notifier is registered, event will be delivered to the root +of the memory pressure which cannot be handled (See oom_control section) 2.6 Locking @@ -473,6 +477,9 @@ About use_hierarchy, see Section 6. write will still return success. In this case, it is expected that memory.kmem.usage_in_bytes == memory.usage_in_bytes. + Please note that this knob is considered deprecated and will be removed + in the future. + About use_hierarchy, see Section 6. 5.2 stat file |