diff options
author | Li Zefan <lizefan@huawei.com> | 2013-07-08 16:00:33 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-09 10:33:24 -0700 |
commit | 10d5ebf40ff09db03b97cb177f24b9c7c8b4bb52 (patch) | |
tree | 659b3431157e052d6ab77c7c6c2951e6ab68d82f /mm/vmstat.c | |
parent | 20f05310ba62d5816fb339d08effe78683137197 (diff) | |
download | op-kernel-dev-10d5ebf40ff09db03b97cb177f24b9c7c8b4bb52.zip op-kernel-dev-10d5ebf40ff09db03b97cb177f24b9c7c8b4bb52.tar.gz |
memcg: use css_get/put when charging/uncharging kmem
Use css_get/put instead of mem_cgroup_get/put.
We can't do a simple replacement, because here mem_cgroup_put() is
called during mem_cgroup_css_free(), while mem_cgroup_css_free() won't
be called until css refcnt goes down to 0.
Instead we increment css refcnt in mem_cgroup_css_offline(), and then
check if there's still kmem charges. If not, css refcnt will be
decremented immediately, otherwise the refcnt will be released after the
last kmem allocation is uncahred.
[akpm@linux-foundation.org: tweak comment]
Signed-off-by: Li Zefan <lizefan@huawei.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Glauber Costa <glommer@openvz.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmstat.c')
0 files changed, 0 insertions, 0 deletions