From patchwork Thu Dec 5 03:53:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13894694 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 1DD70E7716C for ; Thu, 5 Dec 2024 03:54:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F8496B007B; Wed, 4 Dec 2024 22:54:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 87FAE6B0082; Wed, 4 Dec 2024 22:54:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 747866B0083; Wed, 4 Dec 2024 22:54:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 544246B007B for ; Wed, 4 Dec 2024 22:54:10 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DC7B01C7382 for ; Thu, 5 Dec 2024 03:54:09 +0000 (UTC) X-FDA: 82859536998.26.37B28EF Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by imf17.hostedemail.com (Postfix) with ESMTP id 0A82540003 for ; Thu, 5 Dec 2024 03:53:53 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=IaBP+hBa; spf=pass (imf17.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733370839; 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:dkim-signature; bh=DI5axKZxvqy0r34ohLbYqCMjGG76VnNbtUIB821Ba+A=; b=oDscwBfkKhOGCL1Tvxe7rVVn0XzYcijs192vDaKJzO0y//TYi7H8usho1PfXlNjWr3Gkoh 5u8uh5l8B4N/FPcjfkfXmBubJTY/zLESVN+BY2qLOJBN0RWJ8xshNy0iQIOAtHXGEM3YGq QvOwYk62ZYP1liOnr0dolZ7g850voto= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733370839; a=rsa-sha256; cv=none; b=60MBhfIOiAnUAcOun4rjhuZHcxX2/OXmgz3UUotrfKPUkrCKr1UM3VMdS3JC7G8v1u0FRV YRCy3CMtbfEfRDfvZlQSbWSi/HVXC0BYKcxF6KBorqd37O1NZWgtBfbBlSgVMpYCM9hutg E4/2SFRewPVpQlu+yInyxDdsti1Fy2w= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=IaBP+hBa; spf=pass (imf17.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1733370842; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=DI5axKZxvqy0r34ohLbYqCMjGG76VnNbtUIB821Ba+A=; b=IaBP+hBa0Z9SaeeZkeHFT+2npXHAE8ObGnz1i4dSMiGeTurg/YQ6jaKNuK7jK5ZuyVsp/tf+yHRlZfKG/NqQxdLdMDqMt1zjZQqQPlDASgv5p38fL4MgqxEWGD6O8zIkgUKz7+qtW5+Wls9PWPqn6cvRJTY6gbeY/kWwVH+rCFA= Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WKrhZ-H_1733370840 cluster:ay36) by smtp.aliyun-inc.com; Thu, 05 Dec 2024 11:54:01 +0800 From: Baolin Wang To: akpm@linux-foundation.org Cc: 21cnbao@gmail.com, david@redhat.com, ying.huang@linux.alibaba.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: migrate: drop redundant anonymous statistics for file folios migration Date: Thu, 5 Dec 2024 11:53:48 +0800 Message-Id: X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 0A82540003 X-Stat-Signature: xut1ojw6cijex8mgdfbzymsrgd1ikpm4 X-Rspam-User: X-HE-Tag: 1733370833-651577 X-HE-Meta: U2FsdGVkX1/ptrsoSE8jmSg66tUQLFrsvokO1bjFyl4+5ysGbDsB83XIFbuvytrBrmQ+PbffQk7fe7w4jKHSQWfDjJFY9btexCRpZ+cDgcvOABzCf9qwFKciwtl0MT8ZfBtkw2d8mgvWMwrHBatX12QblYYp6wqxxDK3zNVGjvTno58Gih7hWNtqvQU1HBjqaEoEoDDlxBgH8FzIsxgouWJ2Oh7fA7+xpWo9pdQZceZUr3/oF7Nq0A6YFXmjX1qGbvgJIqTX8lzOgd3bd1OwJAffm/UtTD1pu0T8KM8BUC0nkumw5h+T3SIpTF8k5BaK2QNCfMDmcjxpBWl/UkmF8y6rtM56Vad7YETH3DUhQVpPSaOvvmw/z63YT6kpBwM4rkFElfNAn3UDOphYsVgqRd8Lduy/S+aUWivoJf2R69X8rH5y14aLt70SP02vEWiaAbzsVzYoxi3xNUBn5ItvYKPb6y1JyfmAak2RylzGxU+HxVhTIfJ/DxXiEQs5TQj7IxyQACnDAC09BxVs/c0ZRhGjc9PSxm5GNr9Yatk6GB3vt9zAkJ0qwBfIGct8hKfcClZ5ueSW2IB5cuFAG6J60yLcIK8sVvRtd8ZED+1GsE3WaVIoc0uP+Am4WWShxhkYFcFAZrH90uZ0GcezJCrBntYJ8RAXDAlm91TpuruFAdM00jMN1y6DPOCAcXfw5XjVqxQefQFMNemIkhaRHt/W+PVldLWSJjbLe0qCHK4LxyBeIVV+b/am2PuKgqrUAoA3kKXRaRpEHj3pWMTxSZR4v3SLYh/U+6Ko+pKsC7VKalW7LZiq0Ie5dw8Wek0fQ13xgcS/fPJ5Dgk+mAlhS/GjlGPA4mc3fFObXN2qMkVBnvbr7iX7CEjcQIUQw3eM2maQ7zvZBOvMWjeIMksYuXRDjzAO4M3bWmyUPT/Rw1Zhvs6E861gjdpj7aafURy5ZG9QOgxcy4VxZnDvFSI+gC5 mXhoKzs4 FS17SPvsD1R8H/1vfsZ39mW2U+WPL7HDPPop4k++bxq3N5HHSYVhjOLgeBtvUFYlgFMDzBcU7dhsb5cktHy5478UGSLWNa1Dgq8hi1eF/W9QHi1P2E4cm4MIcKa/Bqv7mZu0H8keq/pwNDBCA1O67gOowK8HI28tc0BMSpiqf+JYT0sG4WUYgnhzo0vVOXm7nHqp346bKnpZ70U3dCTS0EIHHpBhFf/ltDbQ6 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: List-Subscribe: List-Unsubscribe: Commit 5d65c8d758f2 ("mm: count the number of anonymous THPs per size") adds a new anonymous counter per THP size, however, when folio_mapping() is not NULL during folio migration, it means this is not an anonymous folio, so remove the redundant anonymous statistics in this case. Signed-off-by: Baolin Wang --- mm/migrate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index e9e00d1d1d19..d7fdfdd23fd0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -523,8 +523,6 @@ static int __folio_migrate_mapping(struct address_space *mapping, */ newfolio->index = folio->index; newfolio->mapping = folio->mapping; - if (folio_test_anon(folio) && folio_test_large(folio)) - mod_mthp_stat(folio_order(folio), MTHP_STAT_NR_ANON, 1); folio_ref_add(newfolio, nr); /* add cache reference */ if (folio_test_swapbacked(folio)) { __folio_set_swapbacked(newfolio);