aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2010-03-10 18:22:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:37 -0500
commit2e72b6347c9459e6cff5634ddc815485bae6985f (patch)
tree48ceef47f2cd0d33f2a1dd816c1a05ca2cb3e0e2 /Documentation/cgroups
parent378ce724bc2a0ef1243e11c09d58a70bb6be007a (diff)
memcg: implement memory thresholds
It allows to register multiple memory and memsw thresholds and gets notifications when it crosses. To register a threshold application need: - create an eventfd; - open memory.usage_in_bytes or memory.memsw.usage_in_bytes; - write string like "<event_fd> <memory.usage_in_bytes> <threshold>" to cgroup.event_control. Application will be notified through eventfd when memory usage crosses threshold in any direction. It's applicable for root and non-root cgroup. It uses stats to track memory usage, simmilar to soft limits. It checks if we need to send event to userspace on every 100 page in/out. I guess it's good compromise between performance and accuracy of thresholds. [akpm@linux-foundation.org: coding-style fixes] [nishimura@mxp.nes.nec.co.jp: fix documentation merge issue] Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: Dan Malek <dan@embeddedalley.com> Cc: Vladislav Buzov <vbuzov@embeddedalley.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/cgroups')
-rw-r--r--Documentation/cgroups/memory.txt19
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
4719. TODO 4719. Memory thresholds
472
473Memory controler implements memory thresholds using cgroups notification
474API (see cgroups.txt). It allows to register multiple memory and memsw
475thresholds and gets notifications when it crosses.
476
477To 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
483Application will be notified through eventfd when memory usage crosses
484threshold in any direction.
485
486It's applicable for root and non-root cgroup.
487
48810. TODO
472 489
4731. Add support for accounting huge pages (as a separate controller) 4901. Add support for accounting huge pages (as a separate controller)
4742. Make per-cgroup scanner reclaim not-shared pages first 4912. Make per-cgroup scanner reclaim not-shared pages first