summaryrefslogtreecommitdiffstats
path: root/mm/internal.h
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2013-07-08 16:00:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 10:33:24 -0700
commit10d5ebf40ff09db03b97cb177f24b9c7c8b4bb52 (patch)
tree659b3431157e052d6ab77c7c6c2951e6ab68d82f /mm/internal.h
parent20f05310ba62d5816fb339d08effe78683137197 (diff)
downloadlinux-10d5ebf40ff09db03b97cb177f24b9c7c8b4bb52.tar.bz2
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/internal.h')
0 files changed, 0 insertions, 0 deletions