mm, compaction: remove ALLOC_CMA from __compaction_suitable()
authorCho KyongHo <pullip.cho@samsung.com>
Mon, 17 Apr 2017 05:59:30 +0000 (14:59 +0900)
committerhskang <hs1218.kang@samsung.com>
Mon, 27 Aug 2018 07:23:40 +0000 (16:23 +0900)
The following patch forces ALLOC_CMA to __zone_watermark_ok() in
__compaction_suitable() because the migration target free page can
be allocated from the free list of MIGRATE_CMA:
    984fdba6a32e mm, compaction: use proper alloc_flags in __compaction_suitable()

However, it is not true from the following patch:
    bf72522dabeb mm: compaction: exclude cma pages from compaction

Therefore, force 0 to __zone_watermark_ok() and revert the alloc_flag
in __isolate_free_page().

Change-Id: I95b3ac6e705f5546b93a8b5c4ceabeaa73d5642d
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
mm/compaction.c
mm/page_alloc.c

index dd84f376b50334fa9572bc5782c5219dca550b2a..2671627b467db842cd95eca79d5ad2f0f623fc8c 100644 (file)
@@ -1421,14 +1421,12 @@ static enum compact_result __compaction_suitable(struct zone *zone, int order,
         * if compaction succeeds.
         * For costly orders, we require low watermark instead of min for
         * compaction to proceed to increase its chances.
-        * ALLOC_CMA is used, as pages in CMA pageblocks are considered
-        * suitable migration targets
         */
        watermark = (order > PAGE_ALLOC_COSTLY_ORDER) ?
                                low_wmark_pages(zone) : min_wmark_pages(zone);
        watermark += compact_gap(order);
        if (!__zone_watermark_ok(zone, 0, watermark, classzone_idx,
-                                               ALLOC_CMA, wmark_target))
+                                               0, wmark_target))
                return COMPACT_SKIPPED;
 
        return COMPACT_CONTINUE;
index 843b1ceb505162daebba836e76a69bf0d8143f1b..6cb13ac3be0411a8d66fe3d6c4f6892a9364013b 100644 (file)
@@ -2706,7 +2706,7 @@ int __isolate_free_page(struct page *page, unsigned int order)
                 * exists.
                 */
                watermark = min_wmark_pages(zone) + (1UL << order);
-               if (!zone_watermark_ok(zone, 0, watermark, 0, ALLOC_CMA))
+               if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
                        return 0;
 
                __mod_zone_freepage_state(zone, -(1UL << order), mt);