]> Pileus Git - ~andy/linux/blobdiff - Documentation/cgroups/memcg_test.txt
Merge branch 'wimax-2.6.35.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky...
[~andy/linux] / Documentation / cgroups / memcg_test.txt
index e01148886b5b8df8f2812f5823f68a09bdeb7408..b7eececfb195d28e6c38f352baa3053a82f7d8c4 100644 (file)
@@ -244,7 +244,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
          we have to check if OLDPAGE/NEWPAGE is a valid page after commit().
 
 8. LRU
-        Each memcg has its own private LRU. Now, it's handling is under global
+        Each memcg has its own private LRU. Now, its handling is under global
        VM's control (means that it's handled under global zone->lru_lock).
        Almost all routines around memcg's LRU is called by global LRU's
        list management functions under zone->lru_lock().
@@ -337,7 +337,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
        race and lock dependency with other cgroup subsystems.
 
        example)
-       # mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices
+       # mount -t cgroup none /cgroup -o cpuset,memory,cpu,devices
 
        and do task move, mkdir, rmdir etc...under this.
 
@@ -348,7 +348,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
 
        For example, test like following is good.
        (Shell-A)
-       # mount -t cgroup none /cgroup -t memory
+       # mount -t cgroup none /cgroup -o memory
        # mkdir /cgroup/test
        # echo 40M > /cgroup/test/memory.limit_in_bytes
        # echo 0 > /cgroup/test/tasks
@@ -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.