mm: memcontrol: remove unnecessary PCG_MEM memory charge flag
authorJohannes Weiner <hannes@cmpxchg.org>
Wed, 10 Dec 2014 23:44:00 +0000 (15:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:07 +0000 (17:41 -0800)
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>
include/linux/page_cgroup.h
mm/memcontrol.c

index da62ee2be28b56d35b1a20ba46f510b74d460a85..97536e6858430064f85dc71d509463582fb460bd 100644 (file)
@@ -4,7 +4,6 @@
 enum {
        /* flags for mem_cgroup */
        PCG_USED = 0x01,        /* This page is charged to a memcg */
-       PCG_MEM = 0x02,         /* This page holds a memory charge */
 };
 
 struct pglist_data;
index baf3b535b180d63d4d7d76be79387497f18b7320..3dfb56a9311730f789b59afeb0dfea8f0b25a32b 100644 (file)
@@ -2614,7 +2614,7 @@ static void commit_charge(struct page *page, struct mem_cgroup *memcg,
         *   have the page locked
         */
        pc->mem_cgroup = memcg;
-       pc->flags = PCG_USED | PCG_MEM;
+       pc->flags = PCG_USED;
 
        if (lrucare)
                unlock_page_lru(page, isolated);
@@ -6156,8 +6156,6 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage,
        if (!PageCgroupUsed(pc))
                return;
 
-       VM_BUG_ON_PAGE(!(pc->flags & PCG_MEM), oldpage);
-
        if (lrucare)
                lock_page_lru(oldpage, &isolated);