diff options
author | Glauber Costa <glommer@parallels.com> | 2011-12-11 16:47:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-12 19:03:55 -0500 |
commit | e5671dfae59b165e2adfd4dfbdeab11ac8db5bda (patch) | |
tree | daf5570e8da71934970daa4b2044c6f13ee98f9d /Documentation/cgroups | |
parent | 08e34eb14fe4cfd934b5c169a7682a969457c4ea (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.txt | 40 |
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 | ||
50 | Brief summary of control files. | 51 | Brief 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 | |||
75 | 1. History | 82 | 1. History |
76 | 83 | ||
77 | The memory controller has a long history. A request for comments for the memory | 84 | The 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 | ||
265 | 2.7 Kernel Memory Extension (CONFIG_CGROUP_MEM_RES_CTLR_KMEM) | ||
266 | |||
267 | With the Kernel memory extension, the Memory Controller is able to limit | ||
268 | the amount of kernel memory used by the system. Kernel memory is fundamentally | ||
269 | different than user memory, since it can't be swapped out, which makes it | ||
270 | possible to DoS the system by consuming too much of this precious resource. | ||
271 | |||
272 | Some kernel memory resources may be accounted and limited separately from the | ||
273 | main "kmem" resource. For instance, a slab cache that is considered important | ||
274 | enough to be limited separately may have its own knobs. | ||
275 | |||
276 | Kernel memory limits are not imposed for the root cgroup. Usage for the root | ||
277 | cgroup may or may not be accounted. | ||
278 | |||
279 | Memory limits as specified by the standard Memory Controller may or may not | ||
280 | take kernel memory into consideration. This is achieved through the file | ||
281 | memory.independent_kmem_limit. A Value different than 0 will allow for kernel | ||
282 | memory to be controlled separately. | ||
283 | |||
284 | When kernel memory limits are not independent, the limit values set in | ||
285 | memory.kmem files are ignored. | ||
286 | |||
287 | Currently no soft limit is implemented for kernel memory. It is future work | ||
288 | to trigger slab reclaim when those limits are reached. | ||
289 | |||
290 | 2.7.1 Current Kernel Memory resources accounted | ||
291 | |||
292 | None | ||
293 | |||
258 | 3. User Interface | 294 | 3. User Interface |
259 | 295 | ||
260 | 0. Configuration | 296 | 0. Configuration |