diff options
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 0fbc6b73a522..1f61bcbd6262 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -934,6 +934,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
934 | struct zoneref *z; | 934 | struct zoneref *z; |
935 | struct zone *zone; | 935 | struct zone *zone; |
936 | int rc = COMPACT_SKIPPED; | 936 | int rc = COMPACT_SKIPPED; |
937 | int alloc_flags = 0; | ||
937 | 938 | ||
938 | /* Check if the GFP flags allow compaction */ | 939 | /* Check if the GFP flags allow compaction */ |
939 | if (!order || !may_enter_fs || !may_perform_io) | 940 | if (!order || !may_enter_fs || !may_perform_io) |
@@ -941,6 +942,10 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
941 | 942 | ||
942 | count_vm_event(COMPACTSTALL); | 943 | count_vm_event(COMPACTSTALL); |
943 | 944 | ||
945 | #ifdef CONFIG_CMA | ||
946 | if (allocflags_to_migratetype(gfp_mask) == MIGRATE_MOVABLE) | ||
947 | alloc_flags |= ALLOC_CMA; | ||
948 | #endif | ||
944 | /* Compact each zone in the list */ | 949 | /* Compact each zone in the list */ |
945 | for_each_zone_zonelist_nodemask(zone, z, zonelist, high_zoneidx, | 950 | for_each_zone_zonelist_nodemask(zone, z, zonelist, high_zoneidx, |
946 | nodemask) { | 951 | nodemask) { |
@@ -951,7 +956,8 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
951 | rc = max(status, rc); | 956 | rc = max(status, rc); |
952 | 957 | ||
953 | /* If a normal allocation would succeed, stop compacting */ | 958 | /* If a normal allocation would succeed, stop compacting */ |
954 | if (zone_watermark_ok(zone, order, low_wmark_pages(zone), 0, 0)) | 959 | if (zone_watermark_ok(zone, order, low_wmark_pages(zone), 0, |
960 | alloc_flags)) | ||
955 | break; | 961 | break; |
956 | } | 962 | } |
957 | 963 | ||