diff options
-rw-r--r-- | Documentation/controllers/memory.txt | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 05fe29ab1e58..09e1c737d285 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt | |||
@@ -289,8 +289,44 @@ will be charged as a new owner of it. | |||
289 | Because rmdir() moves all pages to parent, some out-of-use page caches can be | 289 | Because rmdir() moves all pages to parent, some out-of-use page caches can be |
290 | moved to the parent. If you want to avoid that, force_empty will be useful. | 290 | moved to the parent. If you want to avoid that, force_empty will be useful. |
291 | 291 | ||
292 | 6. Hierarchy support | ||
292 | 293 | ||
293 | 6. TODO | 294 | The memory controller supports a deep hierarchy and hierarchical accounting. |
295 | The hierarchy is created by creating the appropriate cgroups in the | ||
296 | cgroup filesystem. Consider for example, the following cgroup filesystem | ||
297 | hierarchy | ||
298 | |||
299 | root | ||
300 | / | \ | ||
301 | / | \ | ||
302 | a b c | ||
303 | | \ | ||
304 | | \ | ||
305 | d e | ||
306 | |||
307 | In the diagram above, with hierarchical accounting enabled, all memory | ||
308 | usage of e, is accounted to its ancestors up until the root (i.e, c and root), | ||
309 | that has memory.use_hierarchy enabled. If one of the ancestors goes over its | ||
310 | limit, the reclaim algorithm reclaims from the tasks in the ancestor and the | ||
311 | children of the ancestor. | ||
312 | |||
313 | 6.1 Enabling hierarchical accounting and reclaim | ||
314 | |||
315 | The memory controller by default disables the hierarchy feature. Support | ||
316 | can be enabled by writing 1 to memory.use_hierarchy file of the root cgroup | ||
317 | |||
318 | # echo 1 > memory.use_hierarchy | ||
319 | |||
320 | The feature can be disabled by | ||
321 | |||
322 | # echo 0 > memory.use_hierarchy | ||
323 | |||
324 | NOTE1: Enabling/disabling will fail if the cgroup already has other | ||
325 | cgroups created below it. | ||
326 | |||
327 | NOTE2: This feature can be enabled/disabled per subtree. | ||
328 | |||
329 | 7. TODO | ||
294 | 330 | ||
295 | 1. Add support for accounting huge pages (as a separate controller) | 331 | 1. Add support for accounting huge pages (as a separate controller) |
296 | 2. Make per-cgroup scanner reclaim not-shared pages first | 332 | 2. Make per-cgroup scanner reclaim not-shared pages first |