aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/vmscan.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 66bb6ef44b5f..f03c239440ad 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -125,15 +125,15 @@ static LIST_HEAD(shrinker_list);
125static DECLARE_RWSEM(shrinker_rwsem); 125static DECLARE_RWSEM(shrinker_rwsem);
126 126
127#ifdef CONFIG_CGROUP_MEM_RES_CTLR 127#ifdef CONFIG_CGROUP_MEM_RES_CTLR
128#define scan_global_lru(sc) (!(sc)->mem_cgroup) 128#define scanning_global_lru(sc) (!(sc)->mem_cgroup)
129#else 129#else
130#define scan_global_lru(sc) (1) 130#define scanning_global_lru(sc) (1)
131#endif 131#endif
132 132
133static struct zone_reclaim_stat *get_reclaim_stat(struct zone *zone, 133static struct zone_reclaim_stat *get_reclaim_stat(struct zone *zone,
134 struct scan_control *sc) 134 struct scan_control *sc)
135{ 135{
136 if (!scan_global_lru(sc)) 136 if (!scanning_global_lru(sc))
137 return mem_cgroup_get_reclaim_stat(sc->mem_cgroup, zone); 137 return mem_cgroup_get_reclaim_stat(sc->mem_cgroup, zone);
138 138
139 return &zone->reclaim_stat; 139 return &zone->reclaim_stat;
@@ -142,7 +142,7 @@ static struct zone_reclaim_stat *get_reclaim_stat(struct zone *zone,
142static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc, 142static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
143 enum lru_list lru) 143 enum lru_list lru)
144{ 144{
145 if (!scan_global_lru(sc)) 145 if (!scanning_global_lru(sc))
146 return mem_cgroup_zone_nr_pages(sc->mem_cgroup, zone, lru); 146 return mem_cgroup_zone_nr_pages(sc->mem_cgroup, zone, lru);
147 147
148 return zone_page_state(zone, NR_LRU_BASE + lru); 148 return zone_page_state(zone, NR_LRU_BASE + lru);
@@ -1090,7 +1090,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
1090 __mod_zone_page_state(zone, NR_INACTIVE_ANON, 1090 __mod_zone_page_state(zone, NR_INACTIVE_ANON,
1091 -count[LRU_INACTIVE_ANON]); 1091 -count[LRU_INACTIVE_ANON]);
1092 1092
1093 if (scan_global_lru(sc)) 1093 if (scanning_global_lru(sc))
1094 zone->pages_scanned += nr_scan; 1094 zone->pages_scanned += nr_scan;
1095 1095
1096 reclaim_stat->recent_scanned[0] += count[LRU_INACTIVE_ANON]; 1096 reclaim_stat->recent_scanned[0] += count[LRU_INACTIVE_ANON];
@@ -1129,7 +1129,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
1129 if (current_is_kswapd()) { 1129 if (current_is_kswapd()) {
1130 __count_zone_vm_events(PGSCAN_KSWAPD, zone, nr_scan); 1130 __count_zone_vm_events(PGSCAN_KSWAPD, zone, nr_scan);
1131 __count_vm_events(KSWAPD_STEAL, nr_freed); 1131 __count_vm_events(KSWAPD_STEAL, nr_freed);
1132 } else if (scan_global_lru(sc)) 1132 } else if (scanning_global_lru(sc))
1133 __count_zone_vm_events(PGSCAN_DIRECT, zone, nr_scan); 1133 __count_zone_vm_events(PGSCAN_DIRECT, zone, nr_scan);
1134 1134
1135 __count_zone_vm_events(PGSTEAL, zone, nr_freed); 1135 __count_zone_vm_events(PGSTEAL, zone, nr_freed);
@@ -1228,7 +1228,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
1228 * zone->pages_scanned is used for detect zone's oom 1228 * zone->pages_scanned is used for detect zone's oom
1229 * mem_cgroup remembers nr_scan by itself. 1229 * mem_cgroup remembers nr_scan by itself.
1230 */ 1230 */
1231 if (scan_global_lru(sc)) { 1231 if (scanning_global_lru(sc)) {
1232 zone->pages_scanned += pgscanned; 1232 zone->pages_scanned += pgscanned;
1233 } 1233 }
1234 reclaim_stat->recent_scanned[!!file] += pgmoved; 1234 reclaim_stat->recent_scanned[!!file] += pgmoved;
@@ -1337,7 +1337,7 @@ static int inactive_anon_is_low(struct zone *zone, struct scan_control *sc)
1337{ 1337{
1338 int low; 1338 int low;
1339 1339
1340 if (scan_global_lru(sc)) 1340 if (scanning_global_lru(sc))
1341 low = inactive_anon_is_low_global(zone); 1341 low = inactive_anon_is_low_global(zone);
1342 else 1342 else
1343 low = mem_cgroup_inactive_anon_is_low(sc->mem_cgroup, zone); 1343 low = mem_cgroup_inactive_anon_is_low(sc->mem_cgroup, zone);
@@ -1390,7 +1390,7 @@ static void get_scan_ratio(struct zone *zone, struct scan_control *sc,
1390 file = zone_nr_pages(zone, sc, LRU_ACTIVE_FILE) + 1390 file = zone_nr_pages(zone, sc, LRU_ACTIVE_FILE) +
1391 zone_nr_pages(zone, sc, LRU_INACTIVE_FILE); 1391 zone_nr_pages(zone, sc, LRU_INACTIVE_FILE);
1392 1392
1393 if (scan_global_lru(sc)) { 1393 if (scanning_global_lru(sc)) {
1394 free = zone_page_state(zone, NR_FREE_PAGES); 1394 free = zone_page_state(zone, NR_FREE_PAGES);
1395 /* If we have very few page cache pages, 1395 /* If we have very few page cache pages,
1396 force-scan anon pages. */ 1396 force-scan anon pages. */
@@ -1474,7 +1474,7 @@ static void shrink_zone(int priority, struct zone *zone,
1474 scan >>= priority; 1474 scan >>= priority;
1475 scan = (scan * percent[file]) / 100; 1475 scan = (scan * percent[file]) / 100;
1476 } 1476 }
1477 if (scan_global_lru(sc)) { 1477 if (scanning_global_lru(sc)) {
1478 zone->lru[l].nr_scan += scan; 1478 zone->lru[l].nr_scan += scan;
1479 nr[l] = zone->lru[l].nr_scan; 1479 nr[l] = zone->lru[l].nr_scan;
1480 if (nr[l] >= swap_cluster_max) 1480 if (nr[l] >= swap_cluster_max)
@@ -1550,7 +1550,7 @@ static void shrink_zones(int priority, struct zonelist *zonelist,
1550 * Take care memory controller reclaiming has small influence 1550 * Take care memory controller reclaiming has small influence
1551 * to global LRU. 1551 * to global LRU.
1552 */ 1552 */
1553 if (scan_global_lru(sc)) { 1553 if (scanning_global_lru(sc)) {
1554 if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) 1554 if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
1555 continue; 1555 continue;
1556 note_zone_scanning_priority(zone, priority); 1556 note_zone_scanning_priority(zone, priority);
@@ -1603,12 +1603,12 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
1603 1603
1604 delayacct_freepages_start(); 1604 delayacct_freepages_start();
1605 1605
1606 if (scan_global_lru(sc)) 1606 if (scanning_global_lru(sc))
1607 count_vm_event(ALLOCSTALL); 1607 count_vm_event(ALLOCSTALL);
1608 /* 1608 /*
1609 * mem_cgroup will not do shrink_slab. 1609 * mem_cgroup will not do shrink_slab.
1610 */ 1610 */
1611 if (scan_global_lru(sc)) { 1611 if (scanning_global_lru(sc)) {
1612 for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) { 1612 for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) {
1613 1613
1614 if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) 1614 if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
@@ -1627,7 +1627,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
1627 * Don't shrink slabs when reclaiming memory from 1627 * Don't shrink slabs when reclaiming memory from
1628 * over limit cgroups 1628 * over limit cgroups
1629 */ 1629 */
1630 if (scan_global_lru(sc)) { 1630 if (scanning_global_lru(sc)) {
1631 shrink_slab(sc->nr_scanned, sc->gfp_mask, lru_pages); 1631 shrink_slab(sc->nr_scanned, sc->gfp_mask, lru_pages);
1632 if (reclaim_state) { 1632 if (reclaim_state) {
1633 sc->nr_reclaimed += reclaim_state->reclaimed_slab; 1633 sc->nr_reclaimed += reclaim_state->reclaimed_slab;
@@ -1658,7 +1658,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
1658 congestion_wait(WRITE, HZ/10); 1658 congestion_wait(WRITE, HZ/10);
1659 } 1659 }
1660 /* top priority shrink_zones still had more to do? don't OOM, then */ 1660 /* top priority shrink_zones still had more to do? don't OOM, then */
1661 if (!sc->all_unreclaimable && scan_global_lru(sc)) 1661 if (!sc->all_unreclaimable && scanning_global_lru(sc))
1662 ret = sc->nr_reclaimed; 1662 ret = sc->nr_reclaimed;
1663out: 1663out:
1664 /* 1664 /*
@@ -1671,7 +1671,7 @@ out:
1671 if (priority < 0) 1671 if (priority < 0)
1672 priority = 0; 1672 priority = 0;
1673 1673
1674 if (scan_global_lru(sc)) { 1674 if (scanning_global_lru(sc)) {
1675 for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) { 1675 for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) {
1676 1676
1677 if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) 1677 if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))