提交 d3a528a2 编写于 作者: M Mel Gorman 提交者: Shile Zhang

mm, compaction: always finish scanning of a full pageblock

to #26255339

commit efe771c7603bc524425070d651e70e9c56c57f28 upstream

When compaction is finishing, it uses a flag to ensure the pageblock is
complete but it makes sense to always complete migration of a pageblock.
Minimally, skip information is based on a pageblock and partially
scanned pageblocks may incur more scanning in the future.  The pageblock
skip handling also becomes more strict later in the series and the hint
is more useful if a complete pageblock was always scanned.

The potentially impacts latency as more scanning is done but it's not a
consistent win or loss as the scanning is not always a high percentage
of the pageblock and sometimes it is offset by future reductions in
scanning.  Hence, the results are not presented this time due to a
misleading mix of gains/losses without any clear pattern.  However, full
scanning of the pageblock is important for later patches.

Link: http://lkml.kernel.org/r/20190118175136.31341-8-mgorman@techsingularity.netSigned-off-by: NMel Gorman <mgorman@techsingularity.net>
Acked-by: NVlastimil Babka <vbabka@suse.cz>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Rientjes <rientjes@google.com>
Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NYang Shi <yang.shi@linux.alibaba.com>
Reviewed-by: NXunlei Pang <xlpang@linux.alibaba.com>
上级 bed49b98
...@@ -1331,16 +1331,14 @@ static enum compact_result __compact_finished(struct compact_control *cc) ...@@ -1331,16 +1331,14 @@ static enum compact_result __compact_finished(struct compact_control *cc)
if (is_via_compact_memory(cc->order)) if (is_via_compact_memory(cc->order))
return COMPACT_CONTINUE; return COMPACT_CONTINUE;
if (cc->finishing_block) { /*
/* * Always finish scanning a pageblock to reduce the possibility of
* We have finished the pageblock, but better check again that * fallbacks in the future. This is particularly important when
* we really succeeded. * migration source is unmovable/reclaimable but it's not worth
*/ * special casing.
if (IS_ALIGNED(cc->migrate_pfn, pageblock_nr_pages)) */
cc->finishing_block = false; if (!IS_ALIGNED(cc->migrate_pfn, pageblock_nr_pages))
else return COMPACT_CONTINUE;
return COMPACT_CONTINUE;
}
/* Direct compactor: Is a suitable page free? */ /* Direct compactor: Is a suitable page free? */
for (order = cc->order; order < MAX_ORDER; order++) { for (order = cc->order; order < MAX_ORDER; order++) {
...@@ -1382,7 +1380,6 @@ static enum compact_result __compact_finished(struct compact_control *cc) ...@@ -1382,7 +1380,6 @@ static enum compact_result __compact_finished(struct compact_control *cc)
return COMPACT_SUCCESS; return COMPACT_SUCCESS;
} }
cc->finishing_block = true;
return COMPACT_CONTINUE; return COMPACT_CONTINUE;
} }
} }
......
...@@ -204,7 +204,6 @@ struct compact_control { ...@@ -204,7 +204,6 @@ struct compact_control {
bool direct_compaction; /* False from kcompactd or /proc/... */ bool direct_compaction; /* False from kcompactd or /proc/... */
bool whole_zone; /* Whole zone should/has been scanned */ bool whole_zone; /* Whole zone should/has been scanned */
bool contended; /* Signal lock or sched contention */ bool contended; /* Signal lock or sched contention */
bool finishing_block; /* Finishing current pageblock */
}; };
unsigned long unsigned long
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册