diff options
Diffstat (limited to 'Documentation/controllers')
-rw-r--r-- | Documentation/controllers/memory.txt | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 58f32c166fac..54253b7a8db2 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt | |||
@@ -237,11 +237,30 @@ reclaimed. | |||
237 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a | 237 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a |
238 | cgroup might have some charge associated with it, even though all | 238 | cgroup might have some charge associated with it, even though all |
239 | tasks have migrated away from it. | 239 | tasks have migrated away from it. |
240 | Such charges are moved to its parent as much as possible and freed if parent | 240 | Such charges are freed(at default) or moved to its parent. When moved, |
241 | is full. Both of RSS and CACHES are moved to parent. | 241 | both of RSS and CACHES are moved to parent. |
242 | If both of them are busy, rmdir() returns -EBUSY. | 242 | If both of them are busy, rmdir() returns -EBUSY. See 5.1 Also. |
243 | 243 | ||
244 | 5. TODO | 244 | 5. Misc. interfaces. |
245 | |||
246 | 5.1 force_empty | ||
247 | memory.force_empty interface is provided to make cgroup's memory usage empty. | ||
248 | You can use this interface only when the cgroup has no tasks. | ||
249 | When writing anything to this | ||
250 | |||
251 | # echo 0 > memory.force_empty | ||
252 | |||
253 | Almost all pages tracked by this memcg will be unmapped and freed. Some of | ||
254 | pages cannot be freed because it's locked or in-use. Such pages are moved | ||
255 | to parent and this cgroup will be empty. But this may return -EBUSY in | ||
256 | some too busy case. | ||
257 | |||
258 | Typical use case of this interface is that calling this before rmdir(). | ||
259 | Because rmdir() moves all pages to parent, some out-of-use page caches can be | ||
260 | moved to the parent. If you want to avoid that, force_empty will be useful. | ||
261 | |||
262 | |||
263 | 6. TODO | ||
245 | 264 | ||
246 | 1. Add support for accounting huge pages (as a separate controller) | 265 | 1. Add support for accounting huge pages (as a separate controller) |
247 | 2. Make per-cgroup scanner reclaim not-shared pages first | 266 | 2. Make per-cgroup scanner reclaim not-shared pages first |