mm, compaction: split off flag for not updating skip hints
authorVlastimil Babka <vbabka@suse.cz>
Fri, 17 Nov 2017 23:26:38 +0000 (15:26 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 00:10:00 +0000 (16:10 -0800)
Pageblock skip hints were added as a heuristic for compaction, which
shares core code with CMA.  Since CMA reliability would suffer from the
heuristics, compact_control flag ignore_skip_hint was added for the CMA
use case.  Since 6815bf3f233e ("mm/compaction: respect ignore_skip_hint
in update_pageblock_skip") the flag also means that CMA won't *update*
the skip hints in addition to ignoring them.

Today, direct compaction can also ignore the skip hints in the last
resort attempt, but there's no reason not to set them when isolation
fails in such case.  Thus, this patch splits off a new no_set_skip_hint
flag to avoid the updating, which only CMA sets.  This should improve
the heuristics a bit, and allow us to simplify the persistent skip bit
handling as the next step.

Link: http://lkml.kernel.org/r/20171102121706.21504-2-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/compaction.c
mm/internal.h
mm/page_alloc.c

index e8f5b4e2cb05511c7b9c53d1351e8a17c93afb0a..bb1188a9d58ed578dfca3cea77a905cb95c31e30 100644 (file)
@@ -295,7 +295,7 @@ static void update_pageblock_skip(struct compact_control *cc,
        struct zone *zone = cc->zone;
        unsigned long pfn;
 
-       if (cc->ignore_skip_hint)
+       if (cc->no_set_skip_hint)
                return;
 
        if (!page)
index 1df011f624801ffbdf3379a6d17218d9b32280e1..e6bd35182daee1226b684464fd202df86762c636 100644 (file)
@@ -198,6 +198,7 @@ struct compact_control {
        const int classzone_idx;        /* zone index of a direct compactor */
        enum migrate_mode mode;         /* Async or sync migration mode */
        bool ignore_skip_hint;          /* Scan blocks even if marked skip */
+       bool no_set_skip_hint;          /* Don't mark blocks for skipping */
        bool ignore_block_suitable;     /* Scan blocks considered unsuitable */
        bool direct_compaction;         /* False from kcompactd or /proc/... */
        bool whole_zone;                /* Whole zone should/has been scanned */
index 55ded92f9809e0ff798589658e87bd1c85bc69a0..d4096f4a5c1f75a276620b89cad5e2ed8878d0b0 100644 (file)
@@ -7619,6 +7619,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
                .zone = page_zone(pfn_to_page(start)),
                .mode = MIGRATE_SYNC,
                .ignore_skip_hint = true,
+               .no_set_skip_hint = true,
                .gfp_mask = current_gfp_context(gfp_mask),
        };
        INIT_LIST_HEAD(&cc.migratepages);