Commit beb51eaa authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds

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: default avatarMinchan Kim <>
Acked-by: default avatarMel Gorman <>
Cc: Michal Nazarewicz <>
Cc: Bartlomiej Zolnierkiewicz <>
Cc: Marek Szyprowski <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent e46a2879
......@@ -5674,7 +5674,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
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;
......@@ -5701,7 +5701,9 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
reclaim_clean_pages_from_list(cc->zone, &cc->migratepages);
nr_reclaimed = reclaim_clean_pages_from_list(cc->zone,
cc->nr_migratepages -= nr_reclaimed;
ret = migrate_pages(&cc->migratepages,
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment