diff options
author | Hugh Dickins <hughd@google.com> | 2012-05-29 18:06:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:24 -0400 |
commit | 86493009d3b7e51eee38575f9537b754f5b6c536 (patch) | |
tree | 2a9c53575daed7b025fee2c728e102095d364749 /mm/memcontrol.c | |
parent | e91cbb42531626cd4fd0673ca01daf53e338d8f9 (diff) |
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.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d5ba631e0ec7..30f938c86453 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, | |||
2855 | */ | 2855 | */ |
2856 | if (do_swap_account && PageSwapCache(page)) { | 2856 | if (do_swap_account && PageSwapCache(page)) { |
2857 | swp_entry_t ent = {.val = page_private(page)}; | 2857 | swp_entry_t ent = {.val = page_private(page)}; |
2858 | struct mem_cgroup *swap_memcg; | 2858 | mem_cgroup_uncharge_swap(ent); |
2859 | unsigned short id; | ||
2860 | |||
2861 | id = swap_cgroup_record(ent, 0); | ||
2862 | rcu_read_lock(); | ||
2863 | swap_memcg = mem_cgroup_lookup(id); | ||
2864 | if (swap_memcg) { | ||
2865 | /* | ||
2866 | * This recorded memcg can be obsolete one. So, avoid | ||
2867 | * calling css_tryget | ||
2868 | */ | ||
2869 | if (!mem_cgroup_is_root(swap_memcg)) | ||
2870 | res_counter_uncharge(&swap_memcg->memsw, | ||
2871 | PAGE_SIZE); | ||
2872 | mem_cgroup_swap_statistics(swap_memcg, false); | ||
2873 | mem_cgroup_put(swap_memcg); | ||
2874 | } | ||
2875 | rcu_read_unlock(); | ||
2876 | } | 2859 | } |
2877 | /* | 2860 | /* |
2878 | * At swapin, we may charge account against cgroup which has no tasks. | 2861 | * At swapin, we may charge account against cgroup which has no tasks. |