]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: split mem_cgroup_force_empty into reclaiming and reparenting parts
authorMichal Hocko <mhocko@suse.cz>
Fri, 26 Oct 2012 11:37:28 +0000 (13:37 +0200)
committerTejun Heo <tj@kernel.org>
Mon, 29 Oct 2012 23:22:21 +0000 (16:22 -0700)
commit004726bf9398313c04979aa31cd8cad4d9f009c4
tree6460f272a925acccb381aa4f939b6ce169e46f9c
parentcd51c56a48839bb64110da1630f05af7f35b5857
memcg: split mem_cgroup_force_empty into reclaiming and reparenting parts

mem_cgroup_force_empty did two separate things depending on free_all
parameter from the very beginning. It either reclaimed as many pages as
possible and moved the rest to the parent or just moved charges to the
parent. The first variant is used as memory.force_empty callback while
the later is used from the mem_cgroup_pre_destroy.

The whole games around gotos are far from being nice and there is no
reason to keep those two functions inside one. Let's split them and
also move the responsibility for css reference counting to their callers
to make to code easier.

This patch doesn't have any functional changes.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Glauber Costa <glommer@parallels.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
mm/memcontrol.c