aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups/memory.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/cgroups/memory.txt')
-rw-r--r--Documentation/cgroups/memory.txt56
1 files changed, 54 insertions, 2 deletions
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index b871f2552b45..e726fb0df719 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -262,10 +262,12 @@ some of the pages cached in the cgroup (page cache pages).
2624.2 Task migration 2624.2 Task migration
263 263
264When a task migrates from one cgroup to another, it's charge is not 264When a task migrates from one cgroup to another, it's charge is not
265carried forward. The pages allocated from the original cgroup still 265carried forward by default. The pages allocated from the original cgroup still
266remain charged to it, the charge is dropped when the page is freed or 266remain charged to it, the charge is dropped when the page is freed or
267reclaimed. 267reclaimed.
268 268
269Note: You can move charges of a task along with task migration. See 8.
270
2694.3 Removing a cgroup 2714.3 Removing a cgroup
270 272
271A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a 273A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a
@@ -414,7 +416,57 @@ NOTE1: Soft limits take effect over a long period of time, since they involve
414NOTE2: It is recommended to set the soft limit always below the hard limit, 416NOTE2: It is recommended to set the soft limit always below the hard limit,
415 otherwise the hard limit will take precedence. 417 otherwise the hard limit will take precedence.
416 418
4178. TODO 4198. Move charges at task migration
420
421Users can move charges associated with a task along with task migration, that
422is, uncharge task's pages from the old cgroup and charge them to the new cgroup.
423
4248.1 Interface
425
426This feature is disabled by default. It can be enabled(and disabled again) by
427writing to memory.move_charge_at_immigrate of the destination cgroup.
428
429If you want to enable it:
430
431# echo (some positive value) > memory.move_charge_at_immigrate
432
433Note: Each bits of move_charge_at_immigrate has its own meaning about what type
434 of charges should be moved. See 8.2 for details.
435Note: Charges are moved only when you move mm->owner, IOW, a leader of a thread
436 group.
437Note: If we cannot find enough space for the task in the destination cgroup, we
438 try to make space by reclaiming memory. Task migration may fail if we
439 cannot make enough space.
440Note: It can take several seconds if you move charges in giga bytes order.
441
442And if you want disable it again:
443
444# echo 0 > memory.move_charge_at_immigrate
445
4468.2 Type of charges which can be move
447
448Each bits of move_charge_at_immigrate has its own meaning about what type of
449charges should be moved.
450
451 bit | what type of charges would be moved ?
452 -----+------------------------------------------------------------------------
453 0 | A charge of an anonymous page(or swap of it) used by the target task.
454 | Those pages and swaps must be used only by the target task. You must
455 | enable Swap Extension(see 2.4) to enable move of swap charges.
456
457Note: Those pages and swaps must be charged to the old cgroup.
458Note: More type of pages(e.g. file cache, shmem,) will be supported by other
459 bits in future.
460
4618.3 TODO
462
463- Add support for other types of pages(e.g. file cache, shmem, etc.).
464- Implement madvise(2) to let users decide the vma to be moved or not to be
465 moved.
466- All of moving charge operations are done under cgroup_mutex. It's not good
467 behavior to hold the mutex too long, so we may need some trick.
468
4699. TODO
418 470
4191. Add support for accounting huge pages (as a separate controller) 4711. Add support for accounting huge pages (as a separate controller)
4202. Make per-cgroup scanner reclaim not-shared pages first 4722. Make per-cgroup scanner reclaim not-shared pages first