diff options
author | Hugh Dickins <hughd@google.com> | 2012-05-29 18:07:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:28 -0400 |
commit | 4d7dcca213921fbaf08ee05359d28e4aaf2245f1 (patch) | |
tree | 1c31ea8e8f9f88ca60864fbdaf9dfa74b09be96f /mm/vmscan.c | |
parent | af7c4b0ec257ea9abb9c6749dd5a5ba0b8fae1fd (diff) |
mm/memcg: get_lru_size not get_lruvec_size
Konstantin just introduced mem_cgroup_get_lruvec_size() and
get_lruvec_size(), I'm about to add mem_cgroup_update_lru_size(): but
we're dealing with the same thing, lru_size[lru]. We ought to agree on
the naming, and I do think lru_size is the more correct: so rename his
ones to get_lru_size().
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 4c5453f8427d..8b941f303cea 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -145,10 +145,10 @@ static bool global_reclaim(struct scan_control *sc) | |||
145 | } | 145 | } |
146 | #endif | 146 | #endif |
147 | 147 | ||
148 | static unsigned long get_lruvec_size(struct lruvec *lruvec, enum lru_list lru) | 148 | static unsigned long get_lru_size(struct lruvec *lruvec, enum lru_list lru) |
149 | { | 149 | { |
150 | if (!mem_cgroup_disabled()) | 150 | if (!mem_cgroup_disabled()) |
151 | return mem_cgroup_get_lruvec_size(lruvec, lru); | 151 | return mem_cgroup_get_lru_size(lruvec, lru); |
152 | 152 | ||
153 | return zone_page_state(lruvec_zone(lruvec), NR_LRU_BASE + lru); | 153 | return zone_page_state(lruvec_zone(lruvec), NR_LRU_BASE + lru); |
154 | } | 154 | } |
@@ -1608,10 +1608,10 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, | |||
1608 | goto out; | 1608 | goto out; |
1609 | } | 1609 | } |
1610 | 1610 | ||
1611 | anon = get_lruvec_size(lruvec, LRU_ACTIVE_ANON) + | 1611 | anon = get_lru_size(lruvec, LRU_ACTIVE_ANON) + |
1612 | get_lruvec_size(lruvec, LRU_INACTIVE_ANON); | 1612 | get_lru_size(lruvec, LRU_INACTIVE_ANON); |
1613 | file = get_lruvec_size(lruvec, LRU_ACTIVE_FILE) + | 1613 | file = get_lru_size(lruvec, LRU_ACTIVE_FILE) + |
1614 | get_lruvec_size(lruvec, LRU_INACTIVE_FILE); | 1614 | get_lru_size(lruvec, LRU_INACTIVE_FILE); |
1615 | 1615 | ||
1616 | if (global_reclaim(sc)) { | 1616 | if (global_reclaim(sc)) { |
1617 | free = zone_page_state(zone, NR_FREE_PAGES); | 1617 | free = zone_page_state(zone, NR_FREE_PAGES); |
@@ -1674,7 +1674,7 @@ out: | |||
1674 | int file = is_file_lru(lru); | 1674 | int file = is_file_lru(lru); |
1675 | unsigned long scan; | 1675 | unsigned long scan; |
1676 | 1676 | ||
1677 | scan = get_lruvec_size(lruvec, lru); | 1677 | scan = get_lru_size(lruvec, lru); |
1678 | if (sc->priority || noswap || !vmscan_swappiness(sc)) { | 1678 | if (sc->priority || noswap || !vmscan_swappiness(sc)) { |
1679 | scan >>= sc->priority; | 1679 | scan >>= sc->priority; |
1680 | if (!scan && force_scan) | 1680 | if (!scan && force_scan) |
@@ -1743,10 +1743,9 @@ static inline bool should_continue_reclaim(struct lruvec *lruvec, | |||
1743 | * inactive lists are large enough, continue reclaiming | 1743 | * inactive lists are large enough, continue reclaiming |
1744 | */ | 1744 | */ |
1745 | pages_for_compaction = (2UL << sc->order); | 1745 | pages_for_compaction = (2UL << sc->order); |
1746 | inactive_lru_pages = get_lruvec_size(lruvec, LRU_INACTIVE_FILE); | 1746 | inactive_lru_pages = get_lru_size(lruvec, LRU_INACTIVE_FILE); |
1747 | if (nr_swap_pages > 0) | 1747 | if (nr_swap_pages > 0) |
1748 | inactive_lru_pages += get_lruvec_size(lruvec, | 1748 | inactive_lru_pages += get_lru_size(lruvec, LRU_INACTIVE_ANON); |
1749 | LRU_INACTIVE_ANON); | ||
1750 | if (sc->nr_reclaimed < pages_for_compaction && | 1749 | if (sc->nr_reclaimed < pages_for_compaction && |
1751 | inactive_lru_pages > pages_for_compaction) | 1750 | inactive_lru_pages > pages_for_compaction) |
1752 | return true; | 1751 | return true; |