Skip to content

RFC memcg: migrate charge at task move

Daisuke Nishimura linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 31 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8memcg: introduce mem_cgroup_cancel_charge()mm/memcontrol.c+14 -211 reply
1/8cgroup: introduce cancel_attach()Documentation/cgroups/cgroups.txt include/linux/cgroup.h kernel/cgroup.c+42 -82 replies
2/8memcg: cleanup mem_cgroup_move_parent()include/linux/page_cgroup.h mm/memcontrol.c+31 -481 reply
2/8memcg: introduce mem_cgroup_cancel_charge()mm/memcontrol.c+18 -210 replies
3/8cgroup: introduce cancel_attach()include/linux/cgroup.h kernel/cgroup.c+31 -80 replies
3/8memcg: cleanup mem_cgroup_move_parent()include/linux/page_cgroup.h mm/memcontrol.c+45 -542 replies
4/8memcg: add interface to migrate chargemm/memcontrol.c+65 -42 replies
4/8memcg: add interface to migrate chargemm/memcontrol.c+61 -42 replies
5/8memcg: migrate charge of anonmm/memcontrol.c+195 -14 replies
5/8memcg: migrate charge of mapped pagemm/memcontrol.c+268 -24 replies
6/8memcg: migrate charge of shmemmm/memcontrol.c+8 -21 reply
6/8memcg: avoid oom during charge migrationmm/memcontrol.c+19 -06 replies
7/8memcg: migrate charge of swapinclude/linux/page_cgroup.h mm/memcontrol.c mm/page_cgroup.c+158 -63 replies
7/8memcg: migrate charge of swapinclude/linux/page_cgroup.h mm/memcontrol.c mm/page_cgroup.c+128 -130 replies
8/8memcg: avoid oom during charge migrationmm/memcontrol.c+18 -00 replies
8/8memcg: migrate charge of shmem swapinclude/linux/swap.h mm/memcontrol.c mm/shmem.c+58 -42 replies

Reviews trailers per patch

4 of 16 patches have a Reviewed-by or Acked-by.

PatchKAMEZAWA Hiroyuki
1/8A-b
1/8A-b
2/8A-b
2/8A-b
3/8
3/8
4/8
4/8
5/8
5/8
6/8
6/8
7/8
7/8
8/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC][EXPERIMENTAL][PATCH 0/8] memcg: migrate charge at task move

Hi.

These are patches for migrating memcg's charge at task move.

I know we should fix res_counter's scalability problem first,
but this feature is also important for me, so I tried making patches
and they seem to work basically.
I post them(based on mmotm-2009-09-14-01-57) before going further to get some feedbacks.

Basic design:
- Add flag file "memory.migrate_charge" to determine whether charges should be migrated or not. Each bit of "memory.migrate_charge" has meaning(indicate the type of pages the charges of which should be migrated).
- At can_attach(), isolate pages of the task, call __mem_cgroup_try_charge, and move them to a private list.
- Call mem_cgroup_move_account() at attach() about all pages on the private list after necessary checks under page_cgroup lock, and put back them to LRU.
- Cancel charges about all pages remains on the private list on failure or at the end of charge migration, and put back them to LRU.

I think this design is simple but it has a problem when mounted on the same hierarchy with cpuset. This design isolate pages of the task at can_attach(), but attach() of cpuset also tries to isolate pages of the task and migrate them if cpuset.memory_migrate is set. As a result, pages cannot be memory migrated by cpuset if we set memory.migrate_charge. But I think this problem can be handled by user-space to some extent: for example, move the task back and move it again with memory.migrate_charge unset.
So I went to this direction as a first step(I'm considering how to avoid this issue).

Any comments or suggestions would be welcome.

Thanks,
Daisuke Nishimura.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>