From: Minchan Kim Date: Fri, 28 Sep 2012 00:20:00 +0000 (+1000) Subject: cma: decrease cc.nr_migratepages after reclaiming pagelist X-Git-Tag: next-20120928~1^2~197 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=48ce4b395d8d776b25cc97e0327d3bf3f9fd2f46;p=karo-tx-linux.git 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 Cc: Mel Gorman Cc: Michal Nazarewicz Cc: Bartlomiej Zolnierkiewicz Cc: Marek Szyprowski Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ddc155300a67..8e1be1c4bbbf 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5672,7 +5672,7 @@ static unsigned long pfn_max_align_up(unsigned long pfn) static int __alloc_contig_migrate_range(unsigned long start, unsigned long end) { /* This function is based on compact_zone() from compaction.c. */ - + unsigned long nr_reclaimed; unsigned long pfn = start; unsigned int tries = 0; int ret = 0; @@ -5708,7 +5708,9 @@ static int __alloc_contig_migrate_range(unsigned long start, unsigned long end) break; } - reclaim_clean_pages_from_list(cc.zone, &cc.migratepages); + nr_reclaimed = reclaim_clean_pages_from_list(cc.zone, + &cc.migratepages); + cc.nr_migratepages -= nr_reclaimed; ret = migrate_pages(&cc.migratepages, alloc_migrate_target,