Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187231
b: refs/heads/master
c: 1e11145
h: refs/heads/master
i:
  187229: 785d416
  187227: 4af0acb
  187223: 61ec4b7
  187215: e003ff9
  187199: d69791e
v: v3
  • Loading branch information
Kirill A. Shutemov authored and Linus Torvalds committed Mar 12, 2010
1 parent a57feb1 commit ac9cb14
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d8fd973a41942bc760dd21581e24117bc1dd063
refs/heads/master: 1e111452d457ceedec8a57fc3d45b1312e736fba
21 changes: 21 additions & 0 deletions trunk/Documentation/cgroups/memcg_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit ac9cb14

Please sign in to comment.