aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups
diff options
context:
space:
mode:
authorGlauber Costa <glommer@parallels.com>2011-12-11 16:47:01 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-12 19:03:55 -0500
commite5671dfae59b165e2adfd4dfbdeab11ac8db5bda (patch)
treedaf5570e8da71934970daa4b2044c6f13ee98f9d /Documentation/cgroups
parent08e34eb14fe4cfd934b5c169a7682a969457c4ea (diff)
Basic kernel memory functionality for the Memory Controller
This patch lays down the foundation for the kernel memory component of the Memory Controller. As of today, I am only laying down the following files: * memory.independent_kmem_limit * memory.kmem.limit_in_bytes (currently ignored) * memory.kmem.usage_in_bytes (always zero) Signed-off-by: Glauber Costa <glommer@parallels.com> CC: Kirill A. Shutemov <kirill@shutemov.name> CC: Paul Menage <paul@paulmenage.org> CC: Greg Thelen <gthelen@google.com> CC: Johannes Weiner <jweiner@redhat.com> CC: Michal Hocko <mhocko@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/cgroups')
-rw-r--r--Documentation/cgroups/memory.txt40
1 files changed, 38 insertions, 2 deletions
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index cc0ebc5241b3..f2453241142b 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -44,8 +44,9 @@ Features:
44 - oom-killer disable knob and oom-notifier 44 - oom-killer disable knob and oom-notifier
45 - Root cgroup has no limit controls. 45 - Root cgroup has no limit controls.
46 46
47 Kernel memory and Hugepages are not under control yet. We just manage 47 Hugepages is not under control yet. We just manage pages on LRU. To add more
48 pages on LRU. To add more controls, we have to take care of performance. 48 controls, we have to take care of performance. Kernel memory support is work
49 in progress, and the current version provides basically functionality.
49 50
50Brief summary of control files. 51Brief summary of control files.
51 52
@@ -56,8 +57,11 @@ Brief summary of control files.
56 (See 5.5 for details) 57 (See 5.5 for details)
57 memory.memsw.usage_in_bytes # show current res_counter usage for memory+Swap 58 memory.memsw.usage_in_bytes # show current res_counter usage for memory+Swap
58 (See 5.5 for details) 59 (See 5.5 for details)
60 memory.kmem.usage_in_bytes # show current res_counter usage for kmem only.
61 (See 2.7 for details)
59 memory.limit_in_bytes # set/show limit of memory usage 62 memory.limit_in_bytes # set/show limit of memory usage
60 memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage 63 memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage
64 memory.kmem.limit_in_bytes # if allowed, set/show limit of kernel memory
61 memory.failcnt # show the number of memory usage hits limits 65 memory.failcnt # show the number of memory usage hits limits
62 memory.memsw.failcnt # show the number of memory+Swap hits limits 66 memory.memsw.failcnt # show the number of memory+Swap hits limits
63 memory.max_usage_in_bytes # show max memory usage recorded 67 memory.max_usage_in_bytes # show max memory usage recorded
@@ -72,6 +76,9 @@ Brief summary of control files.
72 memory.oom_control # set/show oom controls. 76 memory.oom_control # set/show oom controls.
73 memory.numa_stat # show the number of memory usage per numa node 77 memory.numa_stat # show the number of memory usage per numa node
74 78
79 memory.independent_kmem_limit # select whether or not kernel memory limits are
80 independent of user limits
81
751. History 821. History
76 83
77The memory controller has a long history. A request for comments for the memory 84The memory controller has a long history. A request for comments for the memory
@@ -255,6 +262,35 @@ When oom event notifier is registered, event will be delivered.
255 per-zone-per-cgroup LRU (cgroup's private LRU) is just guarded by 262 per-zone-per-cgroup LRU (cgroup's private LRU) is just guarded by
256 zone->lru_lock, it has no lock of its own. 263 zone->lru_lock, it has no lock of its own.
257 264
2652.7 Kernel Memory Extension (CONFIG_CGROUP_MEM_RES_CTLR_KMEM)
266
267With the Kernel memory extension, the Memory Controller is able to limit
268the amount of kernel memory used by the system. Kernel memory is fundamentally
269different than user memory, since it can't be swapped out, which makes it
270possible to DoS the system by consuming too much of this precious resource.
271
272Some kernel memory resources may be accounted and limited separately from the
273main "kmem" resource. For instance, a slab cache that is considered important
274enough to be limited separately may have its own knobs.
275
276Kernel memory limits are not imposed for the root cgroup. Usage for the root
277cgroup may or may not be accounted.
278
279Memory limits as specified by the standard Memory Controller may or may not
280take kernel memory into consideration. This is achieved through the file
281memory.independent_kmem_limit. A Value different than 0 will allow for kernel
282memory to be controlled separately.
283
284When kernel memory limits are not independent, the limit values set in
285memory.kmem files are ignored.
286
287Currently no soft limit is implemented for kernel memory. It is future work
288to trigger slab reclaim when those limits are reached.
289
2902.7.1 Current Kernel Memory resources accounted
291
292None
293
2583. User Interface 2943. User Interface
259 295
2600. Configuration 2960. Configuration