From patchwork Wed Jan 25 13:44:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 13115651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD2C2C27C76 for ; Wed, 25 Jan 2023 13:45:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 577A86B007D; Wed, 25 Jan 2023 08:45:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 527076B0078; Wed, 25 Jan 2023 08:45:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EEDE6B007D; Wed, 25 Jan 2023 08:45:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3131B6B0075 for ; Wed, 25 Jan 2023 08:45:13 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0BD76A05F4 for ; Wed, 25 Jan 2023 13:45:13 +0000 (UTC) X-FDA: 80393442906.14.EA62EE0 Received: from outbound-smtp37.blacknight.com (outbound-smtp37.blacknight.com [46.22.139.220]) by imf28.hostedemail.com (Postfix) with ESMTP id 47EB1C0019 for ; Wed, 25 Jan 2023 13:45:09 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.220 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674654310; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fmVhptEyIszw83QdpnyRGbIftCOVSR2GH9v6/ZAuPg0=; b=cBsACrgNZ2hN1zC+DoRPZukPZKCWUyEOW+04b5VBLLEqyE4lYKI1PHHDv5vYWLRnAzBWyb DAk4kUo45bxO4AlTBkulas8pNsNh/7c6hMnPyPGT7OBeSw+rL0+a7Ei0Q0c9fFCMmZa5nI +7pOd2KYcFsCfJ1JYZ/4HCZo32/tzPU= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.220 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674654310; a=rsa-sha256; cv=none; b=KsE+ib/A7g2nhUC/wEyatw43db8IhWpElqxbhVuPk4lkguqWMTAhp1kv5AXSQMJHQxaLDj hVviOvtUpRvf9mys1pUbqdtUxu4a06bO6Dl0zoy8kmnk8SFr89IwxS7kYgc9KxLxfMsOoR tDnem117w+rHkr7x0+XUjqTFaHOVwq4= Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp37.blacknight.com (Postfix) with ESMTPS id 7277D1F8C for ; Wed, 25 Jan 2023 13:45:08 +0000 (GMT) Received: (qmail 21346 invoked from network); 25 Jan 2023 13:45:08 -0000 Received: from unknown (HELO morpheus.112glenside.lan) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPA; 25 Jan 2023 13:45:07 -0000 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , Jiri Slaby , Maxim Levitsky , Michal Hocko , Pedro Falcato , Paolo Bonzini , Chuyi Zhou , Linux-MM , LKML , Mel Gorman Subject: [PATCH 2/4] mm, compaction: Check if a page has been captured before draining PCP pages Date: Wed, 25 Jan 2023 13:44:32 +0000 Message-Id: <20230125134434.18017-3-mgorman@techsingularity.net> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230125134434.18017-1-mgorman@techsingularity.net> References: <20230125134434.18017-1-mgorman@techsingularity.net> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: mqwfcriqkipp385dtns6ok6qgcpze7kx X-Rspamd-Queue-Id: 47EB1C0019 X-HE-Tag: 1674654309-136549 X-HE-Meta: U2FsdGVkX18074Hhr/jJ6NqaXIXNVeFdT75Z9km1d4aSgT6NCs6TapjDxu1dpkRVpWLbL5Dm69LysixWW6kz8mG5fb2jG0bRvWdgR9xDtASekOvfI01Rhj0wVdYa1BWyMr1jFzJAwJRNRIVXTTMNqKvNomuFbozfYtpLPTu7alCUzULqRo0atrXgwYykP9WgLCsGiVABa9l+mj6fFNpzT6c1B9shiL7ljpGBotuI5LL9HrsX8+x2Nty6UrMsQKN++yb0WroDflLuWEoamsuiIqX+HWCWoiLJtIU3BlC/G/eSSgDO9C156iDFR9gp48hOaeUqJhGvqfidtlBPge0bxquYw8Qzzq5rnV7ToUGndqKrldH+Un+7fqc7XOpQiue/zlhMnmcGjWg5/4qUDi9z3R8EWu5SG4ykfu5NmwVOFoSnJFmL5/rbSJi22Lq2DLOj7J9C9OKi+w0ybO94rEcY4iAZ6L22SFUQQuBdfHY6tR6WVPS5/PBe17eVg1OOLsmZ4BwS4wo8kUVQrHiSJKtXvEETynXtQrD4/IoL/54/J/robuSre64UoxeuBztRoQhWpK/7K6B2fakhc/fmeKkhmJVhCWjIpeh91SPHj5pb+wt89kpjjPLNzCAb8AzPXUgA9BNuzTNvd2vn+/avLD/vCOZnXXS+Tg3Dn9kdg1y0aEw2XhPbbjuzeqR64MJYwRJ2l29DPYn8SnsS3sR5oD1KOrUhCO9uZCS84COw4l5FpchV1tFKH/gC7iclxczuzLSu7+pS8lJB+ZvlTBKXmh/2BWqrlLhtQTK/8JchgwMeVp8r5gjOJQ9m1rfSrfj4wKAQysnXUmX/d7CtJjArMAzaKgrjL5i4kDqxqa5UenrSUsEFC3QSkVB9arj1fD2gTPqfiygPKnztdIdZ+v4v8AsdS8wVycZcypc7p3ldIDHxbm+YEB71c8hjYTWsy8udA4D74AyR6S3n3nGeC4h6AJ7 +3A+NBQZ /2IxnllmOOUIN7u93lCtBrDGrzEG92QhLTJauyaPZzcE1jDubRf8Msi5Wi80fhbP28iYxewhO+NRf7zmxYAXhW8lIK/k0Q0V8C58NlXRPr2P5C3zyFIEha03Ac9E0vMJ2Po+ArF7UVbrkhuT2EFCia0HE4gianxNGRjndH+cusCx5JXQ4QUQ+xgmxFCp7ghLt/9jQnBM+yPOiSGO+V7Bk/vLJyoYL7cUcQ8A+7EVaPl1cMw844uFefzRdcS2KajHPMCDXRyzy/OfZpMgGzD+0hjOisqUVqrMoKFH2k8YcI/SWUAwzRkwrWuCVq4CLF98eZRHKDKgnctZgYUn5gZuBPhZmQ64qBi3/6XsGZQo7w8y7+B3q5dlo5uBtiA== 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: If a page has been captured then draining is unnecssary so check first for a captured page. Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka --- mm/compaction.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index c018b0e65720..28711a21a8a2 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2441,6 +2441,12 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) } } + /* Stop if a page has been captured */ + if (capc && capc->page) { + ret = COMPACT_SUCCESS; + break; + } + check_drain: /* * Has the migration scanner moved away from the previous @@ -2459,12 +2465,6 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) last_migrated_pfn = 0; } } - - /* Stop if a page has been captured */ - if (capc && capc->page) { - ret = COMPACT_SUCCESS; - break; - } } out: