aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b7381d11f021..daa016063793 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -680,9 +680,12 @@ static void free_pcppages_bulk(struct zone *zone, int count,
680 int migratetype = 0; 680 int migratetype = 0;
681 int batch_free = 0; 681 int batch_free = 0;
682 int to_free = count; 682 int to_free = count;
683 unsigned long nr_scanned;
683 684
684 spin_lock(&zone->lock); 685 spin_lock(&zone->lock);
685 zone->pages_scanned = 0; 686 nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED);
687 if (nr_scanned)
688 __mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned);
686 689
687 while (to_free) { 690 while (to_free) {
688 struct page *page; 691 struct page *page;
@@ -731,8 +734,11 @@ static void free_one_page(struct zone *zone,
731 unsigned int order, 734 unsigned int order,
732 int migratetype) 735 int migratetype)
733{ 736{
737 unsigned long nr_scanned;
734 spin_lock(&zone->lock); 738 spin_lock(&zone->lock);
735 zone->pages_scanned = 0; 739 nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED);
740 if (nr_scanned)
741 __mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned);
736 742
737 __free_one_page(page, pfn, zone, order, migratetype); 743 __free_one_page(page, pfn, zone, order, migratetype);
738 if (unlikely(!is_migrate_isolate(migratetype))) 744 if (unlikely(!is_migrate_isolate(migratetype)))
@@ -3248,7 +3254,7 @@ void show_free_areas(unsigned int filter)
3248 K(zone_page_state(zone, NR_BOUNCE)), 3254 K(zone_page_state(zone, NR_BOUNCE)),
3249 K(zone_page_state(zone, NR_FREE_CMA_PAGES)), 3255 K(zone_page_state(zone, NR_FREE_CMA_PAGES)),
3250 K(zone_page_state(zone, NR_WRITEBACK_TEMP)), 3256 K(zone_page_state(zone, NR_WRITEBACK_TEMP)),
3251 zone->pages_scanned, 3257 K(zone_page_state(zone, NR_PAGES_SCANNED)),
3252 (!zone_reclaimable(zone) ? "yes" : "no") 3258 (!zone_reclaimable(zone) ? "yes" : "no")
3253 ); 3259 );
3254 printk("lowmem_reserve[]:"); 3260 printk("lowmem_reserve[]:");