The patch titled Subject: mm, compaction: remove redundant watermark check in compact_finished() has been added to the -mm tree. Its filename is mm-compaction-remove-redundant-watermark-check-in-compact_finished.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-compaction-remove-redundant-watermark-check-in-compact_finished.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-compaction-remove-redundant-watermark-check-in-compact_finished.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Vlastimil Babka <vbabka@xxxxxxx> Subject: mm, compaction: remove redundant watermark check in compact_finished() When detecting whether compaction has succeeded in forming a high-order page, __compact_finished() employs a watermark check, followed by an own search for a suitable page in the freelists. This is not ideal for two reasons: - The watermark check also searches high-order freelists, but has a less strict criteria wrt fallback. It's therefore redundant and waste of cycles. This was different in the past when high-order watermark check attempted to apply reserves to high-order pages. - The watermark check might actually fail due to lack of order-0 pages. Compaction can't help with that, so there's no point in continuing because of that. It's possible that high-order page still exists and it terminates. This patch therefore removes the watermark check. This should save some cycles and terminate compaction sooner in some cases. Link: http://lkml.kernel.org/r/20170307131545.28577-3-vbabka@xxxxxxx Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx> Acked-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/compaction.c | 8 -------- 1 file changed, 8 deletions(-) diff -puN mm/compaction.c~mm-compaction-remove-redundant-watermark-check-in-compact_finished mm/compaction.c --- a/mm/compaction.c~mm-compaction-remove-redundant-watermark-check-in-compact_finished +++ a/mm/compaction.c @@ -1280,7 +1280,6 @@ static enum compact_result __compact_fin const int migratetype) { unsigned int order; - unsigned long watermark; if (cc->contended || fatal_signal_pending(current)) return COMPACT_CONTENDED; @@ -1308,13 +1307,6 @@ static enum compact_result __compact_fin if (is_via_compact_memory(cc->order)) return COMPACT_CONTINUE; - /* Compaction run is not finished if the watermark is not met */ - watermark = zone->watermark[cc->alloc_flags & ALLOC_WMARK_MASK]; - - if (!zone_watermark_ok(zone, cc->order, watermark, cc->classzone_idx, - cc->alloc_flags)) - return COMPACT_CONTINUE; - /* Direct compactor: Is a suitable page free? */ for (order = cc->order; order < MAX_ORDER; order++) { struct free_area *area = &zone->free_area[order]; _ Patches currently in -mm which might be from vbabka@xxxxxxx are mm-compaction-reorder-fields-in-struct-compact_control.patch mm-compaction-remove-redundant-watermark-check-in-compact_finished.patch mm-page_alloc-split-smallest-stolen-page-in-fallback.patch mm-page_alloc-count-movable-pages-when-stealing-from-pageblock.patch mm-compaction-change-migrate_async_suitable-to-suitable_migration_source.patch mm-compaction-add-migratetype-to-compact_control.patch mm-compaction-restrict-async-compaction-to-pageblocks-of-same-migratetype.patch mm-compaction-finish-whole-pageblock-to-reduce-fragmentation.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html