aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@openvz.org>2012-05-29 18:07:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 19:22:26 -0400
commit074291fea8bcedeabf295360e2ddd9bbb5830b4a (patch)
tree01531a2ca7e9b648a4d8cd9bc772aa484ed2190d /mm/memcontrol.c
parent27ac81d85e5cfcc755dd5fa3f04dc883ab5d821b (diff)
mm/vmscan: replace zone_nr_lru_pages() with get_lruvec_size()
If memory cgroup is enabled we always use lruvecs which are embedded into struct mem_cgroup_per_zone, so we can reach lru_size counters via container_of(). Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Cc: Mel Gorman <mel@csn.ul.ie> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-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 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 39b2c14f1509..a68db296ada6 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -723,6 +723,15 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *memcg,
723} 723}
724 724
725unsigned long 725unsigned long
726mem_cgroup_get_lruvec_size(struct lruvec *lruvec, enum lru_list lru)
727{
728 struct mem_cgroup_per_zone *mz;
729
730 mz = container_of(lruvec, struct mem_cgroup_per_zone, lruvec);
731 return mz->lru_size[lru];
732}
733
734static unsigned long
726mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid, 735mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid,
727 unsigned int lru_mask) 736 unsigned int lru_mask)
728{ 737{