Message ID | 20230119211446.54165-3-sidhartha.kumar@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp552100wrn; Thu, 19 Jan 2023 13:25:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXvKiSjhz6ANLloy9Gxm62W9EQLi5TvWTuKzWr9lEILkHEQFKddCKKE1ov7zdMy/OppZ482g X-Received: by 2002:a05:6a20:4c16:b0:b8:6371:9abf with SMTP id fm22-20020a056a204c1600b000b863719abfmr11501857pzb.27.1674163499693; Thu, 19 Jan 2023 13:24:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674163499; cv=pass; d=google.com; s=arc-20160816; b=TL0zxv+4etN5IFaTC/6ms3umqRx4AWL96xsTZWzTykdw+3Q98vxlVWq+xKo6OZhwb2 5blgbDwjRkyh1Xpso0AAZiUqi4StTvYL+VUYkcc2VkwRb+9emPFbbJCOkbf3F/kEMz13 apfMxZgslW77kgUxaMv3/DrGCKkhxxd69ima0oZ2mzzG+hstKpuumOydWyptpO7HY1kM K+PUMjj+YBEzzywCnCcdsBR8iQ6ocCsuG+Qfmat40yKkTtTHkEfUcvaphY7pKm3u9S8T DXg+ldmNphZzJn5+NAekYtBfG14LCPQq1IPJXhVW6x+FQ7nPW3hakLagJXPUf+Ehi87W jdxA== 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=zsPQG8fDL482u8E62UY54HDAQGMVSvhN1uuGsS+Bkwk=; b=xIhujocXxZNC3uwfLhyZqvpYyXHAocgPRBv6gPWfLAtw9/wKlq3ywgCiCyP/0H7vUC Utrd2Mw9GhhRZYJfqinMlTpvQxuLyb+247eXAR7D4tJnvWj2ucBpaejWuODBy8TCEJv0 SrBnfEzg9BbKi1z6gJ2oZLWxtVHxHQy80LsIih6k7bUtAn4YpIn2qiEDoweQ9tIlWGE9 Gsg17b5+i9X+mWIbeHf9T6h1lMmyO4sRDw/US8+biOSw7mGaFugb05Mkt3wTfN2+ngn4 AF89Jf2nefUoSIkDRuO9RR1yEoNTbrY8jAcqOBYcAm992wjAuvTpnFUQsY2oO0K/w/Nu f+Mw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=QVzMNEdR; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jxPsxp1t; 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 f126-20020a636a84000000b004ce5301ee14si10805960pgc.763.2023.01.19.13.24.47; Thu, 19 Jan 2023 13:24:59 -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=QVzMNEdR; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jxPsxp1t; 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 S230002AbjASVWl (ORCPT <rfc822;pavtiger@gmail.com> + 99 others); Thu, 19 Jan 2023 16:22:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbjASVVz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 19 Jan 2023 16:21:55 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36C1930F8 for <linux-kernel@vger.kernel.org>; Thu, 19 Jan 2023 13:15:31 -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 30JKx5v1027492; Thu, 19 Jan 2023 21:15:06 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=zsPQG8fDL482u8E62UY54HDAQGMVSvhN1uuGsS+Bkwk=; b=QVzMNEdR8NrPY+FPHxNJnZQoiFkBOOHMrdgYk5KLGMZ0rfGhA7ciV+mQlz8rmOYPEP46 rr/zKF3RJOi0cUdo23K3uUXhnBK0rPYTtve8gU8S9ci37XMWgKK5eUsjYXlcHf/Udag7 GJd/ZwieENmNBUl08uxVhg0+VnjHlxdf0AWW1Dp7SS7YBHkd1axa/1RU1EqW1oCI6Exz 1g1R49ir0FEJ2Y9pMASzAZiOjCgrB/coF6CQsiF/QekQsZiN2BUg3Iae4rLhpJ44rPNJ hPfJXcHpY1/QzmVRsFUPDgNtQcZFtU3NB7fjy5CwKYGPJjCWN/uwZQxFUEndRong7TyJ TQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3k013at7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:06 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30JJavLs004672; Thu, 19 Jan 2023 21:15:04 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2049.outbound.protection.outlook.com [104.47.74.49]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n6r2v07ej-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dSDzYNIs3ono7piW/ia5OI2GrWBWOUGrObv6a73SfGWPl2o3WIcziG8OJRdfQgIprypxjY++ZH1Ys/GwJ7JNETuonjdxKKDOpwZZfKkvIj4UCnrlEbPUCkym9qt8sC6gdPxfSDjXGz7mJCc38QTr4NOXBeplr9I8uW/ABcO+AoKkKXy5cQDoeXalxNh20e2WFwkJtzlAdCW863IsNorBnfEbKPSJyPT6AtbijUtr92b5b4JGmRHoQu+Q7RALpFB8hDvEmWF608g/nYUrY84dvevP/LT5lTPL4OpbXtW8Gp86eWGeBsQcfxCqeF0nFphDO47mSJaDDkgRHd0q3qyURA== 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=zsPQG8fDL482u8E62UY54HDAQGMVSvhN1uuGsS+Bkwk=; b=VkrbmEC/T/6JtjclRUkORw+5/xeZw/hDLabjbNjmpu6ZvNTFeGdbg4J/9Vk7q5mCAfd3NZqHAi47KQ0gDHFqEVOKcGjaqwWaGi6Pvo8Qi1pVTzVRqFm/1SzkarKDRWOLX/LVf9riUbHt46NX5IvZjdXy6tujzigyC04lUqRowBQXRyvIG6utb9FLyHCPn7+cWVb+QPfx57/pETxaj5iaWuZ1QaozpCQhs/fsgQ3cTHFmgjlShR56XZlRo08QWDtCvVrhSEGvBkeVX0QEg3qq5QE2499V+akuFswCXhmR5y3V7Z6BoGRuNMMzklJasfd5vWFG8pVxfnEctc2atPk9HA== 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=zsPQG8fDL482u8E62UY54HDAQGMVSvhN1uuGsS+Bkwk=; b=jxPsxp1t/+kZt0j3C+h9jUmcdkBabhEJLJJFSNZ7te3nhwTVmXtv0chHb7xYIIZrAFynKXFBe9BGJ8uAhIdzUaQ8Vq17lhI6NWzjFo7z1pVHpTsLjl403WmOcIE1427e8blpIdzQgzp1M8a1usTG3jEcW47BZYKHH2v5oigSRG0= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by SJ0PR10MB5600.namprd10.prod.outlook.com (2603:10b6:a03:3dc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.24; Thu, 19 Jan 2023 21:15: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.6002.011; Thu, 19 Jan 2023 21:15:00 +0000 From: Sidhartha Kumar <sidhartha.kumar@oracle.com> 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, Sidhartha Kumar <sidhartha.kumar@oracle.com> Subject: [PATCH 2/9] mm/hugetlb: convert hugetlbfs_pagecache_present() to folios Date: Thu, 19 Jan 2023 13:14:39 -0800 Message-Id: <20230119211446.54165-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230119211446.54165-1-sidhartha.kumar@oracle.com> References: <20230119211446.54165-1-sidhartha.kumar@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR05CA0003.namprd05.prod.outlook.com (2603:10b6:a03:33b::8) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|SJ0PR10MB5600:EE_ X-MS-Office365-Filtering-Correlation-Id: e34cc9b9-ffe2-47f9-d7af-08dafa623942 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qy7x+wNVZ50XB5JrxhxodaiJrWso3rgp366E4bqEOwLQg/fKsZxLfQ/L6wLxBhdhaiARmQUf6UCGoiKnn/pShohT1hP/H9ZYTl1JzsQ64LTWv6kkiDp+vlhnfSHGExQtv/3Y/jhRxLVTi8mYDzRzJ3d0LyYEHuEVchcXkS+E1s0/Y29Bw0Gj1gehjx9xUAJFh4lQ5VDzqscV4nsBOEroXXWibL7Yq4uTaSCTJ8DagKdBhO9zQWODRz1khux7oyCd5U9z/9CchQMjUpE2obduWFI3IALyJRgqF9czgbNKRm15EFTxc6IcYlGe+S1K18nx/dtVatasetKauLp/MdSZP9b5F+yYFSSuoLcsTXdw+9vpcZxjr72fBhmcKGOCn1lgTa1XwQnSNj0TSVaxB/A86s5RdJKxAAR+GgKuP903XV/aJ2gxrceaEd0z5i1Fy3yHC+zd1GPGuW2tejhhCaD8KLFV3caI4IP0HegVF5xMHKjD49DjbmGRRxPAscEAUGkaiaAE89CwlUq8OfVkDVzjt0Ne60VVYTyy+49PM7jT8kUUJ/rStSO2O6Eu0b2qJQKxe9A9+e3pENCykIZfXGQFdprlK+jSWOokLmaiI5KwLmwrgw+TVZew9lCL8gdlmZn9KxYVp/HEO5ct0CMQLEKj/g== 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:(13230022)(366004)(346002)(396003)(136003)(39860400002)(376002)(451199015)(66946007)(38100700002)(66556008)(66476007)(478600001)(8936002)(44832011)(2906002)(5660300002)(4744005)(4326008)(8676002)(1076003)(41300700001)(2616005)(6512007)(83380400001)(186003)(107886003)(316002)(6666004)(86362001)(36756003)(6506007)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P25M3ehEgCDwDYwSFs2PBXV/efuxjWJIBydC9Yz2rrG7SCXRHs8tALod2n28+pQSf5N6vO+OIzOc85J1t3uMHM+Bph0zXAphAMbxUvLfotbvGgFSzifBqdOLtyUXhgsYYXz33br3QFAdqe+MPOpnJe2PTd59owsd0R1BDAZk3PgQMgyTlcBdAuzPyf+qkDxvcs0/9EJP84nsOmLmcPItx6HMoHW7sm+nhhiqkPDH0NzzTyRzhKLfIexYbBJVTyOix8Meq/JwIB8DKYiYLABuPDsLAZ0Pl4r9LnOH1fV6UKD75Eb8GPq/lmptC+cdS0kZPDzZGCl2GA+QwctWjQjbMrkWfAyKftbrsPJCzgM3Olone19e3za61pylyAkUnjJ1lpg5p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TZpBEOt0kI8QGgNtmEwBsiNK39PgcxQE7C3Jige5qnT3z8ROzIHT+32ipFoL9ILAMMr+G1jzuoOhRacEU4vkHM0SPK4aQpOldgautGac9BPLsAauNc1hcG0W994OEgwWXl+9kx8AzfQizluRcogMvDnwK8Dcsk0trDt3fGlprPqqWXvkTbwcuQoZ6f1 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e34cc9b9-ffe2-47f9-d7af-08dafa623942 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 21:15:00.2017 (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: 7of99WqYH2u7RSI4R6eDcS0eUnzuG8wTfN9fx1/PhVmF01jFiriuSQvDlV0FY7gK0FYdAkYeslGT14AeMVSJf/QncAzShYbiktIsm4wsAx4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5600 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-19_14,2023-01-19_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301190178 X-Proofpoint-GUID: jsivQA4vrPT8-DTqgdFWT04JY3JksEJJ X-Proofpoint-ORIG-GUID: jsivQA4vrPT8-DTqgdFWT04JY3JksEJJ 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755487665976629589?= X-GMAIL-MSGID: =?utf-8?q?1755487665976629589?= |
Series |
convert hugetlb fault functions to folios
|
|
Commit Message
Sidhartha Kumar
Jan. 19, 2023, 9:14 p.m. UTC
Convert hugetlbfs_pagecache_present() to use folios internally by
replacing a call to find_get_page() to filemap_get_folio().
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
mm/hugetlb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Comments
On Thu, Jan 19, 2023 at 01:14:39PM -0800, Sidhartha Kumar wrote: > +++ b/mm/hugetlb.c > @@ -5653,15 +5653,15 @@ static bool hugetlbfs_pagecache_present(struct hstate *h, > { > struct address_space *mapping; > pgoff_t idx; > - struct page *page; > + struct folio *folio; > > mapping = vma->vm_file->f_mapping; > idx = vma_hugecache_offset(h, vma, address); > > - page = find_get_page(mapping, idx); > - if (page) > - put_page(page); > - return page != NULL; > + folio = filemap_get_folio(mapping, idx); > + if (folio) > + folio_put(folio); > + return folio != NULL; > } Seems to me this function could be ... struct address_space *mapping = vma->vm_file->f_mapping; pgoff_t index = vma_hugecache_offset(h, vma, address); bool present; rcu_read_lock(); present = page_cache_next_miss(mapping, index, 1) != index; rcu_read_unlock(); return present; No need to get/drop a refcount on the folio. It's a bit similar to filemap_range_has_page(), but the API is wrong. Maybe there's room for a little refactoring here.
On 01/20/23 05:43, Matthew Wilcox wrote: > On Thu, Jan 19, 2023 at 01:14:39PM -0800, Sidhartha Kumar wrote: > > +++ b/mm/hugetlb.c > > @@ -5653,15 +5653,15 @@ static bool hugetlbfs_pagecache_present(struct hstate *h, > > { > > struct address_space *mapping; > > pgoff_t idx; > > - struct page *page; > > + struct folio *folio; > > > > mapping = vma->vm_file->f_mapping; > > idx = vma_hugecache_offset(h, vma, address); > > > > - page = find_get_page(mapping, idx); > > - if (page) > > - put_page(page); > > - return page != NULL; > > + folio = filemap_get_folio(mapping, idx); > > + if (folio) > > + folio_put(folio); > > + return folio != NULL; > > } > > Seems to me this function could be ... > > struct address_space *mapping = vma->vm_file->f_mapping; > pgoff_t index = vma_hugecache_offset(h, vma, address); > bool present; > > rcu_read_lock(); > present = page_cache_next_miss(mapping, index, 1) != index; > rcu_read_unlock(); > > return present; > > No need to get/drop a refcount on the folio. It's a bit similar to > filemap_range_has_page(), but the API is wrong. Maybe there's room > for a little refactoring here. Thanks Matthew, I did not know those APIs were available. Perhaps just use page_cache_next_miss as suggested above for now. FYI - There is the same pattern in hugetlbfs_fallocate() /* See if already present in mapping to avoid alloc/free */ folio = filemap_get_folio(mapping, index); if (folio) { folio_put(folio); mutex_unlock(&hugetlb_fault_mutex_table[hash]); hugetlb_drop_vma_policy(&pseudo_vma); continue; }
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 849206e94742..04cbdf5025a5 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5653,15 +5653,15 @@ static bool hugetlbfs_pagecache_present(struct hstate *h, { struct address_space *mapping; pgoff_t idx; - struct page *page; + struct folio *folio; mapping = vma->vm_file->f_mapping; idx = vma_hugecache_offset(h, vma, address); - page = find_get_page(mapping, idx); - if (page) - put_page(page); - return page != NULL; + folio = filemap_get_folio(mapping, idx); + if (folio) + folio_put(folio); + return folio != NULL; } int hugetlb_add_to_page_cache(struct page *page, struct address_space *mapping,