summaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2012-05-29 15:06:52 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 16:22:24 -0700
commit86493009d3b7e51eee38575f9537b754f5b6c536 (patch)
tree2a9c53575daed7b025fee2c728e102095d364749 /mm/memcontrol.c
parente91cbb42531626cd4fd0673ca01daf53e338d8f9 (diff)
downloadop-kernel-dev-86493009d3b7e51eee38575f9537b754f5b6c536.zip
op-kernel-dev-86493009d3b7e51eee38575f9537b754f5b6c536.tar.gz
memcg swap: use mem_cgroup_uncharge_swap()
That stuff __mem_cgroup_commit_charge_swapin() does with a swap entry, it has a name and even a declaration: just use mem_cgroup_uncharge_swap(). Signed-off-by: Hugh Dickins <hughd@google.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d5ba631e..30f938c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2855,24 +2855,7 @@ __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *memcg,
*/
if (do_swap_account && PageSwapCache(page)) {
swp_entry_t ent = {.val = page_private(page)};
- struct mem_cgroup *swap_memcg;
- unsigned short id;
-
- id = swap_cgroup_record(ent, 0);
- rcu_read_lock();
- swap_memcg = mem_cgroup_lookup(id);
- if (swap_memcg) {
- /*
- * This recorded memcg can be obsolete one. So, avoid
- * calling css_tryget
- */
- if (!mem_cgroup_is_root(swap_memcg))
- res_counter_uncharge(&swap_memcg->memsw,
- PAGE_SIZE);
- mem_cgroup_swap_statistics(swap_memcg, false);
- mem_cgroup_put(swap_memcg);
- }
- rcu_read_unlock();
+ mem_cgroup_uncharge_swap(ent);
}
/*
* At swapin, we may charge account against cgroup which has no tasks.
OpenPOWER on IntegriCloud