diff options
Diffstat (limited to 'Documentation/controllers/memory.txt')
-rw-r--r-- | Documentation/controllers/memory.txt | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 6015347b41e2..866b9cd9a959 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt | |||
@@ -1,4 +1,8 @@ | |||
1 | Memory Controller | 1 | Memory Resource Controller |
2 | |||
3 | NOTE: The Memory Resource Controller has been generically been referred | ||
4 | to as the memory controller in this document. Do not confuse memory controller | ||
5 | used here with the memory controller that is used in hardware. | ||
2 | 6 | ||
3 | Salient features | 7 | Salient features |
4 | 8 | ||
@@ -152,7 +156,7 @@ The memory controller uses the following hierarchy | |||
152 | 156 | ||
153 | a. Enable CONFIG_CGROUPS | 157 | a. Enable CONFIG_CGROUPS |
154 | b. Enable CONFIG_RESOURCE_COUNTERS | 158 | b. Enable CONFIG_RESOURCE_COUNTERS |
155 | c. Enable CONFIG_CGROUP_MEM_CONT | 159 | c. Enable CONFIG_CGROUP_MEM_RES_CTLR |
156 | 160 | ||
157 | 1. Prepare the cgroups | 161 | 1. Prepare the cgroups |
158 | # mkdir -p /cgroups | 162 | # mkdir -p /cgroups |
@@ -164,7 +168,7 @@ c. Enable CONFIG_CGROUP_MEM_CONT | |||
164 | 168 | ||
165 | Since now we're in the 0 cgroup, | 169 | Since now we're in the 0 cgroup, |
166 | We can alter the memory limit: | 170 | We can alter the memory limit: |
167 | # echo -n 4M > /cgroups/0/memory.limit_in_bytes | 171 | # echo 4M > /cgroups/0/memory.limit_in_bytes |
168 | 172 | ||
169 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, | 173 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, |
170 | mega or gigabytes. | 174 | mega or gigabytes. |
@@ -185,7 +189,7 @@ number of factors, such as rounding up to page boundaries or the total | |||
185 | availability of memory on the system. The user is required to re-read | 189 | availability of memory on the system. The user is required to re-read |
186 | this file after a write to guarantee the value committed by the kernel. | 190 | this file after a write to guarantee the value committed by the kernel. |
187 | 191 | ||
188 | # echo -n 1 > memory.limit_in_bytes | 192 | # echo 1 > memory.limit_in_bytes |
189 | # cat memory.limit_in_bytes | 193 | # cat memory.limit_in_bytes |
190 | 4096 | 194 | 4096 |
191 | 195 | ||
@@ -197,7 +201,7 @@ caches, RSS and Active pages/Inactive pages are shown. | |||
197 | 201 | ||
198 | The memory.force_empty gives an interface to drop *all* charges by force. | 202 | The memory.force_empty gives an interface to drop *all* charges by force. |
199 | 203 | ||
200 | # echo -n 1 > memory.force_empty | 204 | # echo 1 > memory.force_empty |
201 | 205 | ||
202 | will drop all charges in cgroup. Currently, this is maintained for test. | 206 | will drop all charges in cgroup. Currently, this is maintained for test. |
203 | 207 | ||