aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2014-12-10 18:44:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 20:41:07 -0500
commitf4aaa8b43d90294ca7546317997c452600e9a8a7 (patch)
tree1e60bc5a4605a92af6a2d03b5e0f9574fe0a2c77 /mm/memcontrol.c
parent18eca2e636f921e6350dc31b5b450bb4102d664f (diff)
mm: memcontrol: remove unnecessary PCG_MEM memory charge flag
PCG_MEM is a remnant from an earlier version of 0a31bc97c80c ("mm: memcontrol: rewrite uncharge API"), used to tell whether migration cleared a charge while leaving pc->mem_cgroup valid and PCG_USED set. But in the final version, mem_cgroup_migrate() directly uncharges the source page, rendering this distinction unnecessary. Remove it. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Hugh Dickins <hughd@google.com> Acked-by: Michal Hocko <mhocko@suse.cz> Reviewed-by: Vladimir Davydov <vdavydov@parallels.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> 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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index baf3b535b180..3dfb56a93117 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2614,7 +2614,7 @@ static void commit_charge(struct page *page, struct mem_cgroup *memcg,
2614 * have the page locked 2614 * have the page locked
2615 */ 2615 */
2616 pc->mem_cgroup = memcg; 2616 pc->mem_cgroup = memcg;
2617 pc->flags = PCG_USED | PCG_MEM; 2617 pc->flags = PCG_USED;
2618 2618
2619 if (lrucare) 2619 if (lrucare)
2620 unlock_page_lru(page, isolated); 2620 unlock_page_lru(page, isolated);
@@ -6156,8 +6156,6 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage,
6156 if (!PageCgroupUsed(pc)) 6156 if (!PageCgroupUsed(pc))
6157 return; 6157 return;
6158 6158
6159 VM_BUG_ON_PAGE(!(pc->flags & PCG_MEM), oldpage);
6160
6161 if (lrucare) 6159 if (lrucare)
6162 lock_page_lru(oldpage, &isolated); 6160 lock_page_lru(oldpage, &isolated);
6163 6161