diff options
| author | Johannes Weiner <hannes@cmpxchg.org> | 2014-12-10 18:44:02 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:07 -0500 |
| commit | 2983331575bfb248abfb02efb5140b4a299e3f45 (patch) | |
| tree | ee76b29264683d8053007b2959c930edb1c27b13 /include/linux | |
| parent | f4aaa8b43d90294ca7546317997c452600e9a8a7 (diff) | |
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/linux')
| -rw-r--r-- | include/linux/page_cgroup.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 97536e685843..1289be6b436c 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
| @@ -1,11 +1,6 @@ | |||
| 1 | #ifndef __LINUX_PAGE_CGROUP_H | 1 | #ifndef __LINUX_PAGE_CGROUP_H |
| 2 | #define __LINUX_PAGE_CGROUP_H | 2 | #define __LINUX_PAGE_CGROUP_H |
| 3 | 3 | ||
| 4 | enum { | ||
| 5 | /* flags for mem_cgroup */ | ||
| 6 | PCG_USED = 0x01, /* This page is charged to a memcg */ | ||
| 7 | }; | ||
| 8 | |||
| 9 | struct pglist_data; | 4 | struct pglist_data; |
| 10 | 5 | ||
| 11 | #ifdef CONFIG_MEMCG | 6 | #ifdef CONFIG_MEMCG |
| @@ -19,7 +14,6 @@ struct mem_cgroup; | |||
| 19 | * then the page cgroup for pfn always exists. | 14 | * then the page cgroup for pfn always exists. |
| 20 | */ | 15 | */ |
| 21 | struct page_cgroup { | 16 | struct page_cgroup { |
| 22 | unsigned long flags; | ||
| 23 | struct mem_cgroup *mem_cgroup; | 17 | struct mem_cgroup *mem_cgroup; |
| 24 | }; | 18 | }; |
| 25 | 19 | ||
| @@ -39,10 +33,6 @@ static inline void page_cgroup_init(void) | |||
| 39 | 33 | ||
| 40 | struct page_cgroup *lookup_page_cgroup(struct page *page); | 34 | struct page_cgroup *lookup_page_cgroup(struct page *page); |
| 41 | 35 | ||
| 42 | static inline int PageCgroupUsed(struct page_cgroup *pc) | ||
| 43 | { | ||
| 44 | return !!(pc->flags & PCG_USED); | ||
| 45 | } | ||
| 46 | #else /* !CONFIG_MEMCG */ | 36 | #else /* !CONFIG_MEMCG */ |
| 47 | struct page_cgroup; | 37 | struct page_cgroup; |
| 48 | 38 | ||
