From patchwork Fri Jan 18 17:51:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 10771365 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 618B06C5 for ; Fri, 18 Jan 2019 17:53:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F9A32FC07 for ; Fri, 18 Jan 2019 17:53:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 429072FEF7; Fri, 18 Jan 2019 17:53:02 +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 B50D12FC07 for ; Fri, 18 Jan 2019 17:53:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D53448E0015; Fri, 18 Jan 2019 12:53:00 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D01E38E0002; Fri, 18 Jan 2019 12:53:00 -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 C177D8E0015; Fri, 18 Jan 2019 12:53:00 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 6AFBC8E0002 for ; Fri, 18 Jan 2019 12:53:00 -0500 (EST) Received: by mail-ed1-f71.google.com with SMTP id d41so5132626eda.12 for ; Fri, 18 Jan 2019 09:53:00 -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=GIODWge4DE70mVQvwggzR7h97SS/9XUfczXOJuwvTWs=; b=sMP5jvgwV/17VSUm8Ivluof22pLODaKvLCt94AX47ViWyEjrOtZiRHtwvAAetH7Sci DVh2BPxEJF/jOMC0IQS9wX6By7RaZjvn8UAE7f+dLXZ8Zq05YHHznhgoN9knnSb104Wt SBDDz84ztY2l5orsVHADqzIjuxcoJVGB5t3kFofBi8qxgJe1ODvNbR9bAF38Ce4sKF73 MDufaD3ekeOw+/faQZFnEKw/y5itHb9Z2rwuyNpCgIogaq+qNF4WnqVRyYBzJpQ3wMJj E4E6OyyV8hrzVMCx3TH8tvtIzPoc6bU7hV0YNX0nbVFWVXTonVB+oEKhJkpFVyt8gZLJ O88A== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.13 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Gm-Message-State: AJcUukd0MCo5JqsIX2CmhYaKcvQugRuw7RDCBHG1lWamjfnwI9GwwAea aqmJXuQGjpWomxgHaaDd6eqp0twllOO3TH7jg6/w0dZYJcVVAQ25jUmBQ6zYIquNB2bCDkmVYSA dwPS0Fg6XhuoUBI8o9Ym3b0crUDWnYhU5jawFrPAd4RDDkcuLV6Hxcjr38aWQFpdnoA== X-Received: by 2002:a17:906:2615:: with SMTP id h21-v6mr15507519ejc.21.1547833979906; Fri, 18 Jan 2019 09:52:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN4+iLQcUg+CQlSKuQ4I1+05aWfA25XDPmw+en6ANXX5zqy4sqFNBGGwaCLzEe2n0/HzE/JY X-Received: by 2002:a17:906:2615:: with SMTP id h21-v6mr15507447ejc.21.1547833978644; Fri, 18 Jan 2019 09:52:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547833978; cv=none; d=google.com; s=arc-20160816; b=b5EmYFLg+iazEly6z/DuGVhf6PIJrrA4WG48pWQtLXck+z3eNPEHIIuIf/HmJ6PWN8 eHsBhuK68yQ8UsXlcBroD3BRTFnoafPVqiI+sPHgC7whbj8GYgBh0aJikMYH4parBVfT poqPzDfsssnio5qJsbVuoZqPprQTshZpH2oh4brOk1EdC2G6zqk4wQzyRuZvGbe4e4aZ ICajHu6pm/0ivMCnX0nO272RIos/2rzoN9vKgWmjTyifg4nIMwW+54tHimJBQ+AsNWnN SufFJr0xdFpcYoev+3w9rTA+5EFoNZlBWNQizgI+R7oUN60vO56aaycEG8m/ClFFK8KZ UUzg== 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=GIODWge4DE70mVQvwggzR7h97SS/9XUfczXOJuwvTWs=; b=Px1yJhVyaWwBnMYPTN2QhPdxBDzf9LywYvjOvnsAy0P1wlcHAm5RFYkjifIs/8OVl+ /d6AKnYBSIqKRWg8V+49cUNSDWMiijlmmmy0fRhmykn5BYCJb70kcyqziT4vMfycBqH2 dt8LwKHrUnQTYp0G4QKQE7sjHwhcVTdXsvpyOEbPnNUfmR2AijTB2HvY3Hnu5uY/rVL/ 4k1z63a1m/YQe7qiw2J6Tew7hrVHDXAj0MFTvYRdiqlQ6CVxlTP4XK3QLAvDLJdK0rEL WcB7QpU8iEhxMJqmP4vE4/nsy+TDjFsvzbkdk97Pstk6dLSXaBHa7Q/JREemsnaIq2cm BkeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.13 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from outbound-smtp08.blacknight.com (outbound-smtp08.blacknight.com. [46.22.139.13]) by mx.google.com with ESMTPS id h13si7559633edf.24.2019.01.18.09.52.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 09:52:58 -0800 (PST) Received-SPF: pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.13 as permitted sender) client-ip=46.22.139.13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.13 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp08.blacknight.com (Postfix) with ESMTPS id 579DF1C35A9 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> 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 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