diff options
Diffstat (limited to 'mm/compaction.c')
| -rw-r--r-- | mm/compaction.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 7f9e60489d67..e0d4a58bcee4 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -905,8 +905,16 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, pfn = isolate_migratepages_block(cc, pfn, block_end_pfn, ISOLATE_UNEVICTABLE); - if (!pfn) + /* + * In case of fatal failure, release everything that might + * have been isolated in the previous iteration, and signal + * the failure back to caller. + */ + if (!pfn) { + putback_movable_pages(&cc->migratepages); + cc->nr_migratepages = 0; break; + } if (cc->nr_migratepages == COMPACT_CLUSTER_MAX) break; |
