From patchwork Fri Dec 14 23:03:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 10731781 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 8E2BD1399 for ; Fri, 14 Dec 2018 23:03:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41E9F2D639 for ; Fri, 14 Dec 2018 23:03:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 360502D63D; Fri, 14 Dec 2018 23:03:29 +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 C898B2D639 for ; Fri, 14 Dec 2018 23:03:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DE0C8E021C; Fri, 14 Dec 2018 18:03:14 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9993F8E0216; Fri, 14 Dec 2018 18:03:14 -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 701F88E021E; Fri, 14 Dec 2018 18:03:14 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id 0E6888E021D for ; Fri, 14 Dec 2018 18:03:14 -0500 (EST) Received: by mail-ed1-f72.google.com with SMTP id c18so3349587edt.23 for ; Fri, 14 Dec 2018 15:03:14 -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=Dw0UV1TCQFA4d8gJKrA3/p7ohO2soOuPiIEMi/M3pF4=; b=c5jol0+sDgyZuOs/VfEPsPuO/Z2HCnx0EvDd9tMzBNyJ2ZprQ2OHOtyq9BUtCwb2HM xIQgkFi48m4kVAgbn8/1JAyPL796xKLM3D982iRxNqKTDAsZhomcA3FtE/g5Oir/jpLZ VNtKRgf0Wnu6JXPksRh8J5hdJITNubI8VcmaA6s8SrPcZsFvpBqwI1zcpU3Dm5Uh657m rTnmuZ2A4PTkEbY5u03JrX7AibeHLWxSCTGTY4H/Kxzr/NTchbRxaEHs8PI2IgEXjSFm IPmh5jr8uifRirI+FFoJ0imzt1Zu1TaVE9OxrikTCVJqaz5L1mztnZcSX1b9MBY9thLd 7xNw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 81.17.249.8 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Gm-Message-State: AA+aEWbfIrBSKpZX7N+ZHww2XNA9yh22h1mh3F0plCbDcqUWgwRiYEpV 3Ak4YpVxjZrXHCARUX6sY6tfq8m9v7avkTKjmAYK56jECucP3B8SMrt4Ov6Eou/lY5/zJM71HHz 4U4i+ijdy7mFN1FRvPp8eIZ0EeO2KtHrwUQ7GEXOgYWh3Cye9F6PYLNy/QvkSCzMHRA== X-Received: by 2002:aa7:d394:: with SMTP id x20mr4424999edq.193.1544828593563; Fri, 14 Dec 2018 15:03:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/X0pbTJkjudu8UG7CHlb5eCafExrLKKsz92/kEqJxK0MSfkq6tllYmM1LFR0mYTEiILyysI X-Received: by 2002:aa7:d394:: with SMTP id x20mr4424966edq.193.1544828592462; Fri, 14 Dec 2018 15:03:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544828592; cv=none; d=google.com; s=arc-20160816; b=uiJXbmtzFNwzSvwPM7/olbZoS5P915pNxzoAQGQoBGNnYxtEG45oRt67uUGyWiSUR7 dqx5efaQ7z9tfU/2TKAG7onEXSh6dTTgxEis0hzaDnvosu/Y+DhDw3jvRNvlUWLICDnO XWaI2QggySwzm2uPvLAA51+wAd4UYklSRcpotQHr6Ryt+hppSSOCxDrN3JZSyuRDiJzY 2H/SFk0Kc/qXgO4TM5mwtki3dQNd5xRXE3DjUhLUE7buFLyzkMKVyA5lDsjvif1bP+Vd QFwBy0sS+IXR1uTxFpRb7z3MvewCRx6sr8E/cSeOqthkHL+TO24SVvtaRxtPeQrgnm7u FYBQ== 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=Dw0UV1TCQFA4d8gJKrA3/p7ohO2soOuPiIEMi/M3pF4=; b=EpPH0xzYfEUxGAlpJOvYz87VsWvh0dVFsZn4n/EfXMpurG7/zy1pepDuFFuyhQt2M4 PdWFi0dGEavwKN31ttnUuoeFw4IrJ5fYTryw9ggJYf/uEo76jmuVMkqel70GYkvXpn4O /Jeu7Sin4QLZ30JXEBqrrTAoKay+FMFkp7MFfIfffeZZyzxhpJYeu35bzAh/fieVeZ9J 9uzbcm79L6r0br27tkvZaU/0OgdLURvXfA0H796MOm/z3ZIQIlQA458EqTr39ypvOZGA DPpldhVCbDk6OrWjha/K6qhiCQukNx8p12Ycb8mwl6DS4AuF79vA+zZcVRpV5zR4940E 6d2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 81.17.249.8 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from outbound-smtp02.blacknight.com (outbound-smtp02.blacknight.com. [81.17.249.8]) by mx.google.com with ESMTPS id x67si3305ede.100.2018.12.14.15.03.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 15:03:12 -0800 (PST) Received-SPF: pass (google.com: domain of mgorman@techsingularity.net designates 81.17.249.8 as permitted sender) client-ip=81.17.249.8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 81.17.249.8 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp02.blacknight.com (Postfix) with ESMTPS id 09AAE987AC for ; Fri, 14 Dec 2018 23:03:12 +0000 (UTC) Received: (qmail 31244 invoked from network); 14 Dec 2018 23:03:11 -0000 Received: from unknown (HELO stampy.163woodhaven.lan) (mgorman@techsingularity.net@[37.228.245.71]) by 81.17.254.9 with ESMTPA; 14 Dec 2018 23:03:11 -0000 From: Mel Gorman To: Linux-MM Cc: David Rientjes , Andrea Arcangeli , Linus Torvalds , Michal Hocko , ying.huang@intel.com, kirill@shutemov.name, Andrew Morton , Linux List Kernel Mailing , Mel Gorman Subject: [PATCH 05/14] mm, compaction: Skip pageblocks with reserved pages Date: Fri, 14 Dec 2018 23:03:01 +0000 Message-Id: <20181214230310.572-6-mgorman@techsingularity.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181214230310.572-1-mgorman@techsingularity.net> References: <20181214230310.572-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 Reserved pages are set at boot time, tend to be clustered and almost never become unreserved. When isolating pages for migrating, skip the entire pageblock is one PageReserved page is encountered on the grounds that it is highly probable the entire pageblock is reserved. The impact depends on the machine and timing but both thpscale and thpfioscale when using MADV_HUGEPAGE show a reduction of scanning and fault latency on a 1-socket machine. The 2-socket results were too noisy to draw any meaningful conclusion but it's safe to assume less scanning is useful. 1-socket thpfioscale 4.20.0-rc6 4.20.0-rc6 mmotm-20181210 noreserved-v1r4 Amean fault-base-1 1481.32 ( 0.00%) 1443.63 ( 2.54%) Amean fault-huge-1 1118.17 ( 0.00%) 981.30 * 12.24%* Amean fault-both-1 1176.43 ( 0.00%) 1052.64 * 10.52%* Compaction migrate scanned 3860713 3294284 Compaction free scanned 613786341 433423502 Kcompactd migrate scanned 408711 291915 Kcompactd free scanned 242509759 217164988 Signed-off-by: Mel Gorman --- mm/compaction.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index 3afa4e9188b6..8134dba47584 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -827,6 +827,13 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, goto isolate_success; } + /* + * A reserved page is never freed and tend to be + * clustered in the same pageblocks. Skip the block. + */ + if (PageReserved(page)) + low_pfn = end_pfn; + goto isolate_fail; }