mm: compaction: use helper isolation_suitable()
authorMiaohe Lin <linmiaohe@huawei.com>
Fri, 29 Apr 2022 06:16:06 +0000 (23:16 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 06:16:06 +0000 (23:16 -0700)
Use helper isolation_suitable() to check whether page is suitable to
isolate to simplify the code.  Minor readability improvement.

Link: https://lkml.kernel.org/r/20220322110750.60311-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c

index fe915db..baf654b 100644 (file)
@@ -899,7 +899,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
                 * not falsely conclude that the block should be skipped.
                 */
                if (!valid_page && IS_ALIGNED(low_pfn, pageblock_nr_pages)) {
-                       if (!cc->ignore_skip_hint && get_pageblock_skip(page)) {
+                       if (!isolation_suitable(cc, page)) {
                                low_pfn = end_pfn;
                                page = NULL;
                                goto isolate_abort;