diff options
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index ccf97b02b85f..8fa254043801 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -852,16 +852,8 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, | |||
852 | pfn = isolate_migratepages_block(cc, pfn, block_end_pfn, | 852 | pfn = isolate_migratepages_block(cc, pfn, block_end_pfn, |
853 | ISOLATE_UNEVICTABLE); | 853 | ISOLATE_UNEVICTABLE); |
854 | 854 | ||
855 | /* | 855 | if (!pfn) |
856 | * In case of fatal failure, release everything that might | ||
857 | * have been isolated in the previous iteration, and signal | ||
858 | * the failure back to caller. | ||
859 | */ | ||
860 | if (!pfn) { | ||
861 | putback_movable_pages(&cc->migratepages); | ||
862 | cc->nr_migratepages = 0; | ||
863 | break; | 856 | break; |
864 | } | ||
865 | 857 | ||
866 | if (cc->nr_migratepages == COMPACT_CLUSTER_MAX) | 858 | if (cc->nr_migratepages == COMPACT_CLUSTER_MAX) |
867 | break; | 859 | break; |
@@ -1741,7 +1733,7 @@ void compaction_unregister_node(struct node *node) | |||
1741 | 1733 | ||
1742 | static inline bool kcompactd_work_requested(pg_data_t *pgdat) | 1734 | static inline bool kcompactd_work_requested(pg_data_t *pgdat) |
1743 | { | 1735 | { |
1744 | return pgdat->kcompactd_max_order > 0; | 1736 | return pgdat->kcompactd_max_order > 0 || kthread_should_stop(); |
1745 | } | 1737 | } |
1746 | 1738 | ||
1747 | static bool kcompactd_node_suitable(pg_data_t *pgdat) | 1739 | static bool kcompactd_node_suitable(pg_data_t *pgdat) |
@@ -1805,6 +1797,8 @@ static void kcompactd_do_work(pg_data_t *pgdat) | |||
1805 | INIT_LIST_HEAD(&cc.freepages); | 1797 | INIT_LIST_HEAD(&cc.freepages); |
1806 | INIT_LIST_HEAD(&cc.migratepages); | 1798 | INIT_LIST_HEAD(&cc.migratepages); |
1807 | 1799 | ||
1800 | if (kthread_should_stop()) | ||
1801 | return; | ||
1808 | status = compact_zone(zone, &cc); | 1802 | status = compact_zone(zone, &cc); |
1809 | 1803 | ||
1810 | if (zone_watermark_ok(zone, cc.order, low_wmark_pages(zone), | 1804 | if (zone_watermark_ok(zone, cc.order, low_wmark_pages(zone), |