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: 138730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp973750vqx; Wed, 13 Sep 2023 03:05:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElDySFv9ZGC5FDyS5c/lGBDtJu+TZIUlzgliI7Hr9jNp4f+aL6oyOgXu0TzrBKCPK5yrP/ X-Received: by 2002:a05:6a00:1487:b0:68f:c057:b54c with SMTP id v7-20020a056a00148700b0068fc057b54cmr2152565pfu.1.1694599512760; Wed, 13 Sep 2023 03:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694599512; cv=none; d=google.com; s=arc-20160816; b=PMg5eFuSmrB1PTl4RjcqVkgqoQ06xdHQzuqLCh82t2yxKAKy0Zc+71G0RdU1ekm0Jv XC7Ql7sHMLjqw4sDxzRD+I4rse8nNEEt+zgbFh7Ae6N9Qd4CbL+8wWgglkm3PvKJ8Py5 v8220apnvcxqogW3vdOOR9zBeetZhCFyZS6TCk/pffJ1bu87Q9PN7E54EgW0c/VLVhsb BHUmEflKTJJIG37r16PDWcl3qfdBGLz92rgKOR1pU/ganRgsSwjS+9DJmztPh55qBo7t 4tsMKEtklxLm7djXjcEQtQXmnawkTKOh1YRWkFiPZzJnOBizlTsl7F3P9fFIFTGr/q4v NZcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=eGLAyF1TWl//bjKqzzehCYbHflfiv7bBK6GV2K9YRXA=; fh=Je6qNyAM729b1goCtB6PkBk+yQrlQCIjJMRY6BFgKTo=; b=TAlaqVT/WlzzeX4Dhc7src+iAwAp2hUqkRLEruJlSvEHc0WhsJkxgOnTSkgU+KAs1/ D+xYJQxIIuIwKgJnym4tH0NfBD0M1YgVelnGMLPHT3+CJeRyOPSkf78NCXvrIOmgcloQ Y4Rhz7ZB0E2X+TNISk3Ank9lUdQUmtD0SFRig2jBQ+opiLxSFcjROmnGKYgYIRFkJ/kG ua7PAerx3gvW3mTFoExdyV/XLxTER61QDHro0Dg6D9tCgHi9TFRFpAzEAhgvKewY++lL vGpTaRXCxJSFMC7S/TbTrAyEU0QZ19mMY767+B+rCSG1r83PQBoVqVXbWkApiFwEflKa XMfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v202-20020a6361d3000000b0057777451a91si5204512pgb.581.2023.09.13.03.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 03:05:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2F25E81B8941; Wed, 13 Sep 2023 02:52:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239478AbjIMJwM (ORCPT + 36 others); Wed, 13 Sep 2023 05:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239482AbjIMJwG (ORCPT ); Wed, 13 Sep 2023 05:52:06 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB7819A9 for ; Wed, 13 Sep 2023 02:52:00 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 02:52:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776916378628180363 X-GMAIL-MSGID: 1776916378628180363 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;