summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2014-12-10 23:44:02 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 01:41:07 (GMT)
commit2983331575bfb248abfb02efb5140b4a299e3f45 (patch)
treeee76b29264683d8053007b2959c930edb1c27b13 /include
parentf4aaa8b43d90294ca7546317997c452600e9a8a7 (diff)
downloadlinux-2983331575bfb248abfb02efb5140b4a299e3f45.tar.xz
mm: memcontrol: remove unnecessary PCG_USED pc->mem_cgroup valid flag
pc->mem_cgroup had to be left intact after uncharge for the final LRU removal, and !PCG_USED indicated whether the page was uncharged. But since commit 0a31bc97c80c ("mm: memcontrol: rewrite uncharge API") pages are uncharged after the final LRU removal. Uncharge can simply clear the pointer and the PCG_USED/PageCgroupUsed sites can test that instead. Because this is the last page_cgroup flag, this patch reduces the memcg per-page overhead to a single pointer. [akpm@linux-foundation.org: remove unneeded initialization of `memcg', per Michal] 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 'include')
-rw-r--r--include/linux/page_cgroup.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 97536e6..1289be6 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -1,11 +1,6 @@
#ifndef __LINUX_PAGE_CGROUP_H
#define __LINUX_PAGE_CGROUP_H
-enum {
- /* flags for mem_cgroup */
- PCG_USED = 0x01, /* This page is charged to a memcg */
-};
-
struct pglist_data;
#ifdef CONFIG_MEMCG
@@ -19,7 +14,6 @@ struct mem_cgroup;
* then the page cgroup for pfn always exists.
*/
struct page_cgroup {
- unsigned long flags;
struct mem_cgroup *mem_cgroup;
};
@@ -39,10 +33,6 @@ static inline void page_cgroup_init(void)
struct page_cgroup *lookup_page_cgroup(struct page *page);
-static inline int PageCgroupUsed(struct page_cgroup *pc)
-{
- return !!(pc->flags & PCG_USED);
-}
#else /* !CONFIG_MEMCG */
struct page_cgroup;