From patchwork Fri Jan 4 12:49:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 10748305 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 810D213B5 for ; Fri, 4 Jan 2019 12:51:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D2E227F86 for ; Fri, 4 Jan 2019 12:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B9EF283A5; Fri, 4 Jan 2019 12:51:28 +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 C262B27F86 for ; Fri, 4 Jan 2019 12:51:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 003118E00D8; Fri, 4 Jan 2019 07:51:27 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EA6B18E00AE; Fri, 4 Jan 2019 07:51:26 -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 D97C78E00D8; Fri, 4 Jan 2019 07:51:26 -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 7705F8E00AE for ; Fri, 4 Jan 2019 07:51:26 -0500 (EST) Received: by mail-ed1-f71.google.com with SMTP id c18so34708199edt.23 for ; Fri, 04 Jan 2019 04:51:26 -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=gh9TjtpXh8D7hhgVdeb1KwN93Adcgexh1IigcGMkqmM=; b=eCdBpHzBb8hf85f+R4c/SDyRk0S6GkASRbnwLpixiLOnbUd9SWQC5f4ntyyJaCgPe5 L+FuLsYWQUNJRVca/tMK3jKh9yh2C+7ZaxrW8XTS8duRPD4Hh2DfeSwOfJKXPhMV7Rtn rDcA8age/RtAT1V9L80VmLqv8Za+SyNguwm+jcJbMoyq4kqam5hDEw0cQFxYCSYETtbF 8Rc59+cVDJ7OC7AS4AywZi4y/JgR7wcGvieQXQfQKnPWEcKbz47vK4bZWr+y0RB2EqzG b6H4/Chd6UzkjRs1rXSliXEarcLWZIEeoxPK8iKOkc6+u5BugkhviES8IhFLFfHstFN7 fsrA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 81.17.249.193 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Gm-Message-State: AA+aEWbbpm8ocAmUAa6XRZjz1R2DYZj8Td6/1Bq44FKDgsozatVASjSX jhpc2pzAplB0mWt236K9292dXTb+k6+dZFhv38F8depOwSFjvMYEbJBpxAEUS+uIsNJ6Ap7CBxJ oKzsw9k6oP9w76kPoTwZqxNdxfRJzc3QJaM4hgBO9md//6jPfRkIe57WkK4MoEgrv4w== X-Received: by 2002:a50:b559:: with SMTP id z25mr45445065edd.239.1546606285993; Fri, 04 Jan 2019 04:51:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/WfKCbtkagnYmeMhsM66bu9Vneut7Sjdw0+VfHcWHMhcnH8HLJUHh7wVpnqg148SvEj5tVc X-Received: by 2002:a50:b559:: with SMTP id z25mr45445026edd.239.1546606285233; Fri, 04 Jan 2019 04:51:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546606285; cv=none; d=google.com; s=arc-20160816; b=EqYwWk2FdP1Si8sWA4jIFhPOq43wY/TNIf+Xx4C2BXigGC+A3hfPuaKSTY6KMhu13G TaxJSuPl79UIL8vJ7z35GVqBfTaELu/CeFI5//fkqLusTlGv0MWuesfLcVojAJxBKJaD JuLWnxwhybJYC3zmh3XLTk0U+TmK2KCW0x2YgWT4XEGnKz4kuakUPSvAgonzrH4eUfFT y3JffJY9nA5r6ObgZdQ4/DDfOYPQH41NyhwDhxJJFbwlTq43fnRe3l1ax/XHkU45YPNQ 1Ua1JG4yonAm4g497WIb6pxMK8FYOXLUWPxTaaCMNfOggSzVe57RPNsqblFgh0+fnZMC QjIg== 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=gh9TjtpXh8D7hhgVdeb1KwN93Adcgexh1IigcGMkqmM=; b=cKJGFq1TbWjHkply04WxGSdzlS9gPA1Jud5bPdi/mqHD++UIfrgBZtxha/fA+GXK8E bO1CgT4KXusNFhY2LTr8HgIa2ukVwel6JO/oSqJjrX/064Yd6n3yLO/8gm+PoL6koUR1 DUvDnDv3t73DTPrX898ojAwDaaOXvQI57VmgXGn7MxNsKyVQaZosKANq53GCk1Eff2fL nDHTHPc0LtPIBIE+51/Ct+OuJgui13cJqtMZSK5GGOhU61mPNEPSnMunor/YzmUZflXG zo+ZS4nVTO08mDTz6K45jAoQnvg9nsehHVZxm7XVvSE6aXU1Qgnn+V2nox6qg8K5QYug LUGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 81.17.249.193 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from outbound-smtp25.blacknight.com (outbound-smtp25.blacknight.com. [81.17.249.193]) by mx.google.com with ESMTPS id gp17-v6si1475918ejb.103.2019.01.04.04.51.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 04:51:25 -0800 (PST) Received-SPF: pass (google.com: domain of mgorman@techsingularity.net designates 81.17.249.193 as permitted sender) client-ip=81.17.249.193; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 81.17.249.193 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp25.blacknight.com (Postfix) with ESMTPS id 69C32B87AA for ; Fri, 4 Jan 2019 12:51:23 +0000 (GMT) Received: (qmail 32386 invoked from network); 4 Jan 2019 12:51:23 -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:23 -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 06/25] mm, compaction: Skip pageblocks with reserved pages Date: Fri, 4 Jan 2019 12:49:52 +0000 Message-Id: <20190104125011.16071-7-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 Reserved pages are set at boot time, tend to be clustered and almost never become unreserved. When isolating pages for either migration sources or target, skip the entire pageblock is one PageReserved page is encountered on the grounds that it is highly probable the entire pageblock is reserved. The performance impact is relative to the number of reserved pages in the system and their location so it'll be variable but intuitively it should make sense. If the memblock allocator was ever changed to spread reserved pages throughout the address space then this patch would be impaired but it would also be considered a bug given that such a change would ruin fragmentation. On both 1-socket and 2-socket machines, scan rates are reduced slightly on workloads that intensively allocate THP while the system is fragmented. Signed-off-by: Mel Gorman --- mm/compaction.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index 3afa4e9188b6..94d1e5b062ea 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -484,6 +484,15 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, goto isolate_fail; } + /* + * A reserved page is never freed and tend to be clustered in + * the same pageblock. Skip the block. + */ + if (PageReserved(page)) { + blockpfn = end_pfn; + break; + } + if (!PageBuddy(page)) goto isolate_fail; @@ -827,6 +836,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; }