aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 87c2ec49b482..29bc4400378d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3093,8 +3093,6 @@ void mem_cgroup_uncharge_cache_page(struct page *page)
3093{ 3093{
3094 VM_BUG_ON(page_mapped(page)); 3094 VM_BUG_ON(page_mapped(page));
3095 VM_BUG_ON(page->mapping); 3095 VM_BUG_ON(page->mapping);
3096 if (PageSwapCache(page))
3097 return;
3098 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE, false); 3096 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE, false);
3099} 3097}
3100 3098
@@ -3159,8 +3157,6 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout)
3159 if (!swapout) /* this was a swap cache but the swap is unused ! */ 3157 if (!swapout) /* this was a swap cache but the swap is unused ! */
3160 ctype = MEM_CGROUP_CHARGE_TYPE_DROP; 3158 ctype = MEM_CGROUP_CHARGE_TYPE_DROP;
3161 3159
3162 if (PageSwapCache(page))
3163 return;
3164 memcg = __mem_cgroup_uncharge_common(page, ctype, false); 3160 memcg = __mem_cgroup_uncharge_common(page, ctype, false);
3165 3161
3166 /* 3162 /*
@@ -3350,11 +3346,10 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg,
3350 unused = oldpage; 3346 unused = oldpage;
3351 } 3347 }
3352 anon = PageAnon(used); 3348 anon = PageAnon(used);
3353 if (!PageSwapCache(unused)) 3349 __mem_cgroup_uncharge_common(unused,
3354 __mem_cgroup_uncharge_common(unused, 3350 anon ? MEM_CGROUP_CHARGE_TYPE_ANON
3355 anon ? MEM_CGROUP_CHARGE_TYPE_ANON 3351 : MEM_CGROUP_CHARGE_TYPE_CACHE,
3356 : MEM_CGROUP_CHARGE_TYPE_CACHE, 3352 true);
3357 true);
3358 css_put(&memcg->css); 3353 css_put(&memcg->css);
3359 /* 3354 /*
3360 * We disallowed uncharge of pages under migration because mapcount 3355 * We disallowed uncharge of pages under migration because mapcount