From patchwork Fri Jan 4 12:49:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 10748309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74EC114E5 for ; Fri, 4 Jan 2019 12:51:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62297282E8 for ; Fri, 4 Jan 2019 12:51:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 566DF283C9; Fri, 4 Jan 2019 12:51:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4AA2282E8 for ; Fri, 4 Jan 2019 12:51:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C7168E00DA; Fri, 4 Jan 2019 07:51:46 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 04E3B8E00AE; Fri, 4 Jan 2019 07:51:45 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E7FC78E00DA; Fri, 4 Jan 2019 07:51:45 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 8DFAA8E00AE for ; Fri, 4 Jan 2019 07:51:45 -0500 (EST) Received: by mail-ed1-f69.google.com with SMTP id 39so35261135edq.13 for ; Fri, 04 Jan 2019 04:51:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=5a0bYK8uQJJ65BCn1J11l0HIP4L9v14cwxclgN4TaaY=; b=uMYNtKVJdQ2XwiPuxZsZM0nQn+0XAc5mS3loTuQxbSlfY1xm8cpTLqYznfNPQujra9 Weq+j7harJOOAVFPjsfO8QaJr7/S0MwtM3tS13hHS34T90laVAfnUxWv0CDbdpWjlN11 +yIX93szvOL1d1PktDNGuIu4UNRjoWzMU+t3rQXxOa9IOi2nUPflA44lDxvVTtJgQHqt KfGT9EWa+fXMBdBlhnS4zxOWrHkfG+7SbYd0UMmoLlBasFrnl/6VWmdyInWSDKD9JDDY hZiYTSXGraNix19Hjo7NK8bMWXKT+23egwk9JeObK/ZOMHhS9nK/IKCZ6P20edAPfTkm Av/Q== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Gm-Message-State: AA+aEWYUlEdSJSNoWMINy3xLSYFk4dT4ugt/7tTtj7EiaCIyaZsWc0p7 FM/8IIZ+qrC+E2SMoVqnnoM1HfcJRn7Y3CIKxfUQxYkmdCUzhSvFd6F3OxhkWFdBWhkb52vfzCr 91Gwl5FNJCjby7bfv6dpawrMhlnd7ugafqpGdnTUISFttfjZyh3ITUqCu72obzPwOqQ== X-Received: by 2002:a50:aa68:: with SMTP id p37mr45048450edc.168.1546606305071; Fri, 04 Jan 2019 04:51:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/U1wLXXBzOa7ZZs5tFqkh1UuJ90o2zfymyutdkixdQD2jh+SktgnygmiR6qvYivDnsyUFbk X-Received: by 2002:a50:aa68:: with SMTP id p37mr45048405edc.168.1546606304134; Fri, 04 Jan 2019 04:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546606304; cv=none; d=google.com; s=arc-20160816; b=Rgc0j2BfuYs4Z2QXcblLXKI/9lAZ3r4u9/Re7/F2vNfpc9dOBp7e5BHT5uApZSqsGW 2D+GMQMhMJcRLUjczWz5KRCvxvd1PoNJGWFw39NJZnV+tTKQ6aRZwtvIf+KnIBtzyHFS RmzeQh0tIHQtt6WjfRy5aFIGOUqSDwgjIyACaNpeJzoUFQnMUpj0VBgF4pIcW7tLFR2k gVqM7xMTvPg+C19wiNjYbBA4L6mnMU82dQQedGctRvmsEAM4eQTy6gW7iIbSOXGdaojU Pg0EmrSntk0BYP+oL2IFnQlFXToRiJVu1NUHzim2frRHK2gQprYTd9EPpXpQnY9POpRw H6aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=5a0bYK8uQJJ65BCn1J11l0HIP4L9v14cwxclgN4TaaY=; b=clWS96EiZ5qubXfW3W4rzaXQFFG+mw1NYx614hnRvcnlITq5PpIGBsJa+xGKTpkSU0 UwxHQ7RKDcuvPFDMRqRLuq3QHEdpyipZfpKVw1budveB5ffvdekaU8i6e0NEKE3uLpJz x3vM+/i0/FpOGEWiSchFwxrtBvjjxeuJD8vFVXHXXBzhBwj5ZCgLbG8QJkINfwngSIGY q1y041ZNMwS1VPkysX+ubM3YnHFupfS3IngiQwdp/MGn7HvJIYLlOGTrmRxwI+1qdsIF Ovi6FEZBmKtXULjT17zukIsJN1lLbsfeTZPJS5B01eFNU20j2qO9xFiGnam03DeNDC86 fOaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from outbound-smtp12.blacknight.com (outbound-smtp12.blacknight.com. [46.22.139.17]) by mx.google.com with ESMTPS id w51si5062526edw.91.2019.01.04.04.51.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 04:51:44 -0800 (PST) Received-SPF: pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) client-ip=46.22.139.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp12.blacknight.com (Postfix) with ESMTPS id C8A7D1C1D6B for ; Fri, 4 Jan 2019 12:51:43 +0000 (GMT) Received: (qmail 1122 invoked from network); 4 Jan 2019 12:51:43 -0000 Received: from unknown (HELO stampy.163woodhaven.lan) (mgorman@techsingularity.net@[37.228.229.96]) by 81.17.254.9 with ESMTPA; 4 Jan 2019 12:51:43 -0000 From: Mel Gorman To: Linux-MM Cc: David Rientjes , Andrea Arcangeli , Vlastimil Babka , ying.huang@intel.com, kirill@shutemov.name, Andrew Morton , Linux List Kernel Mailing , Mel Gorman Subject: [PATCH 08/25] mm, compaction: Always finish scanning of a full pageblock Date: Fri, 4 Jan 2019 12:49:54 +0000 Message-Id: <20190104125011.16071-9-mgorman@techsingularity.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190104125011.16071-1-mgorman@techsingularity.net> References: <20190104125011.16071-1-mgorman@techsingularity.net> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 94d1e5b062ea..8bf2090231a3 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1347,16 +1347,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++) { @@ -1398,7 +1396,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 c6f794ad21a9..edb4029f64c8 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -202,7 +202,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