From patchwork Tue Nov 29 22:50:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 27530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp607740wrr; Tue, 29 Nov 2022 14:53:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wdlG3+W1H5vlrdDcGOQS03GNNRGajp2IGg/RpVKrvuDziZvt2SXOMSHA1lEG+H5bfvFQi X-Received: by 2002:a17:90a:a012:b0:20d:7c09:c92d with SMTP id q18-20020a17090aa01200b0020d7c09c92dmr60835160pjp.95.1669762400266; Tue, 29 Nov 2022 14:53:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669762400; cv=pass; d=google.com; s=arc-20160816; b=GkMQl1tlHNbtjI9t1MPP4XaInrAiFVgBePUo5gsMzxggCJEfPs9B7ja3HrvhOteps0 nGahOLGjOkCe8mo+31f2ldac660DeG0qXiglypJsY0T5puNUiepMXRC8hwAW47lrVPPA XqNzG1jCVpIA9yJf2dlgUQlsukEmDMm5+aMjcAT5+wvX9lwsCZ9q1GBdT15ZaUk5a3E8 ExtQ40lZiwVe6Omxx7bibXZs9WFFYbSwfUuAAaLXPPICSo0V4nhrUwIcY26JmLGdtmtf ZF+gkhA1h0+3XBFCj8xAHhg07OwV372m/2pGc2BzK3fatxJlmABnd7wNRqunKaKHDzDD hJZQ== 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=y8+A3q3OU7z0MZTrGwpnM52Q3PMm64WXjLUV67OQZgM=; b=LPMpYbhp5mHyim0/lLXEhAyHGccfnt7AIum3VP/IQpC4Ue78PNpmauErm1YCTk5Xwd dN4i9hxpEtzhMZEBo2nCgKiK/+/ytXsoCu9N6IRkpTKi2AO+E/fYppNhhYzV/J5+wMhv X3lkD6DLMVruUZ944DRHUqZbAcxdb16OeIhU6he78dTEK2RH+onxAfBHdjX5wlIZjD06 0uPQCZmFLIL3oHZYvhcV9XyVAwkV+4aRebI3JQ+D2tfcxoJNHEb1cFXjMuaG2S6fo27e 73ixdWhDaESzJ8Op7laadfKLBAX07QamfuwiPbu07K/q0pNqkCvYQz/CojmPGdvUSJbR 9EaQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=tAzCtDgm; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wCn6i8rk; 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 k22-20020a63d856000000b00476e8270b1csi15800394pgj.675.2022.11.29.14.53.07; Tue, 29 Nov 2022 14:53:20 -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=tAzCtDgm; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wCn6i8rk; 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 S236550AbiK2Wvm (ORCPT + 99 others); Tue, 29 Nov 2022 17:51:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236927AbiK2WvN (ORCPT ); Tue, 29 Nov 2022 17:51:13 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51F4470DF6 for ; Tue, 29 Nov 2022 14:51:12 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ATMDZrP028271; Tue, 29 Nov 2022 22:50:53 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=y8+A3q3OU7z0MZTrGwpnM52Q3PMm64WXjLUV67OQZgM=; b=tAzCtDgmycQQei0gR4i3Ln31fzYcu5p7V2mp7KlUosOqbJHO+/vbR5jL7hpwNXzUPnIo TvmWA9o+sV9H003iLyWh4wuSkvJIgcwNbA4NPAohpgQ4F06zF4GruxPzvNMKD46RhWrs 11XAYj247LVefUCEqI8CxdwQmxatxtL/W9fTRvRnv7zV2PTxov9dJpQ9f0kFNRPwWco6 UiXRLDlmwHaQVd2K9LW1rky3fPqO6YnLmnHMhTYfZ/0N7rk1IO6XyXXM24Sd+P+77vLE 0WfJbfrYT7PPxjJMSBbg8HjZHaaj1jphWziaROts7jvy+PWWKMWAlWh971wbyooFyQbf fQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3m39k2rh7y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Nov 2022 22:50:53 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2ATMUMvI027897; Tue, 29 Nov 2022 22:50:52 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3m4a2hp9tm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Nov 2022 22:50:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HPNoLGk0VTxXj4BJ1xZtDpleFhzeyy02s7orktl4ShhagS/prMOzsj62NyrZB73JUzAnP/6EW9T4T6KsQflzxMD3ZsE8XtX3C//Z9ZzON295cRLtSDFtyinS8Nt2xEqR5MsMgI0srlBXJJq/WVAPWmYlO8AijmZGgUWAauSmBEgWDIggK8E3OUtMnSrKhpHaiCgopkLWaYhbIGkmmZKRZ8YzwhrrvAS0yJ+JZyscCBMR/cyNWPovJMhA3U5PubRaOWDD5BfV1F5CXZtW4gyS3KGM/KWr43rBVnEeUFAfbw7ZRnpnkrsbOhE+6CXBCB//kej1oki5nBy4mNBkT3/hAA== 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=y8+A3q3OU7z0MZTrGwpnM52Q3PMm64WXjLUV67OQZgM=; b=BYYlaTbq4sfBYnjhhqYPamkrWzeg16xO8Vrf/noe7LeQeXzIcFKT3uuPeFwVf2Au6UJxYm/zu99ywnjN8eL6uOqnBZbjSP1z/K7WIqn9+hhPjYSPT6Ojs5GchXdTSheVBgPlEON/Y2ZI4QgXuV4laHs2asIjphTysVj6Yjnc3SI2/przmuDTGPc4w7mTAqRXU+L0m8n4h1e81Icr7zEW+Ze3VA+oIfYSNSdWW7BvjNMFn7branW0J65isR/IhJPIxi1dVk900+1DHFwmIgL8D5z2g142GRxQiMG/YJbwmiC4NVRIQ26ngqT/esYXqOpy86s8oTzvtqv2bBXmPLIajQ== 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=y8+A3q3OU7z0MZTrGwpnM52Q3PMm64WXjLUV67OQZgM=; b=wCn6i8rkAvTKWXkotHpeAQaDlcJtd2d0q0dlmnSvqZE5YLo1mvYb8Iix/uv/z2Kn/92nv+go4Re7brHz42G+M1o+crnYlr2fDeyZgQg47HdK5bUIR7L91P9EJjAXCyJIx8IlNbqfv5FDXql4O/r+fht3F+M5NEibfm7AbcQ2wzo= 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:50 +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:50 +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 05/10] mm/hugetlb: convert update_and_free_page() to folios Date: Tue, 29 Nov 2022 14:50:34 -0800 Message-Id: <20221129225039.82257-6-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: CH2PR11CA0030.namprd11.prod.outlook.com (2603:10b6:610:54::40) 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: 923a941b-32c1-48ea-a991-08dad25c292e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N6XJOlgCLzzqDQC7Le423cIE/7oqbcNMN/OWFxnXLIJZnyNBa1jAg/GA6QnPcdPi09XtOhpvgXQ0oG4pH3fkayg05SBBc8rfcRLPOuF0g9lP3KJphMS6RJA5aBm263JFvbzW3AdjmAgm8sK+Yll4SKVLJUIo6vXruwydgjTVplw3B+zJwlgUDitaGf8wguN5eOWOJ/agB892pm0DjogMGVgeelTk7yOczLjhwi9rlee8qHpO8CbRHUc2c0f8AuG9ydDb5zz1QXIfUHHnPJVY6hol8wpdOkU155jcaFKoxCm8tOXy4CqdPO8vqQm9Bivkqpckh6Q4uWCfII8iC6bpCJNm0fMmeYk4Bj+Ih4ApWlGOAWEwWTiI1uO904exLAcjLUKXV0/ibfCPX9QV63wJnNew2Ha8xm9gzZPDLi1YwSJ/2+JbvkhWQ8iio5mOpTe0RBUpq1h+1scupAYxqEg0s7s7EmI/vltakV/r6siQE8lbnjPjHNsWLtMvWEIfIHYsrWAvlgH7+3XGKtiOSXK2pqS2G8bdeJTKwD7qMXJDGr7ohTBCdcvtyRhSrD6vp5iCjGUcwkMEVGlU/VCxawLhhEtpGD3nwx/YyrLUkIgKlvdUDXwT6qzyChe33thNurZS1NCG26Cad/sLI8BwT23TdA== 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)(15650500001)(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: 4VE+sPk/nhewN62ki+pzizJfVk5mw2EjMhVOf9f+JGpa1VmdzBwPyjjtmBnHg0av+ppFyu4rFHGuf8Qwa6QtHBWBw8SPYh/EFRfTNHLqWXregseOVJ6FBEauuBwx3hAUm8K1NMRD8fJk4QvuwRM/E3lrj3KBx/ZRAKobg/p/D9MmHTVKCfaJMfRpL2OaO8SiYNTScxDhXKk4vaKjkZDKao5FNwswcD5dXOUA06tukOcK1T2gA/7ulQfmIQ2u/P+xfR1FivPP+kdRDKPLvVZW2wjo7vy1leGAkc1gCGFxvcCR8naoI2k0FzZVUzRcVsCbobLCAW6DQZ0g75NA+EFvTfgSjZJnZYocyx4bVMOgXEY3bXbctTIq1O4woJhidy6c80dKW9/pHZ2xJYwrKalaJAg0aRGZNGl4YL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DnWrJv5Zzo0M8UjaX4p+UdBrSCrHrSCinrNx6NewRM7xvAbW0TZC4JN0uQ6gBtf/SYl7topgINRkPd4VkZaw/XFzRLHe7AaTkMN014yY0zGrhLyWRYT4L86F3JlyOV7SbPwXdfWHxOE/c8p8gDwBHiHs84EGmfBUbT3tM85JzXoo88CnIxJsDwADb0FTgQspal6SdBhkYlOLOT9bzDg8hCUKowpzEsljgYIE47g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 923a941b-32c1-48ea-a991-08dad25c292e 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:50.1405 (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: csn6WYul6NfqAr9CXNnHyWuaHmNbuNO1bGehdbzBcypPFDvGJH08C2whlGHXU4j/UvV3fwH4r+NCQP7c689daHbVvBw4AskhyHLYM/UMXpI= 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 malwarescore=0 mlxscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211290137 X-Proofpoint-GUID: yQXmKFIDwUELylECXPH4Tt3IGGWoX5Zk X-Proofpoint-ORIG-GUID: yQXmKFIDwUELylECXPH4Tt3IGGWoX5Zk 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?1750872778132304320?= X-GMAIL-MSGID: =?utf-8?q?1750872778132304320?= Make more progress on converting the free_huge_page() destructor to operate on folios by converting update_and_free_page() to folios. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 90ba01a76f87..83777d1ccbf3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1478,7 +1478,7 @@ static void __remove_hugetlb_folio(struct hstate *h, struct folio *folio, * apply. * * This handles the case where more than one ref is held when and - * after update_and_free_page is called. + * after update_and_free_hugetlb_folio is called. * * In the case of demote we do not ref count the page as it will soon * be turned into a page of smaller size. @@ -1609,7 +1609,7 @@ static void __update_and_free_page(struct hstate *h, struct page *page) } /* - * As update_and_free_page() can be called under any context, so we cannot + * As update_and_free_hugetlb_folio() can be called under any context, so we cannot * use GFP_KERNEL to allocate vmemmap pages. However, we can defer the * actual freeing in a workqueue to prevent from using GFP_ATOMIC to allocate * the vmemmap pages. @@ -1657,11 +1657,11 @@ static inline void flush_free_hpage_work(struct hstate *h) flush_work(&free_hpage_work); } -static void update_and_free_page(struct hstate *h, struct page *page, +static void update_and_free_hugetlb_folio(struct hstate *h, struct folio *folio, bool atomic) { - if (!HPageVmemmapOptimized(page) || !atomic) { - __update_and_free_page(h, page); + if (!folio_test_hugetlb_vmemmap_optimized(folio) || !atomic) { + __update_and_free_page(h, &folio->page); return; } @@ -1672,16 +1672,18 @@ static void update_and_free_page(struct hstate *h, struct page *page, * empty. Otherwise, schedule_work() had been called but the workfn * hasn't retrieved the list yet. */ - if (llist_add((struct llist_node *)&page->mapping, &hpage_freelist)) + if (llist_add((struct llist_node *)&folio->mapping, &hpage_freelist)) schedule_work(&free_hpage_work); } static void update_and_free_pages_bulk(struct hstate *h, struct list_head *list) { struct page *page, *t_page; + struct folio *folio; list_for_each_entry_safe(page, t_page, list, lru) { - update_and_free_page(h, page, false); + folio = page_folio(page); + update_and_free_hugetlb_folio(h, folio, false); cond_resched(); } } @@ -1751,12 +1753,12 @@ void free_huge_page(struct page *page) if (folio_test_hugetlb_temporary(folio)) { remove_hugetlb_folio(h, folio, false); spin_unlock_irqrestore(&hugetlb_lock, flags); - update_and_free_page(h, page, true); + update_and_free_hugetlb_folio(h, folio, true); } else if (h->surplus_huge_pages_node[nid]) { /* remove the page from active list */ remove_hugetlb_folio(h, folio, true); spin_unlock_irqrestore(&hugetlb_lock, flags); - update_and_free_page(h, page, true); + update_and_free_hugetlb_folio(h, folio, true); } else { arch_clear_hugepage_flags(page); enqueue_huge_page(h, page); @@ -2172,8 +2174,8 @@ int dissolve_free_huge_page(struct page *page) spin_unlock_irq(&hugetlb_lock); /* - * Normally update_and_free_page will allocate required vmemmmap - * before freeing the page. update_and_free_page will fail to + * Normally update_and_free_hugtlb_folio will allocate required vmemmmap + * before freeing the page. update_and_free_hugtlb_folio will fail to * free the page if it can not allocate required vmemmap. We * need to adjust max_huge_pages if the page is not freed. * Attempt to allocate vmemmmap here so that we can take @@ -2181,7 +2183,7 @@ int dissolve_free_huge_page(struct page *page) */ rc = hugetlb_vmemmap_restore(h, &folio->page); if (!rc) { - update_and_free_page(h, &folio->page, false); + update_and_free_hugetlb_folio(h, folio, false); } else { spin_lock_irq(&hugetlb_lock); add_hugetlb_page(h, &folio->page, false); @@ -2818,7 +2820,7 @@ static int alloc_and_dissolve_huge_page(struct hstate *h, struct page *old_page, * Pages have been replaced, we can safely free the old one. */ spin_unlock_irq(&hugetlb_lock); - update_and_free_page(h, old_page, false); + update_and_free_hugetlb_folio(h, old_folio, false); } return ret; @@ -2827,7 +2829,7 @@ static int alloc_and_dissolve_huge_page(struct hstate *h, struct page *old_page, spin_unlock_irq(&hugetlb_lock); /* Page has a zero ref count, but needs a ref to be freed */ folio_ref_unfreeze(new_folio, 1); - update_and_free_page(h, new_page, false); + update_and_free_hugetlb_folio(h, new_folio, false); return ret; }