From patchwork Wed Apr 26 15:03:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13224678 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 8D773C77B78 for ; Wed, 26 Apr 2023 15:03:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD7876B00E2; Wed, 26 Apr 2023 11:03:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C603C6B00E4; Wed, 26 Apr 2023 11:03:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B01516B00E5; Wed, 26 Apr 2023 11:03:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9C6616B00E2 for ; Wed, 26 Apr 2023 11:03:33 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6E46BC02FF for ; Wed, 26 Apr 2023 15:03:33 +0000 (UTC) X-FDA: 80723861106.17.5D1E462 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) by imf20.hostedemail.com (Postfix) with ESMTP id 6D3B51C0011 for ; Wed, 26 Apr 2023 15:03:28 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf20.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.101 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682521411; 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:references; bh=xeos0l3lxIQ+q1+J4CR8W/JZZ5vLf/xJwoiFEtftr9U=; b=xWqPSFuIbqClXv6dj5CH8dpHsWJp6YgIv4QFk7et8uSMI6DF8wZVe155+629d3CJvC0AGc y5cLLGjgXTF3Mwh24ZPdcbUqQ1qVARNSj+8TfaE6vJ9Lz2xxBM6GCaFhwIIuhc/W+7Kk4w inDzLSLdX3c3Dygjf4Tvxs1OBPvSQEQ= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf20.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.101 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682521411; a=rsa-sha256; cv=none; b=jGRb9qzUwu+TGtg9ws2fBypZwIew6I1IkykGFdt3zqf/iVfjZOEfgGLh0bZXxPJj0ofpH7 +al0T8CJ1WzuSWeJFReGaGzs7zGiLBtrf7CpM1A40LX4UN9M4ZjdJw1Yq7MLIymv0MXq9v ytfCCmdMboNKKB2u/fUCXlMKjFoVyYM= 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 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6D3B51C0011 X-Stat-Signature: 5sa848u3t33e11rhohigj3pghsaziyfe X-Rspam-User: X-HE-Tag: 1682521408-553211 X-HE-Meta: U2FsdGVkX1/tMSWkKaFXnmm98+inujCEcWmAihUCprB+EWqBa5b7IV0qBa6l7mgMweJE0Qv7s9YTJJu1+d7SGNPAEr2AEJBYZrK+QBHGwX1ORvaKYxJweFsHqDIZ7cKX3AAjwXDKu8om8l6gOZVCp8vlJQ+dnOppgo1pjqFg1lbYndEcuo+yHRyB2jXWmSGO4kzKCeCj/Qgnj32bMqJfngM1w8EUWs8ElBIDtYG2G6gkSQ92oxAVu02BjCTfLD6oRn2lD3KbHuzMas5RypRQ+0x9KNdjAwd8aKkJNI0etKsQvoMgCDQ+WChvgGYC8vtpJlm1SJjMqiHFJg2GOgPT/uB6Ybi7QHidH/fkj8m0ATCzLILIm4dVMbmpCUBTU148YY5odvJYWklL0WeIdJJyNrUOFzjbwe2oDDTISfzkYxU6qKMxleqnLIODUMRZ0+IEYEhpaihLjrLagxcLptYDTEGLqGA2YyH/xJJkbFhKiCl4f3QUu+IGxNigVl9A1XmZdehR/5b4XLXIKSZHS+JjIDcluqvl+97IS3lX4bbdeArOOMltjvEHDVFpdPo3xmtkva7WR/d937XCgPFlPlspYD74YTutiVpJkaJ8pmvaQfrUA4qz3ykaqOiFrI8mKE7mZVm1JlrgeE+xZYpVAeXPnfULFepyoyjwD+T8tllHYXUl3pKHfEEtLHFopDPhVU+p637OLAG4bKBIKmuODXbOH8ZkUerFyEA87uvu/pUDJYInXjrIAtnbU+aOgaSQmoc9ByCqJs5Mcfas97FWzYh5kwTwFK9zaASRcC8DstIUaEUdpQjwsMdQGpTlSHgZRDW5lscTHoWXKWuPL6LyvUch8rUM5bckot7LzrqZXXXrghpm1L0a+IzZQ3WXHppJ/AiClvhNCQbjRqQT9gz6ZDgwwCCr2znlLI+N1UI94dLoXpKuuuXD1qp0YDyMxqyTDbDaOouk4JVi8vhW18LhmO5 NxrA03nu F8uIZRKbLmG2Bq/lVpmA0ciYCNNRd50dbNCDWbriTitsfYzAWIq1vZspWh0Zohmlyi6b4oYqzZhNg2Nypr8ykr90lYPQz+fZ4CZp4INHgew56+MvhTVbeDKoTk7eq7GBzPmpk5BDDIrLSUow= 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: 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; } }