aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/controllers/memory.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/controllers/memory.txt')
-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 7e27baacca7b..61df8f81c803 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