Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3126603rdb; Wed, 13 Sep 2023 02:59:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAAcOAabwqY8RwckWD8iZv4zpQqqKPzHAJmlvJx4wVyAhfFz9oX68KaoNWUvbrvdfaPwpn X-Received: by 2002:a17:90a:e014:b0:26b:f67:9d1b with SMTP id u20-20020a17090ae01400b0026b0f679d1bmr1602899pjy.30.1694599141653; Wed, 13 Sep 2023 02:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694599141; cv=none; d=google.com; s=arc-20160816; b=wg9TS8lJ89qSFlofICzACjpROK7z9hAMfNWJkaOJnSrmCmGjp+svmA98g/reMovTC9 sb7MQ+4UkhtxTo1XlNy6lz6BE6kOvs6iu26T5FnMqnU4/5e6J+EyWiF0oAG1XZs8Hoke oO65H1KL4QAANYY1DvTksJr81Cp3TgNzWlcFKZMp5tmEdUMAaHigDRGCucg93NcohY5F onkxKau9JJ7stXTCQG66vTPsS9DRa54T2JdL3GSBS6UBzsEgeT/ZcZb5CYBpR3SxgMrj pov8YYhuk608F9UEN1M//rzHiQQN45kKx/+f1dXOhifvS4jlLKI2rz4vuId8zwzebDNB 6VMA== 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 :message-id:date:subject:cc:to:from; bh=5wxhdbweU3Puza/p2mhxBV/J4qb1DjUIWzS1bpTWAAw=; fh=Je6qNyAM729b1goCtB6PkBk+yQrlQCIjJMRY6BFgKTo=; b=mcZwVYA1Q9TjHm5ycXA+gvarIz7tQXmFitrxYA8aHFnIlKyiORa+5//V41jNnl6xF9 uPvjVqRb0IQwtBULH5xn6t8w+wF6BNE+MxPqZkCs7paBBaSD9VaCiyITSZN3aVvImqRh yt+8IZsP7m/4Uh6lcyqhaFy3knfFFppEpT2JC0UkoNJLaOwYvhuWd/Dy7KmLmxVmXG/f a2vIPmVpc9AzUr3Bd8eB5etKle7ATov9Fv+0MW8DsYHkiYV2Z7coO8M/1NGO5/SJdwEK BkX7olU5dmdzcx0vynLAbZXlUUqAP/kpsNoAzWWkgzNSwREreWYbpYU1M9mxR1eEViQI dTRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q36-20020a17090a752700b00263f3c1bb86si1201480pjk.158.2023.09.13.02.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 02:59:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id D0BB8815CDBE; Wed, 13 Sep 2023 02:52:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239485AbjIMJwI (ORCPT + 99 others); Wed, 13 Sep 2023 05:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239481AbjIMJwG (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 8AF17199D 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 4Rlwdg03lbzVkg7; Wed, 13 Sep 2023 17:49:11 +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 0/8] mm: migrate: more folio conversion and unification Date: Wed, 13 Sep 2023 17:51:23 +0800 Message-ID: <20230913095131.2426871-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 (lipwig.vger.email [0.0.0.0]); Wed, 13 Sep 2023 02:52:31 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Convert more migrate functions to use a folio, it is also a preparation for large folio migration support when numa balance. The patch 1~2 remove unexpected specific assert for PageTransHuge page. The Patch 3~6 convert several more migration functions to use folio. 1) add_page_for_migration() used by move_pages 2) migrate_misplaced_page()/numamigrate_isolate_page() used by numa balance The patch 7 remove PageHead() check to make hugetlb to migrate the entire hugetlb page instead of -EACCES errno return when passed the address of a tail page. The patch 8 cleanup to unify and simplify code a bit in add_page_for_migration() Thanks for all comments and suggestions from Matthew, Hugh, Zi, Mike, Huang. v3: - update changelog of patch1 - use folio_estimated_sharers and comment it in migrate_misplaced_folio() - collect RB/ACK - rebased on 6.6-rc1 v2: - keep page_mapcount() check and remove specific assert for PageTransHuge page. - separate patch7 to migrate the entire hugetlb page if a tail page passed, which unified the behavior between HUGETLB and THP when move_page(). Kefeng Wang (8): mm: migrate: remove PageTransHuge check in numamigrate_isolate_page() mm: migrate: remove THP mapcount check in numamigrate_isolate_page() mm: migrate: convert numamigrate_isolate_page() to numamigrate_isolate_folio() mm: migrate: convert migrate_misplaced_page() to migrate_misplaced_folio() mm: migrate: use __folio_test_movable() mm: migrate: use a folio in add_page_for_migration() mm: migrate: remove PageHead() check for HugeTLB in add_page_for_migration() mm: migrate: remove isolated variable in add_page_for_migration() include/linux/migrate.h | 4 +- mm/huge_memory.c | 2 +- mm/memory.c | 2 +- mm/migrate.c | 126 ++++++++++++++++++---------------------- 4 files changed, 62 insertions(+), 72 deletions(-) -- 2.27.0