aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/controllers
diff options
context:
space:
mode:
authorBalbir Singh <balbir@linux.vnet.ibm.com>2008-02-07 03:13:57 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:18 -0500
commit0eea10301708c64a6b793894c156e21ddd15eb64 (patch)
treea0dcbe47d48d35ec0554faa5f86068cfab94ca6e /Documentation/controllers
parent66e1707bc34609f626e2e7b4fe7e454c9748bad5 (diff)
Memory controller improve user interface
Change the interface to use bytes instead of pages. Page sizes can vary across platforms and configurations. A new strategy routine has been added to the resource counters infrastructure to format the data as desired. Suggested by David Rientjes, Andrew Morton and Herbert Poetzl Tested on a UML setup with the config for memory control enabled. [kamezawa.hiroyu@jp.fujitsu.com: possible race fix in res_counter] Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Pavel Emelianov <xemul@openvz.org> Cc: Paul Menage <menage@google.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Kirill Korotaev <dev@sw.ru> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: David Rientjes <rientjes@google.com> Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/controllers')
-rw-r--r--Documentation/controllers/memory.txt29
1 files changed, 24 insertions, 5 deletions
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt
index 7e27baacca7..61df8f81c80 100644
--- a/Documentation/controllers/memory.txt
+++ b/Documentation/controllers/memory.txt
@@ -165,11 +165,30 @@ c. Enable CONFIG_CGROUP_MEM_CONT
165 165
166Since now we're in the 0 cgroup, 166Since now we're in the 0 cgroup,
167We can alter the memory limit: 167We can alter the memory limit:
168# echo -n 6000 > /cgroups/0/memory.limit 168# echo -n 4M > /cgroups/0/memory.limit_in_bytes
169
170NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
171mega or gigabytes.
172
173# cat /cgroups/0/memory.limit_in_bytes
1744194304 Bytes
175
176NOTE: The interface has now changed to display the usage in bytes
177instead of pages
169 178
170We can check the usage: 179We can check the usage:
171# cat /cgroups/0/memory.usage 180# cat /cgroups/0/memory.usage_in_bytes
17225 1811216512 Bytes
182
183A successful write to this file does not guarantee a successful set of
184this limit to the value written into the file. This can be due to a
185number of factors, such as rounding up to page boundaries or the total
186availability of memory on the system. The user is required to re-read
187this file after a write to guarantee the value committed by the kernel.
188
189# echo -n 1 > memory.limit_in_bytes
190# cat memory.limit_in_bytes
1914096 Bytes
173 192
174The memory.failcnt field gives the number of times that the cgroup limit was 193The memory.failcnt field gives the number of times that the cgroup limit was
175exceeded. 194exceeded.
@@ -206,8 +225,8 @@ cgroup might have some charge associated with it, even though all
206tasks have migrated away from it. If some pages are still left, after following 225tasks have migrated away from it. If some pages are still left, after following
207the steps listed in sections 4.1 and 4.2, check the Swap Cache usage in 226the steps listed in sections 4.1 and 4.2, check the Swap Cache usage in
208/proc/meminfo to see if the Swap Cache usage is showing up in the 227/proc/meminfo to see if the Swap Cache usage is showing up in the
209cgroups memory.usage counter. A simple test of swapoff -a and swapon -a 228cgroups memory.usage_in_bytes counter. A simple test of swapoff -a and
210should free any pending Swap Cache usage. 229swapon -a should free any pending Swap Cache usage.
211 230
2124.4 Choosing what to account -- Page Cache (unmapped) vs RSS (mapped)? 2314.4 Choosing what to account -- Page Cache (unmapped) vs RSS (mapped)?
213 232