Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3411884imu; Fri, 18 Jan 2019 09:55:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN5bqvqNdMKw1myQM3454CRnlHmiWm2GC+phjYN9g1x6Jj0zWLX7DA2wOfrV6d69l9Annwqw X-Received: by 2002:a63:66c6:: with SMTP id a189mr18686434pgc.167.1547834104073; Fri, 18 Jan 2019 09:55:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547834104; cv=none; d=google.com; s=arc-20160816; b=jgNUigkNJLibjlFQLYJb62Zup4BNdRA4NO8pJwGYxcXHQoJzWvHk5BFS4/jDhxYf3V +FknFYrKnZoG0zWoOF0+jPqzyHwoC0o3tgNsSOX7OHZKDno7LwDJOY0Sb7tTNtAivsPf 4Vz7RpGz7HPICebWtudE9KcqnJ6Ew1CZQzt+82biFU/GnE6LCzWqQw5Ua2JHbzpx1BQ5 6QC5F1OB1aPB6d8BYkjJ0t1B26BPx057XsYLpyYb5Av/8QVlGFCdTGLUCrcUGZ6rnQQZ pSTXnEB3qGumiOi+PtLQ+m/x9GAkWX168fqL8siD6XHjjN9o2bedWPKl0RaqvJQE72QK Fq4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=GIODWge4DE70mVQvwggzR7h97SS/9XUfczXOJuwvTWs=; b=pmum/CecCeIF08WpZqZwBGyJdl4TmPpywUnj1xlBIbuW0B33wigTn0S4s10BgjX6jl g5Ae+D379aOjhQn5Lryo+ZuRdKHtahHZjzw55CZKFm5NCqWgdE3EyNXmxGUzI9VkDd1C XYRKmuVldMN1ne3PiMmhP2TxhWaH8NDFnq7cd2Qa0sI9EeCRSj/jNJVW0jHU19Em0rBB SGQh+q+2IiRuiKSj+rDo0+J3rOf6UTFu0AYoL2zrpBR7C5n3EZgZJSJzKMD4psVg5zSl VRcd0Fb974cVKEVltC/6PCUjD8pQ8OEFXgCELqCdeu18UTK1zHhEBkeahwB+sfvPk4dV lCPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si4850539pgl.303.2019.01.18.09.54.48; Fri, 18 Jan 2019 09:55:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728819AbfARRxA (ORCPT + 99 others); Fri, 18 Jan 2019 12:53:00 -0500 Received: from outbound-smtp25.blacknight.com ([81.17.249.193]:60052 "EHLO outbound-smtp25.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728426AbfARRxA (ORCPT ); Fri, 18 Jan 2019 12:53:00 -0500 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp25.blacknight.com (Postfix) with ESMTPS id 534FBB87ED for ; Fri, 18 Jan 2019 17:52:58 +0000 (GMT) Received: (qmail 1326 invoked from network); 18 Jan 2019 17:52:58 -0000 Received: from unknown (HELO stampy.163woodhaven.lan) (mgorman@techsingularity.net@[37.228.229.96]) by 81.17.254.9 with ESMTPA; 18 Jan 2019 17:52:58 -0000 From: Mel Gorman To: Andrew Morton Cc: David Rientjes , Andrea Arcangeli , Vlastimil Babka , Linux List Kernel Mailing , Linux-MM , Mel Gorman Subject: [PATCH 07/22] mm, compaction: Always finish scanning of a full pageblock Date: Fri, 18 Jan 2019 17:51:21 +0000 Message-Id: <20190118175136.31341-8-mgorman@techsingularity.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190118175136.31341-1-mgorman@techsingularity.net> References: <20190118175136.31341-1-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka --- mm/compaction.c | 19 ++++++++----------- mm/internal.h | 1 - 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 32a88b49f973..3d11c209614a 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1331,16 +1331,14 @@ static enum compact_result __compact_finished(struct compact_control *cc) if (is_via_compact_memory(cc->order)) return COMPACT_CONTINUE; - if (cc->finishing_block) { - /* - * We have finished the pageblock, but better check again that - * we really succeeded. - */ - if (IS_ALIGNED(cc->migrate_pfn, pageblock_nr_pages)) - cc->finishing_block = false; - else - return COMPACT_CONTINUE; - } + /* + * Always finish scanning a pageblock to reduce the possibility of + * fallbacks in the future. This is particularly important when + * migration source is unmovable/reclaimable but it's not worth + * special casing. + */ + if (!IS_ALIGNED(cc->migrate_pfn, pageblock_nr_pages)) + return COMPACT_CONTINUE; /* Direct compactor: Is a suitable page free? */ for (order = cc->order; order < MAX_ORDER; order++) { @@ -1382,7 +1380,6 @@ static enum compact_result __compact_finished(struct compact_control *cc) return COMPACT_SUCCESS; } - cc->finishing_block = true; return COMPACT_CONTINUE; } } diff --git a/mm/internal.h b/mm/internal.h index f40d06d70683..9b32f4cab0ae 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -203,7 +203,6 @@ struct compact_control { bool direct_compaction; /* False from kcompactd or /proc/... */ bool whole_zone; /* Whole zone should/has been scanned */ bool contended; /* Signal lock or sched contention */ - bool finishing_block; /* Finishing current pageblock */ }; unsigned long -- 2.16.4