aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups
diff options
context:
space:
mode:
authorDaisuke Nishimura <nishimura@mxp.nes.nec.co.jp>2010-05-26 17:42:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 12:12:43 -0400
commit87946a72283be3de936adc754b7007df7d3e6aeb (patch)
tree0593c87ba36bae13d6a6d5dda65ebb41354954f8 /Documentation/cgroups
parent90254a65833b67502d14736410b3857a15535c67 (diff)
memcg: move charge of file pages
This patch adds support for moving charge of file pages, which include normal file, tmpfs file and swaps of tmpfs file. It's enabled by setting bit 1 of <target cgroup>/memory.move_charge_at_immigrate. Unlike the case of anonymous pages, file pages(and swaps) in the range mmapped by the task will be moved even if the task hasn't done page fault, i.e. they might not be the task's "RSS", but other task's "RSS" that maps the same file. And mapcount of the page is ignored(the page can be moved even if page_mapcount(page) > 1). So, conditions that the page/swap should be met to be moved is that it must be in the range mmapped by the target task and it must be charged to the old cgroup. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: fix warning] Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/cgroups')
-rw-r--r--Documentation/cgroups/memory.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 44e7ded33448..5e028870ee8a 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -454,21 +454,27 @@ And if you want disable it again:
4548.2 Type of charges which can be move 4548.2 Type of charges which can be move
455 455
456Each bits of move_charge_at_immigrate has its own meaning about what type of 456Each bits of move_charge_at_immigrate has its own meaning about what type of
457charges should be moved. 457charges should be moved. But in any cases, it must be noted that an account of
458a page or a swap can be moved only when it is charged to the task's current(old)
459memory cgroup.
458 460
459 bit | what type of charges would be moved ? 461 bit | what type of charges would be moved ?
460 -----+------------------------------------------------------------------------ 462 -----+------------------------------------------------------------------------
461 0 | A charge of an anonymous page(or swap of it) used by the target task. 463 0 | A charge of an anonymous page(or swap of it) used by the target task.
462 | Those pages and swaps must be used only by the target task. You must 464 | Those pages and swaps must be used only by the target task. You must
463 | enable Swap Extension(see 2.4) to enable move of swap charges. 465 | enable Swap Extension(see 2.4) to enable move of swap charges.
464 466 -----+------------------------------------------------------------------------
465Note: Those pages and swaps must be charged to the old cgroup. 467 1 | A charge of file pages(normal file, tmpfs file(e.g. ipc shared memory)
466Note: More type of pages(e.g. file cache, shmem,) will be supported by other 468 | and swaps of tmpfs file) mmaped by the target task. Unlike the case of
467 bits in future. 469 | anonymous pages, file pages(and swaps) in the range mmapped by the task
470 | will be moved even if the task hasn't done page fault, i.e. they might
471 | not be the task's "RSS", but other task's "RSS" that maps the same file.
472 | And mapcount of the page is ignored(the page can be moved even if
473 | page_mapcount(page) > 1). You must enable Swap Extension(see 2.4) to
474 | enable move of swap charges.
468 475
4698.3 TODO 4768.3 TODO
470 477
471- Add support for other types of pages(e.g. file cache, shmem, etc.).
472- Implement madvise(2) to let users decide the vma to be moved or not to be 478- Implement madvise(2) to let users decide the vma to be moved or not to be
473 moved. 479 moved.
474- All of moving charge operations are done under cgroup_mutex. It's not good 480- All of moving charge operations are done under cgroup_mutex. It's not good