On Thu, 8 Apr 2010 14:11:31 +0900 Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> wrote: > 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. > > Signed-off-by: Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> > --- > Documentation/cgroups/memory.txt | 12 ++++++-- > include/linux/swap.h | 5 +++ > mm/memcontrol.c | 55 +++++++++++++++++++++++++++++-------- > mm/shmem.c | 37 +++++++++++++++++++++++++ > 4 files changed, 94 insertions(+), 15 deletions(-) > > diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt > index 1b5bd04..13d40e7 100644 > --- a/Documentation/cgroups/memory.txt > +++ b/Documentation/cgroups/memory.txt > @@ -461,14 +461,20 @@ charges should be moved. > 0 | A charge of an anonymous page(or swap of it) used by the target task. > | Those pages and swaps must be used only by the target task. You must > | enable Swap Extension(see 2.4) to enable move of swap charges. > + -----+------------------------------------------------------------------------ > + 1 | A charge of file pages(normal file, tmpfs file(e.g. ipc shared memory) > + | and swaps of tmpfs file) mmaped by the target task. 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). You must enable Swap Extension(see 2.4) to > + | enable move of swap charges. > > Note: Those pages and swaps must be charged to the old cgroup. > -Note: More type of pages(e.g. file cache, shmem,) will be supported by other > - bits in future. > About both of documenataion for 0 and 1, I think following information is omitted. "An account of a page of task is moved only when it's under task's current memory cgroup." Plz add somewhere easy-to-be-found. But ok, the patch itself much simpler. Thank you for your patient works! Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>