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: 13115871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A37E0C54EAA for ; Wed, 25 Jan 2023 17:06:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 468956B007D; Wed, 25 Jan 2023 12:06:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4186C6B007E; Wed, 25 Jan 2023 12:06:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26BE16B0080; Wed, 25 Jan 2023 12:06:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 14AA06B007D for ; Wed, 25 Jan 2023 12:06:21 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CE6E316058E for ; Wed, 25 Jan 2023 17:06:20 +0000 (UTC) X-FDA: 80393949720.24.17F6E48 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf12.hostedemail.com (Postfix) with ESMTP id 7DA8640024 for ; Wed, 25 Jan 2023 17:06:17 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=RFB+VXA2; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tK+jg2s1; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf12.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674666377; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=z3ea2iaVPYZ70tiYGbEI73RrGrv+fSL+A233vkE/EZc=; b=E0hRKxyLXb8+hLOd40j3DCxw8rwGAk9ilTdBouGc32lRmHMlLRRbeOzTy1EqTDQW6uD0Z7 SCWEKVvonOFcbCA/tZN+Z58FXNsS7z8FMZf3o59OOjzaYfLF7dxKuadAi2zO0vItcsZEZ7 pOiVgl72m7G6gx8xaLFfBErg/F388Q8= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=RFB+VXA2; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tK+jg2s1; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf12.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1674666377; a=rsa-sha256; cv=pass; b=YQti6cm5/CY1fmVY+CuZbTS2ZqoWyZWYD+WzFGKQaQ8Y9tBwX4aCOqRuLZN3Dtdc4HbE40 PiOElBkWHCjvgLmXSL4gmTSBb2Kcs/iOlo4kM8qZguo+/BL41nlcVmHlortRZVKI04KmSy usKqNs89ImXTumkZ0d5qM1EKt6yMEyU= 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/UKrRozX5uglYt6dqExS6yOszUgUC6u6P8r6GLg2pLtfsnT+ZiH4jBLwF75xzJJynVf7I2h6r+MrgsAH4L+PW1nU51CWqR7QPvucH2heJ3RcADGDCmCpRJLlut8f5K+YpHHu3vn7AlnAtTpdn33GZClG+0JpYe4bbcNI+6ySgA9JEyk6MtAAKPNjiF9nxeakdgBmhxphRq1RnJ9lHzLU4YALAqGhzV4sOyGNz0ijXgr/LnfXt26+pA0kV4MJVJrISNaSIYlNvwjtPnKhEVl3iinHeUr6OgVNHqzSV2p0mC2EYpJeZZpRPYmhCMpif2/bYQ3JT6erPYBMk0/3Y/zidpnAn7CIbVZMWe9MmXifOlI3xL2Cey3TRFf0zO/Cvh4ZwvMeW8Y0yLIMOOsJRIhQv1zY/hgODpycMhh8oX5rDPh/m6SoQGwm5HvN9MjPajx/3+qIOY6JOeBOP4XqB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xVnkQGQXPkGQdAhxMprs2stiHS0BgS28fT37BjOPB6K4E56oFWYHMLbiQGWn0b4kN9CXwECUS0o5zQTqZnfYXrTrKalYFyezpFiTDaz3Dldy7YG1JI7RVgBw5X3Je4uydP3iw+WGLBxVnRud1HEWAOtihWsX4NEgu7UbbV51c/0O/CMJcQis8ZCNCkWNe4NgHSg3ErmeN+zHhZ9T8i04U7sLU4+OBB7I4kRDdpLQxfs8qFFCsaSTDlP3QNcEz2OdOC2TltSPW4+PGYapz66FHqxwN4Ows0p0Po14f49RYT40y+GrpUlVaJ6fsz9vNLR5Ch5N2o2fTaREW+PR+ds0dKtwU625WmtTzwBvdDROFe29ROVBLPNrLu2QccjHqN0tt668t1aEtYALjCnmIKutQj2+XtC1w49wxv1lwA80BpFRVEQdq0MbUeI2ElKGW8m9N8eZAy+tvbT6mNkdWwGZf0f9EJpSO9jET/zr6Yvq6zk3+x4rQ8usiFZ/igEeqVACoak4hOAzetsvU/GnyFUT6TouvXC4PeQc5WdmAB/dYms6O/Uioh0CgGLk0j64KiZmwPcexUfLIL5PDMPSMOGyJ67gRxz8ShrWDZmbZaJ7tYdptOCiQJlSP8l6Dx6cpWXJz6OZHfBRopqoCRAUPPRMvS8uXlPfCCMwEvOq7Kk5BGyaN7OTuQWKX2f+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-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 7DA8640024 X-Rspam-User: X-Stat-Signature: 639jk51ni9udc9t74jr1b6kuqd1pjbyz X-HE-Tag: 1674666377-126017 X-HE-Meta: U2FsdGVkX18GRqvfYLQ/tgkKYCp6owXGgwKWUGkH4LxRuZ7an4S707OLuxVlS+ARMPs4vEa8gAhwxj/jMfOsLOQpKZDDJWeBiutbDuuUIKD0k0jBMbwWDtQi/NgIw8By7iHp6G+MljLRi2WutkRLJymPGmxhHYTpzQMOfq1+rPfE2aLJL2txbhV5nkhieieNR4KnbCbFXz9+wkMUcetQvb4tjazdz4FNrkF57tMBqbzPWi4dPsoP9gmqM2LGUiQZeFF/d33cn8+5Hffip8MSU79iMnRHhZnwEnl3Ay9ZOpC/Usmh58oQp6cI65h7bckVZSXSD7p0Q3ebUlEAD657TTwni/7lb3XNldVp0++Y0GMzQSEDxeM7HhhQX3/ObrJ4OQknTZWBOv+LV1SohZ1TXWvBkLsnl/Rt6LJ8Y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mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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; }