diff options
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 8c0d9459b54a..a18201a8124e 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -1174,13 +1174,24 @@ static int __compact_finished(struct zone *zone, struct compact_control *cc, | |||
1174 | /* Direct compactor: Is a suitable page free? */ | 1174 | /* Direct compactor: Is a suitable page free? */ |
1175 | for (order = cc->order; order < MAX_ORDER; order++) { | 1175 | for (order = cc->order; order < MAX_ORDER; order++) { |
1176 | struct free_area *area = &zone->free_area[order]; | 1176 | struct free_area *area = &zone->free_area[order]; |
1177 | bool can_steal; | ||
1177 | 1178 | ||
1178 | /* Job done if page is free of the right migratetype */ | 1179 | /* Job done if page is free of the right migratetype */ |
1179 | if (!list_empty(&area->free_list[migratetype])) | 1180 | if (!list_empty(&area->free_list[migratetype])) |
1180 | return COMPACT_PARTIAL; | 1181 | return COMPACT_PARTIAL; |
1181 | 1182 | ||
1182 | /* Job done if allocation would set block type */ | 1183 | #ifdef CONFIG_CMA |
1183 | if (order >= pageblock_order && area->nr_free) | 1184 | /* MIGRATE_MOVABLE can fallback on MIGRATE_CMA */ |
1185 | if (migratetype == MIGRATE_MOVABLE && | ||
1186 | !list_empty(&area->free_list[MIGRATE_CMA])) | ||
1187 | return COMPACT_PARTIAL; | ||
1188 | #endif | ||
1189 | /* | ||
1190 | * Job done if allocation would steal freepages from | ||
1191 | * other migratetype buddy lists. | ||
1192 | */ | ||
1193 | if (find_suitable_fallback(area, order, migratetype, | ||
1194 | true, &can_steal) != -1) | ||
1184 | return COMPACT_PARTIAL; | 1195 | return COMPACT_PARTIAL; |
1185 | } | 1196 | } |
1186 | 1197 | ||