From patchwork Mon Aug 21 11:56:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13359346 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 C4956EE49AC for ; Mon, 21 Aug 2023 11:45:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E9EA8E0008; Mon, 21 Aug 2023 07:45:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 273F38E0007; Mon, 21 Aug 2023 07:45:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F25748E0009; Mon, 21 Aug 2023 07:45:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C289A8E0005 for ; Mon, 21 Aug 2023 07:45:42 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 91AEB80BF8 for ; Mon, 21 Aug 2023 11:45:42 +0000 (UTC) X-FDA: 81147932124.02.C0C184E Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf15.hostedemail.com (Postfix) with ESMTP id 4B6D0A002B for ; Mon, 21 Aug 2023 11:45:39 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692618340; 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=MMDH9YItxAMheB2YJnFwOxwJMEtTB/LhDoml9IbDVwo=; b=1Gfv3zLYqqmvY3IoQUJexYhB5IU7CZ/vwrI9skVJV6GPpEpqm0mYRSj+qdG/Ef1KdqDpkV PVpdGNEKs/0ZAfBgSvY7VpXNAtfFWiM7quy7zV4lJOhJN6aUbt+gh9Biq+xxQBO07DjyKp 3JCh4TZcR2UCFHRLWzrKVEIHG5GmGiw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692618340; a=rsa-sha256; cv=none; b=WJoW1w78mgq34pZdslT0l0kyd1lFuX7uorpraNZNnnpdu9ld/ltgOdsYvRsRRxGwSqy7CZ dzrcwE3mf5Yp0N16nrn6ChwjFB2h86gfbUWJ3iOa8VeT+3eVL29hAzYFPwU2CzkUrUC7CL 3u4yVNUEmYBuPqjZR4ay9uE1f14YXf0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RTrDS2k1tzNnSV; Mon, 21 Aug 2023 19:42:00 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) 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; Mon, 21 Aug 2023 19:45:33 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Mike Kravetz , , Kefeng Wang Subject: [PATCH v2 2/8] mm: migrate: remove THP mapcount check in numamigrate_isolate_page() Date: Mon, 21 Aug 2023 19:56:18 +0800 Message-ID: <20230821115624.158759-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230821115624.158759-1-wangkefeng.wang@huawei.com> References: <20230821115624.158759-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 4B6D0A002B X-Rspam-User: X-Stat-Signature: uzumwxy9kr7xarmexf559yz8zd5h7cq7 X-Rspamd-Server: rspam03 X-HE-Tag: 1692618339-862941 X-HE-Meta: U2FsdGVkX18FX7R6dW+g+62evzfSv06O9avl/po33e9FXmFstmOPrEl6rHjwNTGdNK3pZExZeCpGTOF/cWqdNSQMQ7u2PzjvBO3tdV9O8HOg0DxzsL75qvCIWM97EgIMFy2Q/LIGaNNV6Th0umsgwk68uOFxdScyfRlpEJoG9M75KDa+mEkQmZU+kud4BYPc2Re8R1A5zLe2V+kjDhlbevQ2tTjJMgpeaC+IZuzb/fToPVv0tB6fPngIMUKD33WzkCNL5Lsk18keq75BvE9bYFEG94Gv7JlY5Bb9QNsxIa2lY+uSTS/y8Mnswn5DMZ3G+bzK97wGzhbTeYHeobgeBzVY8jFK/AxdvD9PyU3azxdgmg3tp8W9QWOqrOBBfaio0/rpH7uPWwSmXMNZqhS8CVP0vlW8Vsz3Ga/03vVqp3NnfPBpItGVwaxBvpLxHE+SqhVnGsWTu0sunfPvS6yppuh+6Cdf9fLQbZ+Bj3tTPDAFHKvUCkhoPveVRi3A2L37oC2elitl/oWvS6PRdIacGQv758WQwqOKsHOUtpxNbtInARNeU29x5zTfFtuqY37I6flkiXtuH3LtnfRbg25oZsLZyVuGl6aSkPy53PeO6+GwLWUEeSiZsGwcKI6TeMeeHv69uxAshSSm99bQ/nwQfXhqeQemIlPPHrqiPzDp7r1CkXtS0K/nlwrejnSZ3Sggre1ooB00i3wTWwFEvSKrZI/Qn8QKDazyLJeMXjBlUVSJqHhXVgFSibjeAVzz4BiTb/psSrlmnxfsyr975Svqq5IjMMy4OunFEK7teiWbmATXF0WQAPQ/bvd+3ypikSBdB8h6hcOiXXeWM6AZQAKBrMchUJ4T+DRWyrFQAUDrUmlOCEtVBmWFMXvAdU3Rp/ls0BgFuTUiOCgD0pxWEdOyHWe2KEUug8y11CNqPzu5OkQz3ex7KuUtdWlrIU4Ygy4vt/1C9pdgzmQRWkXJCB3 PFJWlCvd sAs3kVzjzlBrob72v1Me9LZY5EKzu2UYkRCGMVPMGU+EqqbmjfHgij9tslyBXIC3Ws++D1U6y222CixKNTnohP2+Y4M9jnrN5RQX0dNGaM9ddsniElSQUr4C4N/o0B7Za7mFO9+8W6jHdY3Hjs1T5ov0Qsrg96d08tKMXSbq3BnfTInsyZ9fuaCcw5scWIaNqsdynNAhzF7GofxC+FpbL6czdjGbQYlAimEGcoEdI0Y8R1UzLR22sWlRNAg== 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) Signed-off-by: Kefeng Wang Reviewed-by: "Huang, Ying" --- 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;