From patchwork Wed Jan 25 17:05:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 48219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp385750wrn; Wed, 25 Jan 2023 09:11:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXs5XITobW3h2NEB4QPsM2HcjHjDmsLv5Oz1L5vDoZwWbvnYorre7qIc/jta0ZNcTKdm91nY X-Received: by 2002:a17:906:4094:b0:854:956:1438 with SMTP id u20-20020a170906409400b0085409561438mr81019847ejj.25.1674666675669; Wed, 25 Jan 2023 09:11:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674666675; cv=pass; d=google.com; s=arc-20160816; b=dH5scA0ZePaRIRZja3RL7LB/dQDmV6mZK45pqAkebRjZjwtGZI3I4yU4MpllJ1A3dw /+SwwyQrglEffgcse7LbV/IxsOf/QGtULfeqCOwBqZFOcp1d3OqERxUSvHJOqXW9KGf4 N3l8eUZZ+udtE43ZSpk/NC39mG+P2XAsyVs9Wdq39WPSCBYszQXaT5UxtBT0RxSQSGjX o5+mhgt6Vr8KmcDl2JyuPDBwTlwx6YRr/ehJwqG9v/IQpou6ZLahk8FiSqnT1CSZ9e3l JM1JzoDS3iibY3LRygFY7racs8HD7Yx4gXmON6ggN0k6YRV0izdFFai4MuPwdCG8W5rY 4uGQ== 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=WtlzYE6hM1ROsmIkU6D5BBeOZTR3jQ1kLi1nmizsNy4=; b=UzUYoLeHcHZGfz3ANyDrFXV+tgAoQzom9/ojsmWd55GkIN6Q0rv1G4p/GNgDIEG+FH 5huORL+Ig/B1BTv/k5Z4GqBWC3uT1l5KKHHvqb582+ZWI3oTBSKzgeIjwcO5BYpcwU1S nqWILvxsr/OvfhwQPotDOl4mtxcEanQXCRo28H/oiIiMmIMgIRHgmEDIKmsWcPnStdmU VUwQB64/00BOXU1r5Ci9H0IbqxWmpX3BfH6LsJk4Z8dqf2wPwaIU8IO5SSpjlGG1hkjx XQV8foAC7YoHNcXmK9wlDMZA1Rlx9azDumlKA5PKnGLpfB7A7F2+cnNOqZqnbXKyungQ q2ZQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="qrRs4T+/"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=oxZeFp7q; 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 fw19-20020a170907501300b00840f80a0b03si6801569ejc.118.2023.01.25.09.10.49; Wed, 25 Jan 2023 09:11:15 -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="qrRs4T+/"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=oxZeFp7q; 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 S235836AbjAYRGx (ORCPT + 99 others); Wed, 25 Jan 2023 12:06:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236073AbjAYRGo (ORCPT ); Wed, 25 Jan 2023 12:06:44 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D5655976C for ; Wed, 25 Jan 2023 09:06:28 -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 30PFPxlv029537; Wed, 25 Jan 2023 17:06:08 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=WtlzYE6hM1ROsmIkU6D5BBeOZTR3jQ1kLi1nmizsNy4=; b=qrRs4T+/nah5RKC3ZXPKGruglhSCbp4MPkpevczlMX7d+xBbNBjxcnFhhpU13k8msE8h x00wX1ycgaMKOSUQg83qGy5WbtTx6tt4Y2G2zyDLJFhRYQG8TNwBiqlv/jhMWo9JNMBw gqJ2xgoYIBdGj34/LqftAOWvBJbLzAik99RsqwacnH8FoihhkRXKaWK/boZ1IOEVWcJb uDjy5n60XoK3dDsJxNEM+okYd8A4PqeyBIG4Z8P0EA5QOyB2M3nhdwPZo0wVeuzDNINi jgixy3nWhWtpSKgz+XD9COm66NS7PlDSTJIieL1YE1DZzEvxOl3cp5M80CRtdWtV1cTh HQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n86n10jrn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Jan 2023 17:06:08 +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 30PG4N3F009387; Wed, 25 Jan 2023 17:06:07 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n86g757r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Jan 2023 17:06:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EanRIY8s+MJm7mY4NfGK1jfY6Wy+3QfQEqfHJjXu01CRJ7wfdJ0nkDJp+RVLMGaV2YPJ3mp77IuUpwqDBxUSQI1v488w8oYgfF1OxDbFG+y5wP6IEftRYs3cEQVqbU7gCcEwrsl8uuVNhOae4l1dOcYi0MShwm+XAGG8M0JY82pax42Y9XMi+qIXewa4VE+MvjDEKcaAFv1vCVQZqEM1HFPgdPFKT+03qb97RaQ2VHNZz6TgNAxg4OOFlf8x5hmYBAVL2lBpBbnHIPF1MCgv3x8QX+IVLXD/sYhHWxKsYx55ci6tV0zfwyFAS2jyxdRwtujLRO1li5a4+E46kFrWLg== 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=WtlzYE6hM1ROsmIkU6D5BBeOZTR3jQ1kLi1nmizsNy4=; b=oLTBs3rAtqrLZh0cG9FWdbrJxTBvdTLwaaQJ82AE2cpW+xm+mhEVoJGIERov7V+wgWQyJmD6jO2JfhPiqZRZUuvUECahRYIz6tacKNRKVBco8D0YuH2giCIMeZDAjCuj6eQuDyLGOwOOxdEfb6s4WgjFZX4quqN4YBEqv0zHa+q6DbDwERKDgxprAxNhfxOYQVrCiuHuQkbuxhkbpWVXVpC+J3n9cwXCVpF48taf7hgpZuzZzRS2NTXNGas5cc84r0aQ8LNOy1xGJ3DKz25aI9Hw0aepVt6tYNddOTrTE5LTAuQHHtVsWyiwBNQdD9MY8ueij5ddj3FnPG/yg/VhwA== 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=WtlzYE6hM1ROsmIkU6D5BBeOZTR3jQ1kLi1nmizsNy4=; b=oxZeFp7qZYnhSiLhSuA909YCiD8VqTYOSNFBtsxGwRplwRhaj8/PLBA8B1h9KhigOoNX7rysVwAgPHx8JbLyekEmReGz/3+Fm4OAZuqfY/WQtJRYy4ERMrwrqB97TpA+1I+VWVCxw5kezKOhSMTkaqEerRkmo0aTv8dwiCd0688= 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:05 +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:05 +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 7/8] mm/hugetlb: convert hugetlb_wp() to take in a folio Date: Wed, 25 Jan 2023 09:05:36 -0800 Message-Id: <20230125170537.96973-8-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: SJ0PR03CA0233.namprd03.prod.outlook.com (2603:10b6:a03:39f::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: 7c7da166-c20b-4d74-a41c-08dafef67199 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RANY4V4l3gzGdxcpIJR8HhpGcu47zOXGBLvYbZsOOx3qt/3oFCmY3jdwbn/ALvk/1w3mt/UCYqHQTq8uYlUEH1VS6defQ1lQYUUpL96xEqU+hbSus/p+5N8Bt4VCiBZ4t3FvtkJ8T7L9yZOvE/sUfCNrH7G+z1OqG3Nll3R1X6fjV64ogIw8jqgZsu4Aicxz0bXWQSG6jksQVXPw/TGJ4d2cOElaKynQVktZjdGDfLCn9rYeSHfkhS4vaRMpsVMyHfhIDRJJir5xheaOo08CsaYn5l4j+BT1pVdpb95S+G2mSu3KAXwh72jojWv11xT48sB3s9XVMDtiJ2RJccEYsIdSBEQLqREcrORltfKuTVeXs+tMNV9D4Unh3d18rpFXQmm/IxsX+zIVYtn4nQB9s5Re+ryW9ekPsQ+ut92kh3UHrUK2FYyDSGf6MYPgdy6qNSbqc25sSq98NLH9RE5XIKqRW+1ZWUxhCkRBicz0uulhsUTcen+Wh9A3CBPYwMvfp3uwvrN42OHhygpfc5hHlC8TcicmYrzmYEg6qxVtCL0KB0DavBhyNS/kiEHGhWUqgylEnA3L8axEp7xgi912kW8SMNnDxHN0Sf7Zi5Bn/RjIkA33mGrhNBO+1N8bw13WKsR2Kx+2XUZG5MmBvKpBiQ== 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)(66899018);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SgFEj/uxRRUF3FaT1abQeHHo7F+41oc1NhAAiieXOLV1hXnZ2OmOtl/3rwsKgSB5xKwJPJV0pU2XtB4b3F2MV99W4I84N++hpvgFtNVvGybWIieL1ZkfiMVR6+dl5P3xz9s0L75BJUeLMNdf8ie5c1eNbrov1Mza8t+HPD3FtvQywaC7jNF/v/LWMJGQcbW5Rh9SaDWAd2Ly3Y0iffzWJvLd2OZ9hTBijLyHYR1ryzr8XnPpnAgJT7ef0V1yyFHQUV318yZXS5h31PFlDF1iLzOpWRugHO3mG6UlDE7VUP1EwegoD5KC3anAY8ASVtRKhIF28Qq6R/FD0DxjJhfe4hdclGv+NAH7J3t9vzleM2z/CbPXmrFeMnvJ1fA0hdCk9nqR4nu2pRXsT2fnn8JAsHuLZe4jVtnHzf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/9rAD6ox1Iqwgj2GJciV5wr3wJOlWZnhzQBllG9y3hfdFbcjrMwKqI5DTYdJ2gOueOgREICWvaQ5p3aYEiwRgadcnckZXGf85ZUD7LfKANO3PkjiPP0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c7da166-c20b-4d74-a41c-08dafef67199 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:04.9850 (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: oGzF/uRCxv0B4b3I7nDeJXnpr/DRe17aYBUEK3O/PCA4UlcHuSPtNgpftEN63psau/WC+Vvz8RIQJTbwxc9YlGE1leNNZWcyEn5jJglTIko= 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 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301250152 X-Proofpoint-GUID: H4MkHNqU6PYG2fkN1Btuektho_ZnFs5T X-Proofpoint-ORIG-GUID: H4MkHNqU6PYG2fkN1Btuektho_ZnFs5T 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?1756015283709490386?= X-GMAIL-MSGID: =?utf-8?q?1756015283709490386?= Change the pagecache_page argument of hugetlb_wp to pagecache_folio. Replaces a call to find_lock_page() with filemap_lock_folio(). Signed-off-by: Sidhartha Kumar Reported-by: gerald.schaefer@linux.ibm.com --- mm/hugetlb.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ab30f8550631..b6cbba105ffc 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5472,7 +5472,7 @@ static void unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma, */ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *ptep, unsigned int flags, - struct page *pagecache_page, spinlock_t *ptl) + struct folio *pagecache_folio, spinlock_t *ptl) { const bool unshare = flags & FAULT_FLAG_UNSHARE; pte_t pte; @@ -5529,7 +5529,7 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, * of the full address range. */ if (is_vma_resv_set(vma, HPAGE_RESV_OWNER) && - old_page != pagecache_page) + page_folio(old_page) != pagecache_folio) outside_reserve = 1; get_page(old_page); @@ -5922,7 +5922,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, hugetlb_count_add(pages_per_huge_page(h), mm); if ((flags & FAULT_FLAG_WRITE) && !(vma->vm_flags & VM_SHARED)) { /* Optimization, do the COW without a second fault */ - ret = hugetlb_wp(mm, vma, address, ptep, flags, &folio->page, ptl); + ret = hugetlb_wp(mm, vma, address, ptep, flags, folio, ptl); } spin_unlock(ptl); @@ -5985,7 +5985,7 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, u32 hash; pgoff_t idx; struct page *page = NULL; - struct page *pagecache_page = NULL; + struct folio *pagecache_folio = NULL; struct hstate *h = hstate_vma(vma); struct address_space *mapping; int need_wait_lock = 0; @@ -6067,7 +6067,7 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, /* Just decrements count, does not deallocate */ vma_end_reservation(h, vma, haddr); - pagecache_page = find_lock_page(mapping, idx); + pagecache_folio = filemap_lock_folio(mapping, idx); } ptl = huge_pte_lock(h, mm, ptep); @@ -6087,9 +6087,9 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, }; spin_unlock(ptl); - if (pagecache_page) { - unlock_page(pagecache_page); - put_page(pagecache_page); + if (pagecache_folio) { + folio_unlock(pagecache_folio); + folio_put(pagecache_folio); } hugetlb_vma_unlock_read(vma); mutex_unlock(&hugetlb_fault_mutex_table[hash]); @@ -6098,11 +6098,11 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, /* * hugetlb_wp() requires page locks of pte_page(entry) and - * pagecache_page, so here we need take the former one - * when page != pagecache_page or !pagecache_page. + * pagecache_folio, so here we need take the former one + * when page != pagecache_folio or !pagecache_folio. */ page = pte_page(entry); - if (page != pagecache_page) + if (page_folio(page) != pagecache_folio) if (!trylock_page(page)) { need_wait_lock = 1; goto out_ptl; @@ -6113,7 +6113,7 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, if (flags & (FAULT_FLAG_WRITE|FAULT_FLAG_UNSHARE)) { if (!huge_pte_write(entry)) { ret = hugetlb_wp(mm, vma, address, ptep, flags, - pagecache_page, ptl); + pagecache_folio, ptl); goto out_put_page; } else if (likely(flags & FAULT_FLAG_WRITE)) { entry = huge_pte_mkdirty(entry); @@ -6124,15 +6124,15 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, flags & FAULT_FLAG_WRITE)) update_mmu_cache(vma, haddr, ptep); out_put_page: - if (page != pagecache_page) + if (page_folio(page) != pagecache_folio) unlock_page(page); put_page(page); out_ptl: spin_unlock(ptl); - if (pagecache_page) { - unlock_page(pagecache_page); - put_page(pagecache_page); + if (pagecache_folio) { + folio_unlock(pagecache_folio); + folio_put(pagecache_folio); } out_mutex: hugetlb_vma_unlock_read(vma);