Message ID | 20230125134434.18017-4-mgorman@techsingularity.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp286392wrn; Wed, 25 Jan 2023 05:58:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXtq5nL63rG9U5EDWeqoColO/x6tIKk0OiJwDDdW+gUFO22ibvNXFqH6kixa9uSGBM26nGx1 X-Received: by 2002:a62:1851:0:b0:581:95a7:d2f4 with SMTP id 78-20020a621851000000b0058195a7d2f4mr51288823pfy.9.1674655124399; Wed, 25 Jan 2023 05:58:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674655124; cv=none; d=google.com; s=arc-20160816; b=dOGMhIc8xfssUCl3JfzusvF0/57KWYcRy7ri1FxAJ1dPgdCfMF1V7AOHcmxNkt9XzW YE4OVU52UXZSr9Jw5drXJ9ODWRpZNwbmg3ME1yWyXaQisci9M8vqQE3Zc0IOsUH6qMvm INuX4s+vj/yMogm98rD4lHn9MgRpTB+4J/BHxVM+rsRg4x4do1uDsdsAaXnN17JdkVH2 5GlDkSAC5nwdjmbgP1kWsz7EhPYYdsh75kelx/9YQHI1/n+GdmfEFhzTHUYRpzbWwm4G BYohKKF/N0JFyTjQw4yXBJ3BUY/K1iyz7hbGDhDcLpTjuOQLaEwEWRoWt1AdZ5Z6c1iE yO4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bLWsjn14X33upIrHmANmDBz9DJQXfXX59tK6m2PYat4=; b=MwlGGQQ7eZCQMp2iaW7sWlnMsq6coqEm3g/Tq0cpFhjkMR+11z8RrbKYJZETy6JNWJ XD2NLEhaQmFO9mx1881uVKoV0fRO8TJUqjiVaSsVugMRwT3hr1jvTrLUipI2A16KFTuV lLyN9f0K8JprnIUzUIZrwIeclaql1FV+tLhRRR/O10qSED+FbDX4gQE+ads6nJxnNRUm nJyMUM/aG+qzCxARS30X/kM0jvUVErlmcREHSZqIb1hXCX8cMrao0s6ZEVlAOGC6WoNp QGV4x/G7cjUB/7P6TH5+48JelsR8h02VL1fQuHc6Bom7wi/d2C9yWCcYnkJz75GvIXoO npKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a625b06000000b0058844c5a92dsi5146047pfb.342.2023.01.25.05.58.32; Wed, 25 Jan 2023 05:58:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235405AbjAYNp3 (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Wed, 25 Jan 2023 08:45:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235651AbjAYNpV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Jan 2023 08:45:21 -0500 Received: from outbound-smtp28.blacknight.com (outbound-smtp28.blacknight.com [81.17.249.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5292913503 for <linux-kernel@vger.kernel.org>; Wed, 25 Jan 2023 05:45:20 -0800 (PST) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp28.blacknight.com (Postfix) with ESMTPS id CA76246026 for <linux-kernel@vger.kernel.org>; Wed, 25 Jan 2023 13:45:18 +0000 (GMT) Received: (qmail 21935 invoked from network); 25 Jan 2023 13:45:18 -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:18 -0000 From: Mel Gorman <mgorman@techsingularity.net> To: Vlastimil Babka <vbabka@suse.cz> Cc: Andrew Morton <akpm@linux-foundation.org>, Jiri Slaby <jirislaby@kernel.org>, Maxim Levitsky <mlevitsk@redhat.com>, Michal Hocko <mhocko@kernel.org>, Pedro Falcato <pedro.falcato@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Chuyi Zhou <zhouchuyi@bytedance.com>, Linux-MM <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>, Mel Gorman <mgorman@techsingularity.net> Subject: [PATCH 3/4] mm, compaction: Finish scanning the current pageblock if requested Date: Wed, 25 Jan 2023 13:44:33 +0000 Message-Id: <20230125134434.18017-4-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756003171569120243?= X-GMAIL-MSGID: =?utf-8?q?1756003171569120243?= |
Series |
Fix excessive CPU usage during compaction
|
|
Commit Message
Mel Gorman
Jan. 25, 2023, 1:44 p.m. UTC
cc->finish_pageblock is set when the current pageblock should be
rescanned but fast_find_migrateblock can select an alternative
block. Disable fast_find_migrateblock when the current pageblock
scan should be completed.
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
---
mm/compaction.c | 7 +++++++
1 file changed, 7 insertions(+)
Comments
On 1/25/23 14:44, Mel Gorman wrote: > cc->finish_pageblock is set when the current pageblock should be > rescanned but fast_find_migrateblock can select an alternative > block. Disable fast_find_migrateblock when the current pageblock > scan should be completed. > > Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Acked-by: Vlastimil Babka <vbabka@suse.cz> > --- > mm/compaction.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/mm/compaction.c b/mm/compaction.c > index 28711a21a8a2..4b3a0238879c 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -1762,6 +1762,13 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) > if (cc->ignore_skip_hint) > return pfn; > > + /* > + * If the pageblock should be finished then do not select a different > + * pageblock. > + */ > + if (cc->finish_pageblock) > + return pfn; > + > /* > * If the migrate_pfn is not at the start of a zone or the start > * of a pageblock then assume this is a continuation of a previous
diff --git a/mm/compaction.c b/mm/compaction.c index 28711a21a8a2..4b3a0238879c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1762,6 +1762,13 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) if (cc->ignore_skip_hint) return pfn; + /* + * If the pageblock should be finished then do not select a different + * pageblock. + */ + if (cc->finish_pageblock) + return pfn; + /* * If the migrate_pfn is not at the start of a zone or the start * of a pageblock then assume this is a continuation of a previous