From ac9cb147eba4c7b23dfa8ae0573909dec010df5f Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Wed, 10 Mar 2010 15:22:36 -0800 Subject: [PATCH] --- yaml --- r: 187231 b: refs/heads/master c: 1e111452d457ceedec8a57fc3d45b1312e736fba h: refs/heads/master i: 187229: 785d416ca281051953705b0f10ab56e7b1c0a50a 187227: 4af0acb3ced88743e6038eb00a5ae2980cdc5079 187223: 61ec4b75aa9130f72b9bd3077207692ef63730cd 187215: e003ff9dd29449c2bb417ec4cc0c317941ba3d59 187199: d69791ec55eaafc4bf6b1cddb7a4cf3aab3d369e v: v3 --- [refs] | 2 +- trunk/Documentation/cgroups/memcg_test.txt | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 52c1f3676f5b..a62b2731d5b6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1d8fd973a41942bc760dd21581e24117bc1dd063 +refs/heads/master: 1e111452d457ceedec8a57fc3d45b1312e736fba diff --git a/trunk/Documentation/cgroups/memcg_test.txt b/trunk/Documentation/cgroups/memcg_test.txt index e01148886b5b..4d32e0ed1917 100644 --- a/trunk/Documentation/cgroups/memcg_test.txt +++ b/trunk/Documentation/cgroups/memcg_test.txt @@ -396,3 +396,24 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. memory.stat of both A and B. See 8.2 of Documentation/cgroups/memory.txt to see what value should be written to move_charge_at_immigrate. + + 9.10 Memory thresholds + Memory controler implements memory thresholds using cgroups notification + API. You can use Documentation/cgroups/cgroup_event_listener.c to test + it. + + (Shell-A) Create cgroup and run event listener + # mkdir /cgroup/A + # ./cgroup_event_listener /cgroup/A/memory.usage_in_bytes 5M + + (Shell-B) Add task to cgroup and try to allocate and free memory + # echo $$ >/cgroup/A/tasks + # a="$(dd if=/dev/zero bs=1M count=10)" + # a= + + You will see message from cgroup_event_listener every time you cross + the thresholds. + + Use /cgroup/A/memory.memsw.usage_in_bytes to test memsw thresholds. + + It's good idea to test root cgroup as well.