From patchwork Wed Sep 13 09:51:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13382700 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 49AE5CA5535 for ; Wed, 13 Sep 2023 09:52:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A598D6B015F; Wed, 13 Sep 2023 05:52:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A09366B0170; Wed, 13 Sep 2023 05:52:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F87A6B0173; 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 7DBB86B015F for ; Wed, 13 Sep 2023 05:52:07 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4E8BB1A0367 for ; Wed, 13 Sep 2023 09:52:07 +0000 (UTC) X-FDA: 81231108294.23.94EF529 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf30.hostedemail.com (Postfix) with ESMTP id 95DCF80011 for ; Wed, 13 Sep 2023 09:52:04 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694598725; a=rsa-sha256; cv=none; b=Puv9IplLyaybmaXMMv2q7kxz0vpwEP54z4/AAG8SRJJx840+wvBCt4W8dSFO58cqHbdycn PNJv3FTsdw9yslL1lEDARRhoIdTtapliOcBpFj1cMSKBxy5KeT+jbzDsFawxmG9jHMD2H+ Pfz9gXc4ya77wOX+2lFokjtXmFzgMyY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.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=1694598725; 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=eGLAyF1TWl//bjKqzzehCYbHflfiv7bBK6GV2K9YRXA=; b=fF4MHb3mxYsZl2nXmSXqqqZE0xeOxCZVSpm3wQmJmP85hJoNfIwGnzOHHAOJGfaCGio6jx LOkAWK0c28twrOurgu3rwa61TVSEd7SqjXLH25sJXp7EPGPNGOFg5iFTZbYmYA07nrkUtY 0po2+QoOSXia5tEvBBG2mnMbbWP7DfA= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rlwcb4nlyzNnRl; Wed, 13 Sep 2023 17:48:15 +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:58 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Mike Kravetz , , Kefeng Wang Subject: [PATCH v3 1/8] mm: migrate: remove PageTransHuge check in numamigrate_isolate_page() Date: Wed, 13 Sep 2023 17:51:24 +0800 Message-ID: <20230913095131.2426871-2-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 95DCF80011 X-Stat-Signature: gai374no8oxdd7z4yfjkyzgo97oqb7er X-HE-Tag: 1694598724-837741 X-HE-Meta: U2FsdGVkX18cVJHLAZ29NlmWKEDwQbSgFzmB6tlWB6wltrJ6OLPGoJGuzYuxjqbQjphdR/2M6QCEn2bL2o01MlyEF4ebfRWeSrpAx29vZfkF+qc39svtgNLDGbjWpfy/hD+jYFyyezKQVkEpOvhBZcUoIJWGKk9hu3Oqf+vh4284ln9o+9dj9dDjyPDVBrRf8xT9wsZFK33dlNqTMxDnNyLqtRe5DdzKeyvAW0YvQq1S07AZ56T4xeOrdoSFkFLZJrhnFs0YO8vp4c0dy2ePiSrRr4fUmsLiUAChfGGk7/v/F/0i1A1dOS2PhjyD7T87oZChWTEN/VBqpzPcullo1lXei7mKL1Y5XTHBiyyCNdecbH+ndsX3qJTdSFyZlp+lT28hO6UoP+sndtz30DoPyks3bhGf3WZ2vSrUEusY3qUjVM94PNOitsY19ENxe/NyU5KDcgWrB6uYC7uWtQPUXf2fUA+T2GqTVuxIlkHrA53Vy924fA13q7eN03JMwzZ6SltuXYDuuYhG87q73pYxsXEe93riB7xUn759G1BKpX36d7+lWW7xPADjsOT+lO8rHjnoGpTYICBFIJaoVixwBK6uVcqG1Zz94h+Tvo0Lwedc+1o7IS3LGFNVCg/AXGzU2LzrcuXj5MQpKbsIXTFhl3o2JDPJtnfUbo6E1v2S7gg8eKtSQcKYTaeR6w3lRNuTVMElJrshlyTN+v7jKU/PK59XLDmQeUdJBxAPSMjijX5LjARBMfjNgSrLw0mz6OCorCDFfYEMRxYUI8Ss7VZp77a2yPXJR8wTGxx2QYcUsvP+Z6jNer8641xlmEJhDARpW/El6s8zma6YbZNL9B8aV7lWDLsVO3sFdB06jxodgD4GZxQ3QvHS3EljeR5gDbhWMXbu0HAYTP21ydRHxoiSI3K66u+EQYCK5LwCoQDV2657DpXZnVYax/2m2pcOC+O1tQsQpjYWQUawefp5wvt KDLvuppx j+fd2kgYI3VhswKRKtMaVHA5Cl+06hfTon4sJjh+JM7lU+5SJRxlW37bqwHUxPlAC0GElVXmt2nIrt8/15k8A1BdhoJE02YOBYUcNnTHa4cqNBcLsNbHJcgCmJl77IIoa08DXnKWchZwCm2y7geKYkNv1RexLX3czJ66XfJsKouMDdTcajag08JcYbtFPRgQHY+rR58SmGWdLaijvL+UKT+i7AdaWIw3gVd8CjDdxjk4qMk8FHhNKXbzIVr/WL/c7Gv31 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 assert VM_BUG_ON_PAGE(order && !PageTransHuge(page), page) is not very useful, 1) for a tail/base page, order = 0, for a head page, the order > 0 && PageTransHuge() is true 2) there is a PageCompound() check and only base page is handled in do_numa_page(), and do_huge_pmd_numa_page() only handle PMD-mapped THP 3) even though the page is a tail page, isolate_lru_page() will post a warning, and fail to isolate the page 4) if large folio/pte-mapped THP migration supported in the future, we could migrate the entire folio if numa fault on a tail page so just remove the check. Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: Kefeng Wang --- mm/migrate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index b7fa020003f3..646d8ee7f102 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2483,8 +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); - VM_BUG_ON_PAGE(order && !PageTransHuge(page), page); - /* Do not migrate THP mapped by multiple processes */ if (PageTransHuge(page) && total_mapcount(page) > 1) return 0;