diff options
Diffstat (limited to 'Documentation/controllers')
-rw-r--r-- | Documentation/controllers/memory.txt | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 61df8f81c803..b5bbea92a61a 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt | |||
@@ -9,8 +9,7 @@ d. Provides a double LRU: global memory pressure causes reclaim from the | |||
9 | global LRU; a cgroup on hitting a limit, reclaims from the per | 9 | global LRU; a cgroup on hitting a limit, reclaims from the per |
10 | cgroup LRU | 10 | cgroup LRU |
11 | 11 | ||
12 | NOTE: Page Cache (unmapped) also includes Swap Cache pages as a subset | 12 | NOTE: Swap Cache (unmapped) is not accounted now. |
13 | and will not be referred to explicitly in the rest of the documentation. | ||
14 | 13 | ||
15 | Benefits and Purpose of the memory controller | 14 | Benefits and Purpose of the memory controller |
16 | 15 | ||
@@ -144,7 +143,7 @@ list. | |||
144 | The memory controller uses the following hierarchy | 143 | The memory controller uses the following hierarchy |
145 | 144 | ||
146 | 1. zone->lru_lock is used for selecting pages to be isolated | 145 | 1. zone->lru_lock is used for selecting pages to be isolated |
147 | 2. mem->lru_lock protects the per cgroup LRU | 146 | 2. mem->per_zone->lru_lock protects the per cgroup LRU (per zone) |
148 | 3. lock_page_cgroup() is used to protect page->page_cgroup | 147 | 3. lock_page_cgroup() is used to protect page->page_cgroup |
149 | 148 | ||
150 | 3. User Interface | 149 | 3. User Interface |
@@ -193,6 +192,15 @@ this file after a write to guarantee the value committed by the kernel. | |||
193 | The memory.failcnt field gives the number of times that the cgroup limit was | 192 | The memory.failcnt field gives the number of times that the cgroup limit was |
194 | exceeded. | 193 | exceeded. |
195 | 194 | ||
195 | The memory.stat file gives accounting information. Now, the number of | ||
196 | caches, RSS and Active pages/Inactive pages are shown. | ||
197 | |||
198 | The memory.force_empty gives an interface to drop *all* charges by force. | ||
199 | |||
200 | # echo -n 1 > memory.force_empty | ||
201 | |||
202 | will drop all charges in cgroup. Currently, this is maintained for test. | ||
203 | |||
196 | 4. Testing | 204 | 4. Testing |
197 | 205 | ||
198 | Balbir posted lmbench, AIM9, LTP and vmmstress results [10] and [11]. | 206 | Balbir posted lmbench, AIM9, LTP and vmmstress results [10] and [11]. |
@@ -222,11 +230,8 @@ reclaimed. | |||
222 | 230 | ||
223 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a | 231 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a |
224 | cgroup might have some charge associated with it, even though all | 232 | cgroup might have some charge associated with it, even though all |
225 | tasks have migrated away from it. If some pages are still left, after following | 233 | tasks have migrated away from it. Such charges are automatically dropped at |
226 | the steps listed in sections 4.1 and 4.2, check the Swap Cache usage in | 234 | rmdir() if there are no tasks. |
227 | /proc/meminfo to see if the Swap Cache usage is showing up in the | ||
228 | cgroups memory.usage_in_bytes counter. A simple test of swapoff -a and | ||
229 | swapon -a should free any pending Swap Cache usage. | ||
230 | 235 | ||
231 | 4.4 Choosing what to account -- Page Cache (unmapped) vs RSS (mapped)? | 236 | 4.4 Choosing what to account -- Page Cache (unmapped) vs RSS (mapped)? |
232 | 237 | ||
@@ -238,15 +243,11 @@ echo -n 1 > memory.control_type | |||
238 | 5. TODO | 243 | 5. TODO |
239 | 244 | ||
240 | 1. Add support for accounting huge pages (as a separate controller) | 245 | 1. Add support for accounting huge pages (as a separate controller) |
241 | 2. Improve the user interface to accept/display memory limits in KB or MB | 246 | 2. Make per-cgroup scanner reclaim not-shared pages first |
242 | rather than pages (since page sizes can differ across platforms/machines). | 247 | 3. Teach controller to account for shared-pages |
243 | 3. Make cgroup lists per-zone | 248 | 4. Start reclamation when the limit is lowered |
244 | 4. Make per-cgroup scanner reclaim not-shared pages first | 249 | 5. Start reclamation in the background when the limit is |
245 | 5. Teach controller to account for shared-pages | ||
246 | 6. Start reclamation when the limit is lowered | ||
247 | 7. Start reclamation in the background when the limit is | ||
248 | not yet hit but the usage is getting closer | 250 | not yet hit but the usage is getting closer |
249 | 8. Create per zone LRU lists per cgroup | ||
250 | 251 | ||
251 | Summary | 252 | Summary |
252 | 253 | ||