diff options
Diffstat (limited to 'Documentation/controllers/memory.txt')
-rw-r--r-- | Documentation/controllers/memory.txt | 29 |
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 | ||
166 | Since now we're in the 0 cgroup, | 166 | Since now we're in the 0 cgroup, |
167 | We can alter the memory limit: | 167 | We can alter the memory limit: |
168 | # echo -n 6000 > /cgroups/0/memory.limit | 168 | # echo -n 4M > /cgroups/0/memory.limit_in_bytes |
169 | |||
170 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, | ||
171 | mega or gigabytes. | ||
172 | |||
173 | # cat /cgroups/0/memory.limit_in_bytes | ||
174 | 4194304 Bytes | ||
175 | |||
176 | NOTE: The interface has now changed to display the usage in bytes | ||
177 | instead of pages | ||
169 | 178 | ||
170 | We can check the usage: | 179 | We can check the usage: |
171 | # cat /cgroups/0/memory.usage | 180 | # cat /cgroups/0/memory.usage_in_bytes |
172 | 25 | 181 | 1216512 Bytes |
182 | |||
183 | A successful write to this file does not guarantee a successful set of | ||
184 | this limit to the value written into the file. This can be due to a | ||
185 | number of factors, such as rounding up to page boundaries or the total | ||
186 | availability of memory on the system. The user is required to re-read | ||
187 | this 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 | ||
191 | 4096 Bytes | ||
173 | 192 | ||
174 | The memory.failcnt field gives the number of times that the cgroup limit was | 193 | The memory.failcnt field gives the number of times that the cgroup limit was |
175 | exceeded. | 194 | exceeded. |
@@ -206,8 +225,8 @@ cgroup might have some charge associated with it, even though all | |||
206 | tasks have migrated away from it. If some pages are still left, after following | 225 | tasks have migrated away from it. If some pages are still left, after following |
207 | the steps listed in sections 4.1 and 4.2, check the Swap Cache usage in | 226 | the 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 |
209 | cgroups memory.usage counter. A simple test of swapoff -a and swapon -a | 228 | cgroups memory.usage_in_bytes counter. A simple test of swapoff -a and |
210 | should free any pending Swap Cache usage. | 229 | swapon -a should free any pending Swap Cache usage. |
211 | 230 | ||
212 | 4.4 Choosing what to account -- Page Cache (unmapped) vs RSS (mapped)? | 231 | 4.4 Choosing what to account -- Page Cache (unmapped) vs RSS (mapped)? |
213 | 232 | ||