From patchwork Wed Sep 13 09:51:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13382701 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 84196CA5536 for ; Wed, 13 Sep 2023 09:52:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F6D56B0176; Wed, 13 Sep 2023 05:52:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17EF86B0175; Wed, 13 Sep 2023 05:52:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F38FD6B0174; Wed, 13 Sep 2023 05:52:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E543F6B0170 for ; Wed, 13 Sep 2023 05:52:07 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C2B8480293 for ; Wed, 13 Sep 2023 09:52:07 +0000 (UTC) X-FDA: 81231108294.18.0ED1139 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf15.hostedemail.com (Postfix) with ESMTP id 8D3F6A0035 for ; Wed, 13 Sep 2023 09:52:05 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694598726; a=rsa-sha256; cv=none; b=DcG99iLGgKG7R+pFl5toywaieVvRTvu5Arc62mI1Qz2cendvia0BKefQfyFfP+nmy7y6WO wmf7sj+UXXWpt0fT6X054xc6uqkjrEVKj4EFMAnKc1Fuh7JKfg/23XkbGnO35GakK6Rdq1 1xNc6JMZAE6wgvHDRvZgpwMRekqjTRE= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694598726; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CWyPKwL02nbvAgHk+hv8KgCviWU/Da8QA7ydynsElH8=; b=j/BeCVBBxDehE+OzaDTtyAh8v+C61uIMSuzjiT6/ZJ3jmW6/p8Mj9ljLceZtv6MCNW+ZAL ICZ3VjOzCiLjEJZGxmXu1jIuYEPYJuzW3kD9E4FiF32L10Yq2G82qp48C70BTkCD44AkWa RZ12+3XkvuPpFMdIB114WWstX8hOKzE= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Rlwcw06PkzMlGs; Wed, 13 Sep 2023 17:48:32 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 13 Sep 2023 17:51:59 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Mike Kravetz , , Kefeng Wang Subject: [PATCH v3 2/8] mm: migrate: remove THP mapcount check in numamigrate_isolate_page() Date: Wed, 13 Sep 2023 17:51:25 +0800 Message-ID: <20230913095131.2426871-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230913095131.2426871-1-wangkefeng.wang@huawei.com> References: <20230913095131.2426871-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 8D3F6A0035 X-Stat-Signature: zmaws7mqckpiadip9un3qwuy8b5mcoz8 X-Rspam-User: X-HE-Tag: 1694598725-80872 X-HE-Meta: U2FsdGVkX1/49XRCfkYTiLLQ/6ir7ynAZFEitkIIMu7w3kPYr/tDZMiqVbgKVYD+K7qL896dH0XdjiKGzK61LneaK3zbhHVcnkVqlm1lVd8ENb5akSD7tVIMHCfglckSqh1q24Nh8C4M5OidQXcSvldReHJtGZj5O91tJ6Lo4hTuU4ojZzUMDrgnp4QpSNzB6W6g2y3w/YMaDuQC7CSZHFDauXefysNTCHltyQ7E87LexEJZwgUAtBz4CIffZZesocXE9go+14E0T7/i/cmPWftmM+EQ57YBxQclu4hMJ9dE7DjWA1IfYFAxlmz41xe7xOqjxH2pMVjvjYsciGzr6pLE0Elvd6918FNciDpWpvHid8bjrRd8U5r4zjysf7enA/yZn0KkdgL5fiMGIWHe5CQzqZ33I9pNl4l76Z/LVZcpuyiHazsMU2ySqOnmbtinvMkuHLmxWbqyz8IglFbRTmBpbxX00L4Y4rbozI/0WW35wZDZAhzW6Owb0zGmZ9VU1egyLo04n7N9i0H4yBjvnRy5TB5g5Uc7iXeu408eqK8AEjwDvY71KPjuVHU+9CuHPHxup3t9qvPM927YK9XQw29Z4SAS0WNYM3zo7lVgaEAaTfaf3gvfzLCbPHkbv8CiKYiCwrYu9arNQiGnJqgBvZsMNcSbxkMSJgA5YQ8bNdzcCdbrOqND642jaSpSm8iSkRpZ5sanuE5AfXVFANg0okpCneCm5mSY2I/dJ9cdOb9rZkKeeR/bpe3K9T1uHbzfSCKrqHs+i7dDqdUoGvPsU0FinjqQIN2vQLkDNR7obaHACm+cnTj2OHMm6rvA83+bGPB2BGT1c2mmoUBw8slZk9tpvcYA6KTqZlzMbRpYSoNZqFJrONT87Fce40Yn9ttpUQV29pBoHKWclsHehEGJntH7YuRxNVNVKSa0grtYxLK6s54RSU9e5WNiSZsDSBeqlEKduQROpVZCpSVHPZl it1BrJMY LIYvB+R2bV4NmbqTsBPQvyrpLaEKbcu0NCCOo7n1PFVlgrcS9RXiggispNlRW2FKuwMS/nrXv+zYQc8DKZpQQkJ/MJRAryBdSlByJdRpwgkzwff81GdNmpo2cTh6t+KpW+jpJrZoR0e4r4cHXe1vfMbMxSnWOPiVkySLDXTcF2wYYS1G2nR5rBueEOwB6tWb+amdUb9ow8lSince3egFAxrc5YK3dgXdSUvf/Yo7DWQMtzKPSepUc6VGAJUWdVJwaACoMJkvgxIJzYxq2cGQAek2hUw== 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: The check of THP mapped by multiple processes was introduced by commit 04fa5d6a6547 ("mm: migrate: check page_count of THP before migrating") and refactor by commit 340ef3902cf2 ("mm: numa: cleanup flow of transhuge page migration"), which is out of date, since migrate_misplaced_page() is now using the standard migrate_pages() for small pages and THPs, the reference count checking is in folio_migrate_mapping(), so let's remove the special check for THP. Suggested-by: Matthew Wilcox (Oracle) Reviewed-by: "Huang, Ying" Signed-off-by: Kefeng Wang --- mm/migrate.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 646d8ee7f102..f2d86dfd8423 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2483,10 +2483,6 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page) int nr_pages = thp_nr_pages(page); int order = compound_order(page); - /* Do not migrate THP mapped by multiple processes */ - if (PageTransHuge(page) && total_mapcount(page) > 1) - return 0; - /* Avoid migrating to a node that is nearly full */ if (!migrate_balanced_pgdat(pgdat, nr_pages)) { int z;