Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp930045rwr; Wed, 26 Apr 2023 08:05:35 -0700 (PDT) X-Google-Smtp-Source: AKy350YEq78yEnDXzyUVumi5JqHgLgi8tpMsHBZnNYrGYSMAtcQ5jBUD4cmTQkKJVF2ZBN5prGSl X-Received: by 2002:a17:903:187:b0:1a6:e3e3:dbb8 with SMTP id z7-20020a170903018700b001a6e3e3dbb8mr22691611plg.44.1682521535047; Wed, 26 Apr 2023 08:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682521535; cv=none; d=google.com; s=arc-20160816; b=JBEN0mHYFAJLWvlVuJdEtvsPe5423O1xoZ4xFXL/+8mnXl9XHGthEdawULyyVI3e9j BNQ583v9fPRZh0ZiQbm0sEKcgBTNj6npA1KDo2PD9FRfmB/CMJs86SVPyf9h91s7BEQW FVjOuSAC3SlZImizTTiwVyaPdRynsehaGk3E4SADbCf2jpRx+BEFyMA4legi2iyCVqBB EgD3PSoagHOO0glv4IOTmPzxP3xZ4AqPG9oWByx21JfOZtIyjrPVv+DKI/37BGcyP8fT FPFJ/P8Fy78MI4jkr/QF5Vmh+fpBCD4oQVPmRQeWGT/yjP3TEtSM3OEF+ZA3YgTI31Lg 7ZOA== 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 :message-id:date:subject:cc:to:from; bh=xeos0l3lxIQ+q1+J4CR8W/JZZ5vLf/xJwoiFEtftr9U=; b=iisXBY68qf8NO9C9uQplvtwgGFUpdEkjMBudJZdiwUS1jfOexJQjKOVH3rokteSJ1q Z+jIVle4mmDowgPPcorSVSdUFEurhFlpgHh3+Rqv0j7mxtCYleFZNq5MfwkhG7CdCMrF YXlzBZgApy3FsQQ+neV9CQvJFmmLzebxHPTAPjQjwNk4FvuE4wuZbAU9fL/fWQmBBmtU BIZmZUCJT/SucQTJnJvKaj87pXPhazx09AnvUbudfwWdVQGzj2G0Vjswt7DbvswmS2R7 UOXZb5gy4Afy483YrHf1OH5CBraF9QINsvj0GhE+KUSCeP/ozkIpDTLg+cBZQHbL/WSn ZprA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ki7-20020a170903068700b001a93cb99252si14428508plb.375.2023.04.26.08.05.08; Wed, 26 Apr 2023 08:05:35 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240973AbjDZPDa (ORCPT + 99 others); Wed, 26 Apr 2023 11:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240651AbjDZPD3 (ORCPT ); Wed, 26 Apr 2023 11:03:29 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB345279 for ; Wed, 26 Apr 2023 08:03:27 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Vh3nnLS_1682521402; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0Vh3nnLS_1682521402) by smtp.aliyun-inc.com; Wed, 26 Apr 2023 23:03:23 +0800 From: Baolin Wang To: akpm@linux-foundation.org Cc: mgorman@techsingularity.net, vbabka@suse.cz, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] Revert "Revert "mm/compaction: fix set skip in fast_find_migrateblock"" Date: Wed, 26 Apr 2023 23:03:13 +0800 Message-Id: <3576e3520c044beb2a81860aecb2d4f597089300.1682521303.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL 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: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 95e7a450b8190673675836bfef236262ceff084a. When I tested thpscale with v6.3 kernel, I found the compaction efficiency had a great regression compared to v6.2-rc1 kernel. See below numbers: v6.2-rc v6.3 Percentage huge-3 81.35 ( 0.00%) 32.97 ( -59.47%) Percentage huge-5 89.92 ( 0.00%) 41.70 ( -53.63%) Percentage huge-7 92.41 ( 0.00%) 34.08 ( -63.12%) Percentage huge-12 90.29 ( 0.00%) 41.10 ( -54.49%) Percentage huge-18 82.38 ( 0.00%) 41.24 ( -49.95%) Percentage huge-24 80.34 ( 0.00%) 35.99 ( -55.20%) Percentage huge-30 88.90 ( 0.00%) 44.20 ( -50.28%) Percentage huge-32 90.69 ( 0.00%) 79.57 ( -12.25%) Ops Compaction stalls 113790.00 207099.00 Ops Compaction success 33983.00 19488.00 Ops Compaction failures 79807.00 187611.00 Ops Compaction efficiency 29.86 9.41 After some investigation, I found the commit 95e7a450b819 ("Revert mm/compaction: fix set skip in fast_find_migrateblock") caused the regression. This commit revert the commit 7efc3b726103 ("mm/compaction: fix set skip in fast_find_migrateblock") to fix a CPU stalling issue, which is caused by compaction stucked in repeating fast_find_migrateblock(). And now the compaction stalling issue is addressed by commit cfccd2e63e7e ("mm, compaction: finish pageblocks on complete migration failure"). So we should revert the temporary fix by commit 95e7a450b819, since the fast pfn found by fast_find_migrateblock() really can help to isolate some migratable pages. After reverting the commit, the regression has gone. v6.2-rc1 v6.3 v6.3_patched Percentage huge-3 81.35 ( 0.00%) 32.97 ( -59.47%) 87.78 ( 7.90%) Percentage huge-5 89.92 ( 0.00%) 41.70 ( -53.63%) 89.68 ( -0.27%) Percentage huge-7 92.41 ( 0.00%) 34.08 ( -63.12%) 85.89 ( -7.05%) Percentage huge-12 90.29 ( 0.00%) 41.10 ( -54.49%) 94.10 ( 4.22%) Percentage huge-18 82.38 ( 0.00%) 41.24 ( -49.95%) 85.06 ( 3.25%) Percentage huge-24 80.34 ( 0.00%) 35.99 ( -55.20%) 84.38 ( 5.02%) Percentage huge-30 88.90 ( 0.00%) 44.20 ( -50.28%) 95.54 ( 7.48%) Percentage huge-32 90.69 ( 0.00%) 79.57 ( -12.25%) 92.30 ( 1.78%) Signed-off-by: Baolin Wang --- mm/compaction.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index 33650541bebc..567c8d41d01e 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1860,7 +1860,6 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) pfn = cc->zone->zone_start_pfn; cc->fast_search_fail = 0; found_block = true; - set_pageblock_skip(freepage); break; } } -- 2.27.0