aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2012-10-08 19:33:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-09 03:23:01 -0400
commitbeb51eaa88238daba698ad837222ad277d440b6d (patch)
tree5b29acb5a518279967d36f263425de74a05074cd /mm
parente46a28790e594c0876d1a84270926abf75460f61 (diff)
cma: decrease cc.nr_migratepages after reclaiming pagelist
reclaim_clean_pages_from_list() reclaims clean pages before migration so cc.nr_migratepages should be updated. Currently, there is no problem but it can be wrong if we try to use the value in future. Signed-off-by: Minchan Kim <minchan@kernel.org> Acked-by: Mel Gorman <mgorman@suse.de> Cc: Michal Nazarewicz <mina86@mina86.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index fd86c47de86f..bb90971182bd 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5674,7 +5674,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
5674 unsigned long start, unsigned long end) 5674 unsigned long start, unsigned long end)
5675{ 5675{
5676 /* This function is based on compact_zone() from compaction.c. */ 5676 /* This function is based on compact_zone() from compaction.c. */
5677 5677 unsigned long nr_reclaimed;
5678 unsigned long pfn = start; 5678 unsigned long pfn = start;
5679 unsigned int tries = 0; 5679 unsigned int tries = 0;
5680 int ret = 0; 5680 int ret = 0;
@@ -5701,7 +5701,9 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
5701 break; 5701 break;
5702 } 5702 }
5703 5703
5704 reclaim_clean_pages_from_list(cc->zone, &cc->migratepages); 5704 nr_reclaimed = reclaim_clean_pages_from_list(cc->zone,
5705 &cc->migratepages);
5706 cc->nr_migratepages -= nr_reclaimed;
5705 5707
5706 ret = migrate_pages(&cc->migratepages, 5708 ret = migrate_pages(&cc->migratepages,
5707 alloc_migrate_target, 5709 alloc_migrate_target,