aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/page_cgroup.h
diff options
context:
space:
mode:
authorJohannes Weiner <jweiner@redhat.com>2012-01-12 20:18:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 23:13:05 -0500
commit6b208e3f6e35aa76d254c395bdcd984b17c6b626 (patch)
treef7e65f9e1fa41907bf48f05007a10c83be668b3f /include/linux/page_cgroup.h
parent925b7673cce39116ce61e7a06683a4a0dad1e72a (diff)
mm: memcg: remove unused node/section info from pc->flags
To find the page corresponding to a certain page_cgroup, the pc->flags encoded the node or section ID with the base array to compare the pc pointer to. Now that the per-memory cgroup LRU lists link page descriptors directly, there is no longer any code that knows the struct page_cgroup of a PFN but not the struct page. [hughd@google.com: remove unused node/section info from pc->flags fix] Signed-off-by: Johannes Weiner <jweiner@redhat.com> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: Balbir Singh <bsingharora@gmail.com> Cc: Ying Han <yinghan@google.com> Cc: Greg Thelen <gthelen@google.com> Cc: Michel Lespinasse <walken@google.com> Cc: Rik van Riel <riel@redhat.com> Cc: Minchan Kim <minchan.kim@gmail.com> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/page_cgroup.h')
-rw-r--r--include/linux/page_cgroup.h33
1 files changed, 0 insertions, 33 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 5bae7535c202..aaa60da8783c 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -121,39 +121,6 @@ static inline void move_unlock_page_cgroup(struct page_cgroup *pc,
121 local_irq_restore(*flags); 121 local_irq_restore(*flags);
122} 122}
123 123
124#ifdef CONFIG_SPARSEMEM
125#define PCG_ARRAYID_WIDTH SECTIONS_SHIFT
126#else
127#define PCG_ARRAYID_WIDTH NODES_SHIFT
128#endif
129
130#if (PCG_ARRAYID_WIDTH > BITS_PER_LONG - NR_PCG_FLAGS)
131#error Not enough space left in pc->flags to store page_cgroup array IDs
132#endif
133
134/* pc->flags: ARRAY-ID | FLAGS */
135
136#define PCG_ARRAYID_MASK ((1UL << PCG_ARRAYID_WIDTH) - 1)
137
138#define PCG_ARRAYID_OFFSET (BITS_PER_LONG - PCG_ARRAYID_WIDTH)
139/*
140 * Zero the shift count for non-existent fields, to prevent compiler
141 * warnings and ensure references are optimized away.
142 */
143#define PCG_ARRAYID_SHIFT (PCG_ARRAYID_OFFSET * (PCG_ARRAYID_WIDTH != 0))
144
145static inline void set_page_cgroup_array_id(struct page_cgroup *pc,
146 unsigned long id)
147{
148 pc->flags &= ~(PCG_ARRAYID_MASK << PCG_ARRAYID_SHIFT);
149 pc->flags |= (id & PCG_ARRAYID_MASK) << PCG_ARRAYID_SHIFT;
150}
151
152static inline unsigned long page_cgroup_array_id(struct page_cgroup *pc)
153{
154 return (pc->flags >> PCG_ARRAYID_SHIFT) & PCG_ARRAYID_MASK;
155}
156
157#else /* CONFIG_CGROUP_MEM_RES_CTLR */ 124#else /* CONFIG_CGROUP_MEM_RES_CTLR */
158struct page_cgroup; 125struct page_cgroup;
159 126