From patchwork Wed Jan 25 17:05:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 48223 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp386401wrn; Wed, 25 Jan 2023 09:12:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXuD6YSLs0PcwLxAthXu16eiE4J8bkYYtYF5uu2VbYZFdQymKEQDblcgf6zkPdiaS4LP4OjC X-Received: by 2002:a17:907:98b2:b0:83f:1e04:b776 with SMTP id ju18-20020a17090798b200b0083f1e04b776mr31997888ejc.40.1674666755326; Wed, 25 Jan 2023 09:12:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674666755; cv=pass; d=google.com; s=arc-20160816; b=wuE1Po5iDt+bXm1LW0IYZpxj+NY3bT+a21SKImbZPCHwNI/v6zVDJh6bph9vFCX8H/ r2aaMn3dJR3DdAn1sNRgm2BSf1uceOtIvx0cPzm0gNcrJTkfW3U5uPIpjFHUgBQUMoKi xtC+/Kc8A6BVmSUvvVOHmdCEjU1AG9+ZyNft866BhTUFLPvFvGAEJ3EudoITK3kLNweF GcCzcj/egdoS48lpbARD9gryo/W5speArfBHStWJxy9JTjCPJ+oZSCUQvaGBHt8fPjDe HZ/8ey+zwPI2RX/NR9bNyOtMVA3FPmCqXJv9P/7PauNijuINLz4DLz58bvThDtuJC0oq Cfmw== 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=z3ea2iaVPYZ70tiYGbEI73RrGrv+fSL+A233vkE/EZc=; b=m6FV/OtknLpU0XbLjP3sj+MopRP2lo2C6a+NA34Ps9Wc+E/cLH5okYC0/bDDy02S9M sSMipUIO2jdJlZ0Bzot3yHPLT/SF5iu30g4xGiUYJfwbbEFOBiMcf3jk/XHlPiu/OzqH PSp/6pxTHe6vl8ExXlGCO4GFODgBgh2XVQrRhyrhTKmY1XrmM4XgFZDRBAySZZ3tLcDA yxyPa0+zgYmn82dEYb7tKlNCxev4IpYG7D1Np8KnG4U79DLK8uX2Dk09pmfa7QqoQuuL CYooWMMF165yI5GCwOLFRKXFlD95ArUeHrJ259fdwY0bkER9pw31AIpgpw5Peg29Q9YQ +vnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=RFB+VXA2; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tK+jg2s1; 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 vs20-20020a170907139400b00871a4e8d7bfsi6753130ejb.230.2023.01.25.09.12.10; Wed, 25 Jan 2023 09:12:35 -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=RFB+VXA2; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tK+jg2s1; 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 S236043AbjAYRGf (ORCPT + 99 others); Wed, 25 Jan 2023 12:06:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235770AbjAYRG3 (ORCPT ); Wed, 25 Jan 2023 12:06:29 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E69E5A36F for ; Wed, 25 Jan 2023 09:06:24 -0800 (PST) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30PFNjsp009509; Wed, 25 Jan 2023 17:06:04 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=z3ea2iaVPYZ70tiYGbEI73RrGrv+fSL+A233vkE/EZc=; b=RFB+VXA2TsBgvars8j57xB7M/yosiF6dfuqWEakeOamZW54xJtSbdQb2O2g3F9BPQrsg BHniVwWuCtfD2oKOdbt46/oX0Lm5bBCzKldQONtj+1KZUrLqzyrFA7bEoSoRjuzHdKUl R/Aj84s5mwV37eVAbzGCJ7CapWJdj4rB5nH5FFTP4/kQpfTbi4nyJ0FJbR6B+DsHSf4E T5VkDgTlkBl55HiiCzA5Y11RMA6V6+kOHCtuKp6YvtwOwoiUwLRbiILZfqcB2OGtP/uZ ymjJbuGufnkQKZzGhcpHdOZBqLCKMTawXnCmyQu4jIP7Wd0iTLgVVenxPorYvdyZsbpO Vw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n883c8jex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Jan 2023 17:06:04 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30PGHiCQ031875; Wed, 25 Jan 2023 17:06:03 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n86g6t5av-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Jan 2023 17:06:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RozPcP14nkaIIKntLEpVvR0NbZwE65Q8KmLqpe7FzHlGi1JEuLmNCTphRoMPHtP8E/yIU7vJNVJxklPjTkxaqSvNnDoU0rrDQsMiIxgX0s4rdlOKFKi4EK9oIViQNsBoGUxPY2GwQCalaRP/UM7HfRb2daj/B8kTIaUlwTtwN3eWXD/3Xjj9Qtiu/NmVpWhgoX4gmRrqn4TZmpzOmgYYuEEOmF1u2AO3KIvC45HpaGbFgYuaHleCDN2i5OGC3LKIlUO8vjiIfD5nN6UE1un0bAfraE/aG4RuNZZbDSDBT62wLViIgeZMDTV3xtFZb3XA3Lyxf3mx7FN/w5SbKypCHA== 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=z3ea2iaVPYZ70tiYGbEI73RrGrv+fSL+A233vkE/EZc=; b=IMLwNDIaNL7LL+/yyCwKHi1DpfpsITtXqgOW1HA0HOBhJjOQJOtKMvfW5H/73otEdyVjsK6cnKa12FooMdM3axqO/adBxMEymuboIRR1IEQ1AfZJhUjPWxEFoRfQU9/37UxSjrMPcaM1rXUNRwTVGkHR93FzteYDPunYKyKDEt5kx5WtF4I09EZ9MNC6IF372nZ7aZgh3SJ/OBdz1IwvYT8+iEaGVgeSSz7dEs3xw5ScVewVUOV21LDlwDb9ICa7Hjcrl7ajVvjUiH6LbBhKBvMsQ9BaKA196ZMhUHRUjrsTYb/UoXxIdWHzaizV7nLxLejl4n752XNTMwvy65woaA== 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=z3ea2iaVPYZ70tiYGbEI73RrGrv+fSL+A233vkE/EZc=; b=tK+jg2s1Jy968/mkApRhUKzFSIqRp/4wv47U/4vwPPUV2HBNtQRXXa2CJyA038cA6YEDIF5KdyhtCXpBWzsuQ3tkS4fKBb7moqkEJuKG3TgcuMuoBpWVPuFvIQ2BFxWYdmaUbiOhyGDgSkglk4SOsHjHXVu+Qn89lhVwbTKRntk= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by MN2PR10MB4384.namprd10.prod.outlook.com (2603:10b6:208:198::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.20; Wed, 25 Jan 2023 17:06:00 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6043.017; Wed, 25 Jan 2023 17:06:00 +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, jhubbard@nvidia.com, gerald.schaefer@linux.ibm.com, Sidhartha Kumar Subject: [PATCH v2 5/8] mm/hugetlb: convert restore_reserve_on_error to take in a folio Date: Wed, 25 Jan 2023 09:05:34 -0800 Message-Id: <20230125170537.96973-6-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230125170537.96973-1-sidhartha.kumar@oracle.com> References: <20230125170537.96973-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR03CA0113.namprd03.prod.outlook.com (2603:10b6:a03:333::28) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|MN2PR10MB4384:EE_ X-MS-Office365-Filtering-Correlation-Id: edb7cb53-3212-483b-b3ec-08dafef66efb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VoFzedH55IxCXfs994+vmKyLkCt/LlDNMQLY3tBZtJLSdUZPcp2x3O/TRH/28jq4ZpywmFHA2lCdK4Z9LXjL2KfYQ3XkMwLHHNkeKPIKelE9TOCC3GVOHQPmNEOcr6xsV7ZT7ehpbRlsCT/Vc0G+AOFN4Yolh0Gz1zuQZetM/6iXSCp9kdJmRjDAI2L8ZYkZAEH09tkQtQAnj9MzwC6duB4pltWubslUgt8g/5r8ukVyrm2a3LF/0V8ahRmmIPFoVbwIONx6SeFv3LcEV/RDHydPfeRAxeoG0fpmZ7JcwRxAbQPmJDpwOJ2E7FeoTdlnAMgYzdSuJkJMyBlfQFYnEpPOQ8boAiAao77COphlJ+2LkSU5oWMKAg2NBQq4NFKrQgn7i0fBs2s2ckEIGpZeD4Oxbb95RPb19ABFI7uyC8FbBAgYroDunMCVH8Yd5BrhdCVoSe3SX/LWkb8tc6IwgbfJ3NJWE1HiAXT9IxZPCB7PLwLs0XCv1a13+hzP7b3Qj/EIuyc9ybHymHr/iW96n0CBZiS8poBE7VmnA0qhCh7gunY8jmg8NsuR/bW7AgbGxcQMgz75yZZXeXvnKyuZeI6/uqBOSxJ4HTtn9HAIvSbl83ubfuo3P0ojE22/n1kwfozK/Z+4ZupiCbKDx6HWBw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(366004)(396003)(346002)(376002)(136003)(39860400002)(451199018)(186003)(26005)(6512007)(38100700002)(66946007)(66476007)(66556008)(8676002)(83380400001)(4326008)(8936002)(41300700001)(2906002)(44832011)(107886003)(6486002)(478600001)(5660300002)(6666004)(2616005)(1076003)(6506007)(316002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YPhLAf4DVUj1h4TmYkHSr8/shIEAgSHcEffxPtTP9ON5EHyGB7Id81zmPj9XBYVgb6AeBqj5qU/L9i/P9Bhwotn2UyxWOLDvgECPKg7ZgkdBzEKHD4RmseAyBhq9DllPLiOc0Ce6ZBcPVV+Qo8UTYFHLpjTuqCMLrvzxhpvW/KqT4qgu66fNjeKF4MfhDY+62BkAJQPfPGTvwd+ySAoMcq0IGBS8TjtOdpUtNG55sooyYvABzOAMxYHAzpapXMTH0zXRCmAu4xMSrTZ9V2Old4LaDlZWj2Ye5FWZuHne3qyXKh56ze4IbrREIY2tilANDtcGMTkKUTNkJ5We0PYx48fOnthCc7tPsJMchA0Tq2Us4xT8Kzh+uDYseT2etvRBIfNjh7rooItfaDQNDRyI/UKrRozX5uglYt6d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lSP8l6Dx6cpWXJz6OZHfBRopqoCRAUPPRMvS8uXlPfCCMwEvOq7Kk5BGyaN7OTuQWKX2f+nqq6n9LopGwrlDiJMPFmXU9UYRwePrwzL2sGC8I69fIXZ+8wBWf8QXvSwh1b4rbmr8k= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: edb7cb53-3212-483b-b3ec-08dafef66efb X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2023 17:06:00.7182 (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: 9dUMvuj/ypICxdDliAPL+YEwgD0PWkwBOT++nF7AQQ4wz8NKVXv4xhft90E41J3eK2/2rZUmB19M7pTIBNrfrX40YeE1GHjtVwV16nUF6gY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4384 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-25_11,2023-01-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301250152 X-Proofpoint-ORIG-GUID: SVNEP9c7uXmuU6nQBfSepqD9lZtyfC34 X-Proofpoint-GUID: SVNEP9c7uXmuU6nQBfSepqD9lZtyfC34 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?1756015367804692380?= X-GMAIL-MSGID: =?utf-8?q?1756015367804692380?= Every caller of restore_reserve_on_error() is now passing in &folio->page, change the function to take in a folio directly and clean up the call sites. Signed-off-by: Sidhartha Kumar --- fs/hugetlbfs/inode.c | 2 +- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 21 ++++++++++----------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index ac16ada48f75..e2b8a00696bd 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -873,7 +873,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, __folio_mark_uptodate(folio); error = hugetlb_add_to_page_cache(&folio->page, mapping, index); if (unlikely(error)) { - restore_reserve_on_error(h, &pseudo_vma, addr, &folio->page); + restore_reserve_on_error(h, &pseudo_vma, addr, folio); folio_put(folio); mutex_unlock(&hugetlb_fault_mutex_table[hash]); goto out; diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index f6849e67ffef..d46f9db09a2c 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -725,7 +725,7 @@ struct folio *alloc_hugetlb_folio_vma(struct hstate *h, struct vm_area_struct *v int hugetlb_add_to_page_cache(struct page *page, struct address_space *mapping, pgoff_t idx); void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, - unsigned long address, struct page *page); + unsigned long address, struct folio *folio); /* arch callback */ int __init __alloc_bootmem_huge_page(struct hstate *h, int nid); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e104dba1e5ea..aad028706fbc 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2802,9 +2802,9 @@ static long vma_del_reservation(struct hstate *h, * and the hugetlb mutex should remain held when calling this routine. * * It handles two specific cases: - * 1) A reservation was in place and the page consumed the reservation. - * HPageRestoreReserve is set in the page. - * 2) No reservation was in place for the page, so HPageRestoreReserve is + * 1) A reservation was in place and the folio consumed the reservation. + * hugetlb_restore_reserve is set in the folio. + * 2) No reservation was in place for the page, so hugetlb_restore_reserve is * not set. However, alloc_hugetlb_folio always updates the reserve map. * * In case 1, free_huge_page later in the error path will increment the @@ -2817,9 +2817,8 @@ static long vma_del_reservation(struct hstate *h, * In case 2, simply undo reserve map modifications done by alloc_hugetlb_folio. */ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, - unsigned long address, struct page *page) + unsigned long address, struct folio *folio) { - struct folio *folio = page_folio(page); long rc = vma_needs_reservation(h, vma, address); if (folio_test_hugetlb_restore_reserve(folio)) { @@ -5102,7 +5101,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, entry = huge_ptep_get(src_pte); if (!pte_same(src_pte_old, entry)) { restore_reserve_on_error(h, dst_vma, addr, - &new_folio->page); + new_folio); folio_put(new_folio); /* huge_ptep of dst_pte won't change as in child */ goto again; @@ -5634,7 +5633,7 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, * unshare) */ if (new_folio != page_folio(old_page)) - restore_reserve_on_error(h, vma, haddr, &new_folio->page); + restore_reserve_on_error(h, vma, haddr, new_folio); folio_put(new_folio); out_release_old: put_page(old_page); @@ -5846,7 +5845,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, * to the page cache. So it's safe to call * restore_reserve_on_error() here. */ - restore_reserve_on_error(h, vma, haddr, &folio->page); + restore_reserve_on_error(h, vma, haddr, folio); folio_put(folio); goto out; } @@ -5947,7 +5946,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, spin_unlock(ptl); backout_unlocked: if (new_folio && !new_pagecache_folio) - restore_reserve_on_error(h, vma, haddr, &folio->page); + restore_reserve_on_error(h, vma, haddr, folio); folio_unlock(folio); folio_put(folio); @@ -6210,7 +6209,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, /* Free the allocated folio which may have * consumed a reservation. */ - restore_reserve_on_error(h, dst_vma, dst_addr, &folio->page); + restore_reserve_on_error(h, dst_vma, dst_addr, folio); folio_put(folio); /* Allocate a temporary folio to hold the copied @@ -6339,7 +6338,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, folio_unlock(folio); out_release_nounlock: if (!folio_in_pagecache) - restore_reserve_on_error(h, dst_vma, dst_addr, &folio->page); + restore_reserve_on_error(h, dst_vma, dst_addr, folio); folio_put(folio); goto out; }