Gitweb: http://git.kernel.org/linus/87946a72283be3de936adc754b7007df7d3e6aeb
Commit: 87946a72283be3de936adc754b7007df7d3e6aeb
Parent: 90254a65833b67502d14736410b3857a15535c67
Author: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
AuthorDate: Wed May 26 14:42:39 2010 -0700
Committer: Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Thu May 27 09:12:43 2010 -0700
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>
---
Documentation/cgroups/memory.txt | 18 +++++++---
include/linux/swap.h | 5 +++
mm/memcontrol.c | 56 ++++++++++++++++++++++++++-------
mm/shmem.c | 64 ++++++++++++++++++++++++++++++++++++++
4 files changed, 125 insertions(+), 18 deletions(-)
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 44e7ded..5e02887 100644
--- ...