Message ID | 20230913095131.2426871-1-wangkefeng.wang@huawei.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp967795vqx; Wed, 13 Sep 2023 02:52:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFN7jsHGtBNyWc4TZp6NCTD6dG81y51lyOFWHTamSca4awtsTbgecHU9pu0aRGDGw5WNaS X-Received: by 2002:a17:902:cec2:b0:1bc:506a:58f2 with SMTP id d2-20020a170902cec200b001bc506a58f2mr2572756plg.46.1694598749464; Wed, 13 Sep 2023 02:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694598749; cv=none; d=google.com; s=arc-20160816; b=lSQpc1Ks63MaKIxGxh94fBq+k6mV1afjcCF84sRddP19aRd2zONwEeiMfB1sWjVR7w JnIyar2AE+SgMzO/tRAv4d5atc101jA44+zoBhrY9NSJCP+1DAQRkoIY6zRnd3bvQLas xGW7UEik1IE3ojoL5sdDNt7waH3jkAFJ037n/VxWTSR4e3vR7WQV0tU1XMyYuD4juzvC rYNLWUZg6nos4T0bgW4R4xk4iOWw35Ev5eUOtuS7JOE0teZnKv+pYkBGQqw7G5ah4tcG 9PYGqKbWvp6mVqnJcFry4yiA6oQnsD9IdMlTzBN5aC2Xhch3NT5nudqgOAjpJK+v8xQo I77g== 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 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id c2-20020a170902d48200b001b69ede5b79si9903325plg.470.2023.09.13.02.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 02:52:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id A05C482696FB; Wed, 13 Sep 2023 02:52:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239514AbjIMJwI (ORCPT <rfc822;pwkd43@gmail.com> + 36 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <wangkefeng.wang@huawei.com> To: Andrew Morton <akpm@linux-foundation.org> CC: <willy@infradead.org>, <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <ying.huang@intel.com>, <david@redhat.com>, Zi Yan <ziy@nvidia.com>, Mike Kravetz <mike.kravetz@oracle.com>, <hughd@google.com>, Kefeng Wang <wangkefeng.wang@huawei.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 02:52:24 -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 fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776915578228376317 X-GMAIL-MSGID: 1776915578228376317 |
Series |
mm: migrate: more folio conversion and unification
|
|
Message
Kefeng Wang
Sept. 13, 2023, 9:51 a.m. UTC
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(-)