From patchwork Tue Nov 29 22:50:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 27532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp607820wrr; Tue, 29 Nov 2022 14:53:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VemEMmQxSq5bA6iZxmDc00awFXa48wwC7jX5iKQUxDIE0e+6OOHDJhDmepEvNcvpTzV4i X-Received: by 2002:a63:5146:0:b0:477:86c1:640f with SMTP id r6-20020a635146000000b0047786c1640fmr34309414pgl.231.1669762416061; Tue, 29 Nov 2022 14:53:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669762416; cv=pass; d=google.com; s=arc-20160816; b=uFUVILNKpP6CT0CmvWc9yQLNCDI38drADcZ2nvj2b+B6tcSQAh6GGli2HpWCOGSJ1L ri4X+jBytfJpIT8txBpUmlz7EEmEDlC/OzQ7mU7LWgRL4DuuIfg8Zyt985V8+w37c4rs NAHeTq2ehQPYY0nlFc90r1smw/QdbgskMiERjgbX/9sg0LFHR2NOBNfErBxvqhaA4Re6 d7z6RAJ8HfU4Kx6osGpU1SH1qLaRvL3zryAnoIRjQNfSuu+WBqMYJ1Kv1SNAaB0Ldd02 iU5W2r70zmWBudvre56LbjdTOh+/o6NYy0p936bcmeGnSW2SkmXeT6xL6nko9tYJACja +d0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=pFBt8VX6o2UZgtqtp0qKSqJojCjD0tv5Zao/WbVC1Xs=; b=HyPtp5Hsym/M3gnJvx5UPf8nGEHJY1PLz7Yt2Bmc4bnu8oAw3D4H6K2uPV7RpbdrA3 LOyh1q1IJ8YL3j4nKE4YGyzouFbIpDyRG4jtsHY7rCdCdY581mDiyJNlLa5GvxKGcDGm tMYMYN/XkyFsC0dpxUpTmTbceZ9zaIt8wjZrgtxiKkVqVGm6NzMMrVO8qGZL/AcmThMX TrdEgYbBMM1kqjVN+L5biwXffbEHLKr+2hkzrnMok9FovM0Bm9uJ7F3N8iC0s+PeryLy hkqnqndVEkAKCpsQ12r/Tyie4qEnShQm5pPOyOPmyHK3ZZUu4MpgOIOwyh2sSFSN8yjb vMiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=wuU7XVHL; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YB6v5qE6; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jw1-20020a170903278100b00189380323f7si10618502plb.318.2022.11.29.14.53.22; Tue, 29 Nov 2022 14:53:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=wuU7XVHL; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YB6v5qE6; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237012AbiK2Wv7 (ORCPT + 99 others); Tue, 29 Nov 2022 17:51:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237007AbiK2WvU (ORCPT ); Tue, 29 Nov 2022 17:51:20 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A44D2711A4 for ; Tue, 29 Nov 2022 14:51:18 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ATMEBlq020338; Tue, 29 Nov 2022 22:50:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=pFBt8VX6o2UZgtqtp0qKSqJojCjD0tv5Zao/WbVC1Xs=; b=wuU7XVHLL/UaHs+sBKQj7hY4L3mCo1hC7zE6ApTPLx7Jpp8D1ZLJ/+ESKM8Wbt4WpFNy J8egZH2I3UFNZgNVnCjymV1oU4zZkqIb2aIaHGZn7N5CV4BAlYA0MM45L0H9U1lTrSJN 0UHnin+P5gRU+BLj5JGU2UD6X6aSWQiF3ceYcVGdROYCIhPaqJWcn5coQB9UBML64KY3 zA+kQMpmTfwuaXV7rQxbEgL2zl1oTH6fPRkaWGQhrtTZ25D8AF9wOK2jSNv9jE5ReyjW n5UcZemxNt18KGEtJ0QV/wMG7c2AolxjfXqwbMvAtQOM89xX+vxbPUXb3bpqVyu6maKI fA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3m3xht7m22-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Nov 2022 22:50:58 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2ATL9k2Q019333; Tue, 29 Nov 2022 22:50:57 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3m398eax7y-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Nov 2022 22:50:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cUU4x2mtmGUjc/4mmNN1YX52GDjamaXusDYCBH+UynivFZdev9PuQlb7JG2InxWQ1FeKSFsqTGL3KsF8LVFRVHH5NZ8xebw+7/pVNnbVpYDfNoFWlswS7SNAU5V27W1NStF+P9TJjIH1SDBnQxgTLA542G/vtmS04Gjn5IQ0a46iQzQ4eMCYN3IzZjbHT2qU6x8L4NMQAWLuFU6TMrgEZ8Gfg7M+uKfLg+VoBi5kJWat8+oCXSBc3CGuzoIprb486+BTb5HZUsDKjtlrYtVqDokXYoUABS1iJmXArz+X1CmM6mLJvucbdkBGQ6FsuZ/zRHUDpDSrkkogFN+OtUrQ4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pFBt8VX6o2UZgtqtp0qKSqJojCjD0tv5Zao/WbVC1Xs=; b=RMN8IBxfBLNqVeLSXdG6CfCIpIjBd0/sMl/9GtOohx+TiYKEku5jUzF+RLY1notO3iuG1EEkYqTQdBY62IXY97mB5+jWHeU0c/OD3rPfNR6YWsFoOMPtyHtQLy5I6CJzeX+hYLeIMf8Z8EN8Ym/KVGiVXVjh3x0Dc2YgKnd4Fi7tGiL/qrTxVQzz6+yCIEXwgdlk9ADyV/2egQcNcQ/KivSVFJIPAbXXWvjn9MVij4eCirtRtNyh/Ar9f5sC+QvT5cN6Bql+57OZxgIJtfONj32evMp2BG3yPoYjOjpk0ShxaIpGd0K5trRc5zD0t93V3ptRM6eBWYaGE/WqRtgtrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pFBt8VX6o2UZgtqtp0qKSqJojCjD0tv5Zao/WbVC1Xs=; b=YB6v5qE6JKhxDEcxHrZY85+ErjUMHuWzAm7uu5ug1yQyF83fqLIrCF4Tl4xm3v7XtZjCarZ/YGEd8uDcNP3HlY8GzJdfHsc+aNNB19BsyDYQsQilMXqRqJSzFCoWIOajN6FvvwPuf3hcnCOdkjNqvoflSc2rpj6+yjVMg44fdW8= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CO6PR10MB5586.namprd10.prod.outlook.com (2603:10b6:303:145::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Tue, 29 Nov 2022 22:50:55 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::3702:7db0:8917:9954]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::3702:7db0:8917:9954%5]) with mapi id 15.20.5857.023; Tue, 29 Nov 2022 22:50:55 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, willy@infradead.org, almasrymina@google.com, linmiaohe@huawei.com, hughd@google.com, tsahu@linux.ibm.com, jhubbard@nvidia.com, david@redhat.com, Sidhartha Kumar Subject: [PATCH mm-unstable v5 09/10] mm/hugetlb: convert hugetlb prep functions to folios Date: Tue, 29 Nov 2022 14:50:38 -0800 Message-Id: <20221129225039.82257-10-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221129225039.82257-1-sidhartha.kumar@oracle.com> References: <20221129225039.82257-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH0PR13CA0008.namprd13.prod.outlook.com (2603:10b6:610:b1::13) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CO6PR10MB5586:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d2240a9-8a8d-462c-fed5-08dad25c2cd7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 47H7Lo1fuqQNtpWt8KB+w0mfT7vdYbwbMypp2NufQjCnJwlgICkjAlxxJW3KbIq6IOfNoyJf2hjXLdp1plun3mETbw5fEKMRFqDCE9sq7rLP3ZTYZYPLAgvvtmIAl2UNCXVouKgUOwwftibwFymmVWgDX3FgI8PR4h7TJFEW+eXgHc0VXvCwSLjeTMmLLjjvoBzBaD1nz/reHpwOUBleZCCvG2ZCG87j9hDkgyNtlbIUQFEvMbgr+2x3KuWYQeMeiR1FcWZ4b+toOJjfjUZMXVA0VWZu/w7LcN4QwoGnalihUOpkzD5b7d8bRDIZ+TtqOnH1zHrKG4nj0IvKfTf64ZXjDLVVbNRdl77BPeHQUfwo2ZIlMJXuaoejMRBXShC1GclIWx6gFEAJxLgRcPcTIfQ/qqbCc3b9y3dLsFDwtxGW8hA+3thMMw+/mu95RlQGS9Ob9yuYnnDypPhPu9gFvS0tUktsW+XS+COFCHkXTYfPjA75iyLjcUHU1P0rslAIiA61vYBqsAnm34RIv1FfY+q+THMUYJbGgdqVUlY1EVaMjwjkMMF7H/gERzQgr3ZPSQ6EeTGeOtrcU5PeSa44NrO3xju32VgM7XePztWKLGrS/FwfkjYrgv9TAZyZl9nXm11qMP2GxRRwy7DoVIx5LA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(376002)(346002)(366004)(39860400002)(136003)(396003)(451199015)(2906002)(2616005)(6486002)(186003)(41300700001)(1076003)(478600001)(36756003)(6512007)(86362001)(26005)(7416002)(83380400001)(38100700002)(6506007)(8676002)(66556008)(66476007)(4326008)(6666004)(107886003)(44832011)(316002)(66946007)(5660300002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eVl0Y/6s3rILMlkNq6kOSZsjbnnKWcz77ZWDuIQYqAGuL+/GEqHJCGuzq7+xdL7G8fSzVuo3T6Ci7oZh9PbvIaI8gg5GKAKms/PSIUX5h1bTSebc/UjZPqrYnCBNPl5CPPmJjA2ZoVNscMatdOpZpmAVNO4rQU2NIuvIhn65gxAvUZpDdhjqrUZ5NrKgYJ9mmSPmSKVaG7nQ5aNYhlOU+Q5sxDH3AFuw8XGgwXb2O/ATXk9FgtTLzss2mRYqHKfM5kb7PProNftYrQE6VmSDmnA+WYBqhJOdS97PZf/KYHkcc03YDozvIOtQPgKJpqfM/ZIyO/qQkiszPCGkkC3m4O3kYBVDNAancexwQaIQgR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qCYuhbf/KURSi+xfAENICjZV+ns7IvrWXvfHFmLve/4ybMHIt2NUvv/ASgDAgaowUs5KyP8IiHqWoNDdLUopQ7/wWkQ80Jfmy6bGVPI2lrTEZL6UMC5TK2UcBL45DQ8I3v7ANpJwSxp7IhcMzZG4vJz6geGRxluCLvyQx0ho6BBva2g+WToTG3AnxcNELnLa7ajIHVTAwh9MgNopV222QjU8NUDYKpt+xh9504lVLMRtLSGvpf606KnUbKGuGDGniwVHv6tcpfWZI5eQmCuUvJyVaW5JQUez+uVd0Q+ivRv6HCaGJhe4Fe4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d2240a9-8a8d-462c-fed5-08dad25c2cd7 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2022 22:50:55.8305 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bIUHTmcF5aJwYibkvhqX27rRYWxoSH7Dpk9KPC1j8ilSqqzKQPSvISenqi1ox9d+W5vxdZ1PtSS4AiBsOSIe6wRaqgOtCBKie1QikT4XfEY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5586 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-29_13,2022-11-29_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211290137 X-Proofpoint-GUID: KKwCzWtllePi_eY3CNfopvafwq8qpcKh X-Proofpoint-ORIG-GUID: KKwCzWtllePi_eY3CNfopvafwq8qpcKh X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750872795247389634?= X-GMAIL-MSGID: =?utf-8?q?1750872795247389634?= Convert prep_new_huge_page() and __prep_compound_gigantic_page() to folios. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 63 +++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 5e580ab834c3..f61b4eb58cde 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1789,29 +1789,27 @@ static void __prep_new_hugetlb_folio(struct hstate *h, struct folio *folio) set_hugetlb_cgroup_rsvd(folio, NULL); } -static void prep_new_huge_page(struct hstate *h, struct page *page, int nid) +static void prep_new_hugetlb_folio(struct hstate *h, struct folio *folio, int nid) { - struct folio *folio = page_folio(page); - __prep_new_hugetlb_folio(h, folio); spin_lock_irq(&hugetlb_lock); __prep_account_new_huge_page(h, nid); spin_unlock_irq(&hugetlb_lock); } -static bool __prep_compound_gigantic_page(struct page *page, unsigned int order, - bool demote) +static bool __prep_compound_gigantic_folio(struct folio *folio, + unsigned int order, bool demote) { int i, j; int nr_pages = 1 << order; struct page *p; - /* we rely on prep_new_huge_page to set the destructor */ - set_compound_order(page, order); - __ClearPageReserved(page); - __SetPageHead(page); + /* we rely on prep_new_hugetlb_folio to set the destructor */ + folio_set_compound_order(folio, order); + __folio_clear_reserved(folio); + __folio_set_head(folio); for (i = 0; i < nr_pages; i++) { - p = nth_page(page, i); + p = folio_page(folio, i); /* * For gigantic hugepages allocated through bootmem at @@ -1853,43 +1851,41 @@ static bool __prep_compound_gigantic_page(struct page *page, unsigned int order, VM_BUG_ON_PAGE(page_count(p), p); } if (i != 0) - set_compound_head(p, page); + set_compound_head(p, &folio->page); } - atomic_set(compound_mapcount_ptr(page), -1); - atomic_set(subpages_mapcount_ptr(page), 0); - atomic_set(compound_pincount_ptr(page), 0); + atomic_set(folio_mapcount_ptr(folio), -1); + atomic_set(folio_subpages_mapcount_ptr(folio), 0); + atomic_set(folio_pincount_ptr(folio), 0); return true; out_error: /* undo page modifications made above */ for (j = 0; j < i; j++) { - p = nth_page(page, j); + p = folio_page(folio, j); if (j != 0) clear_compound_head(p); set_page_refcounted(p); } /* need to clear PG_reserved on remaining tail pages */ for (; j < nr_pages; j++) { - p = nth_page(page, j); + p = folio_page(folio, j); __ClearPageReserved(p); } - set_compound_order(page, 0); -#ifdef CONFIG_64BIT - page[1].compound_nr = 0; -#endif - __ClearPageHead(page); + folio_set_compound_order(folio, 0); + __folio_clear_head(folio); return false; } -static bool prep_compound_gigantic_page(struct page *page, unsigned int order) +static bool prep_compound_gigantic_folio(struct folio *folio, + unsigned int order) { - return __prep_compound_gigantic_page(page, order, false); + return __prep_compound_gigantic_folio(folio, order, false); } -static bool prep_compound_gigantic_page_for_demote(struct page *page, +static bool prep_compound_gigantic_folio_for_demote(struct folio *folio, unsigned int order) { - return __prep_compound_gigantic_page(page, order, true); + return __prep_compound_gigantic_folio(folio, order, true); } /* @@ -2041,7 +2037,7 @@ static struct page *alloc_fresh_huge_page(struct hstate *h, return NULL; folio = page_folio(page); if (hstate_is_gigantic(h)) { - if (!prep_compound_gigantic_page(page, huge_page_order(h))) { + if (!prep_compound_gigantic_folio(folio, huge_page_order(h))) { /* * Rare failure to convert pages to compound page. * Free pages and try again - ONCE! @@ -2054,7 +2050,7 @@ static struct page *alloc_fresh_huge_page(struct hstate *h, return NULL; } } - prep_new_huge_page(h, page, page_to_nid(page)); + prep_new_hugetlb_folio(h, folio, folio_nid(folio)); return page; } @@ -3058,10 +3054,10 @@ static void __init gather_bootmem_prealloc(void) struct hstate *h = m->hstate; VM_BUG_ON(!hstate_is_gigantic(h)); - WARN_ON(page_count(page) != 1); - if (prep_compound_gigantic_page(page, huge_page_order(h))) { - WARN_ON(PageReserved(page)); - prep_new_huge_page(h, page, page_to_nid(page)); + WARN_ON(folio_ref_count(folio) != 1); + if (prep_compound_gigantic_folio(folio, huge_page_order(h))) { + WARN_ON(folio_test_reserved(folio)); + prep_new_hugetlb_folio(h, folio, folio_nid(folio)); free_huge_page(page); /* add to the hugepage allocator */ } else { /* VERY unlikely inflated ref count on a tail page */ @@ -3480,13 +3476,14 @@ static int demote_free_huge_page(struct hstate *h, struct page *page) for (i = 0; i < pages_per_huge_page(h); i += pages_per_huge_page(target_hstate)) { subpage = nth_page(page, i); + folio = page_folio(subpage); if (hstate_is_gigantic(target_hstate)) - prep_compound_gigantic_page_for_demote(subpage, + prep_compound_gigantic_folio_for_demote(folio, target_hstate->order); else prep_compound_page(subpage, target_hstate->order); set_page_private(subpage, 0); - prep_new_huge_page(target_hstate, subpage, nid); + prep_new_hugetlb_folio(target_hstate, folio, nid); free_huge_page(subpage); } mutex_unlock(&target_hstate->resize_lock);