diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/compaction.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index dcb058bd76c4..38ce48805c08 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -494,12 +494,13 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) | |||
494 | 494 | ||
495 | while ((ret = compact_finished(zone, cc)) == COMPACT_CONTINUE) { | 495 | while ((ret = compact_finished(zone, cc)) == COMPACT_CONTINUE) { |
496 | unsigned long nr_migrate, nr_remaining; | 496 | unsigned long nr_migrate, nr_remaining; |
497 | int err; | ||
497 | 498 | ||
498 | if (!isolate_migratepages(zone, cc)) | 499 | if (!isolate_migratepages(zone, cc)) |
499 | continue; | 500 | continue; |
500 | 501 | ||
501 | nr_migrate = cc->nr_migratepages; | 502 | nr_migrate = cc->nr_migratepages; |
502 | migrate_pages(&cc->migratepages, compaction_alloc, | 503 | err = migrate_pages(&cc->migratepages, compaction_alloc, |
503 | (unsigned long)cc, false, | 504 | (unsigned long)cc, false, |
504 | cc->sync); | 505 | cc->sync); |
505 | update_nr_listpages(cc); | 506 | update_nr_listpages(cc); |
@@ -513,7 +514,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) | |||
513 | nr_remaining); | 514 | nr_remaining); |
514 | 515 | ||
515 | /* Release LRU pages not migrated */ | 516 | /* Release LRU pages not migrated */ |
516 | if (!list_empty(&cc->migratepages)) { | 517 | if (err) { |
517 | putback_lru_pages(&cc->migratepages); | 518 | putback_lru_pages(&cc->migratepages); |
518 | cc->nr_migratepages = 0; | 519 | cc->nr_migratepages = 0; |
519 | } | 520 | } |