aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2014-08-06 19:07:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 21:01:20 -0400
commit0d5d823ab4e608ec7b52ac4410de4cb74bbe0edd (patch)
tree7b9d8f7625e45c28ad626c7b5419e8e33c59788e /mm/vmscan.c
parent3484b2de9499df23c4604a513b36f96326ae81ad (diff)
mm: move zone->pages_scanned into a vmstat counter
zone->pages_scanned is a write-intensive cache line during page reclaim and it's also updated during page free. Move the counter into vmstat to take advantage of the per-cpu updates and do not update it in the free paths unless necessary. On a small UMA machine running tiobench the difference is marginal. On a 4-node machine the overhead is more noticable. Note that automatic NUMA balancing was disabled for this test as otherwise the system CPU overhead is unpredictable. 3.16.0-rc3 3.16.0-rc3 3.16.0-rc3 vanillarearrange-v5 vmstat-v5 User 746.94 759.78 774.56 System 65336.22 58350.98 32847.27 Elapsed 27553.52 27282.02 27415.04 Note that the overhead reduction will vary depending on where exactly pages are allocated and freed. Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: 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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5fec1ba9951f..9c8222b499b4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -174,7 +174,8 @@ static unsigned long zone_reclaimable_pages(struct zone *zone)
174 174
175bool zone_reclaimable(struct zone *zone) 175bool zone_reclaimable(struct zone *zone)
176{ 176{
177 return zone->pages_scanned < zone_reclaimable_pages(zone) * 6; 177 return zone_page_state(zone, NR_PAGES_SCANNED) <
178 zone_reclaimable_pages(zone) * 6;
178} 179}
179 180
180static unsigned long get_lru_size(struct lruvec *lruvec, enum lru_list lru) 181static unsigned long get_lru_size(struct lruvec *lruvec, enum lru_list lru)
@@ -1508,7 +1509,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
1508 __mod_zone_page_state(zone, NR_ISOLATED_ANON + file, nr_taken); 1509 __mod_zone_page_state(zone, NR_ISOLATED_ANON + file, nr_taken);
1509 1510
1510 if (global_reclaim(sc)) { 1511 if (global_reclaim(sc)) {
1511 zone->pages_scanned += nr_scanned; 1512 __mod_zone_page_state(zone, NR_PAGES_SCANNED, nr_scanned);
1512 if (current_is_kswapd()) 1513 if (current_is_kswapd())
1513 __count_zone_vm_events(PGSCAN_KSWAPD, zone, nr_scanned); 1514 __count_zone_vm_events(PGSCAN_KSWAPD, zone, nr_scanned);
1514 else 1515 else
@@ -1698,7 +1699,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
1698 nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &l_hold, 1699 nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &l_hold,
1699 &nr_scanned, sc, isolate_mode, lru); 1700 &nr_scanned, sc, isolate_mode, lru);
1700 if (global_reclaim(sc)) 1701 if (global_reclaim(sc))
1701 zone->pages_scanned += nr_scanned; 1702 __mod_zone_page_state(zone, NR_PAGES_SCANNED, nr_scanned);
1702 1703
1703 reclaim_stat->recent_scanned[file] += nr_taken; 1704 reclaim_stat->recent_scanned[file] += nr_taken;
1704 1705