From patchwork Thu Jan 19 21:14:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108771 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 5D2CAC004D4 for ; Thu, 19 Jan 2023 21:15:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF32E6B007D; Thu, 19 Jan 2023 16:15:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E7E1E6B007E; Thu, 19 Jan 2023 16:15:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C808E6B0081; Thu, 19 Jan 2023 16:15:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B1EA96B007D for ; Thu, 19 Jan 2023 16:15:38 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 78B99AB3DE for ; Thu, 19 Jan 2023 21:15:38 +0000 (UTC) X-FDA: 80372805156.26.D26A56C Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf16.hostedemail.com (Postfix) with ESMTP id 2A9A9180010 for ; Thu, 19 Jan 2023 21:15:33 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=gYgoXoQS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FMl+i2cw; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf16.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674162934; 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=GHxPmvKVHX3NIeUTQKvpfBxCyfCEIpn1BvmhiZqKnxo=; b=gDdeQl3Lrnth0CSf5DDhlpotI78AQMLxD+3cp3M3ABmhNWJTEFnB4gwexSH0/nUTu7tuQ+ sx+0pjyuMmfsSYUlLXuJUM4zd6Z7c6ge/dA5v+WR12BruSR9zvkH9X+d6boKM6JY2dGZ/k Kx0k5dBvnhh83UaXgKjfPwzj6jVe3uY= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=gYgoXoQS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FMl+i2cw; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf16.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1674162934; a=rsa-sha256; cv=pass; b=vb6ac6425Xznwirxb+OrsYFfBNDICxGWt8W8NhOUxu5F3fXrXY9hE1cJ43QSgW1eA4x0+Q RQVbV3LGizFqM53l5FV3XmX+acpdKA4ASAGGqzNdUFNMteevypiD0eolyAJIhH9IlG1E+6 0Jh1ifcTCk/7F6dTp28xbVihnfDBC18= 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 30JKwkjO010065; Thu, 19 Jan 2023 21:15:23 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=GHxPmvKVHX3NIeUTQKvpfBxCyfCEIpn1BvmhiZqKnxo=; b=gYgoXoQSH7r/euiZWS4oPXh5s+c5OofsU106xRjb5P27nd2+V+1uQjFVKm0eyuQczNJK SzJKTiDPqwq6YYNjGJe1TOy92fuh+Tee3U7kf5HTWM/LpIy8/u7wYezja6ulx+TNDSt8 Nv/zc9EohjXEY2d9N6xTFQBzImcSqZqCjirdmEDmMKMhPq4pIgUC6MtExRyC868yucer xu+e33WE6FfEJTWmERRUcGwJoZoFbJa3D7oqrg0Yx72wHJY2lszrLWzxKIzKeT7hTKcR AQyZn3osythOsNG61ju/X4dk5LKEVwp7hj5d3GSntFMUvkrsWQlE/iraKhS6qmMExREe yA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3medkdvt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:22 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30JJZFcA000860; Thu, 19 Jan 2023 21:15:22 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2046.outbound.protection.outlook.com [104.47.57.46]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n74d1s0h3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lVbeGsv50Mywd/K7OJ49cX7buOM8ioVvcppnKO7xM06rJO1kvD5x4wZI3kcu9E3WzHJ3Z2jDYvQOn+yT+F6X0S/ZIz+3lbkkVTMTsQp9U3LznnKG/SZFe9pqO1j40R279zFaRA8qFY7qEoD4np4oi8v9DcurgF0VhH469rKpEOy9RqYXh4CgY+sIAa4gCpnHI9JfvsG6jq//LsGo5SS7O5KWTarT7EiNBzKs7gZoYIEPg+tKHjM3CSX60Fwy7rc3sZepvzCY+jPIAE76Ihmdf/YC0f/MgBI+gcQkG9IKep269w/hbs7osT1daQtg6GbHl0gKcz8UehT8rTBALZGxag== 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=GHxPmvKVHX3NIeUTQKvpfBxCyfCEIpn1BvmhiZqKnxo=; b=K6YRKq9faOebPAycuIJl1bD9B5K7K8m9plxC8QtsvZH4De2v1t4fnINKLxcZVwodlqmDLNsmXak0zgczYVo0V84cv2EnHKXMP8Kza5pnEI9YtwNnkpg4Ycr0wtJ9/hbpZdLnrC6lIcDzCKr63PZZAitPasr0qCqmYq4PHi4eAJB9zYUpcM1f4PSdTyyqsCiBA6w1/PfhwWBuDdunak7Q90f2rPn3CSygK2hAfqz50rXNSfR1biapEVhcWXsgbvmMkw7oQKXAhQtYRMYXHwDTYm/KTptF9B7DzNXJRjEgpTQwY4CJxrwyCHi4zbc93WCpLVs0BWtOYDQUQE+tAFfMVA== 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=GHxPmvKVHX3NIeUTQKvpfBxCyfCEIpn1BvmhiZqKnxo=; b=FMl+i2cwH59ZYP/hVFViBUAfLoewb1Z4JkfW0r3PRxa4mZZE1kBf9jI2G5nut+yZrGpOY7bnaGYDJDzVk9wpYGxLUaJwImURE/FVccObmfixzvbgExv0xJlz2QsQiTca+EuSboW1X3oeq0gSKxa0aRC13OwJR89JptokQrdJqMU= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by BY5PR10MB4148.namprd10.prod.outlook.com (2603:10b6:a03:211::19) 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:20 +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:19 +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, Sidhartha Kumar Subject: [PATCH 7/9] mm/hugetlb: convert hugetlb_add_to_page_cache to take in a folio Date: Thu, 19 Jan 2023 13:14:44 -0800 Message-Id: <20230119211446.54165-8-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> X-ClientProxiedBy: SJ0PR05CA0027.namprd05.prod.outlook.com (2603:10b6:a03:33b::32) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|BY5PR10MB4148:EE_ X-MS-Office365-Filtering-Correlation-Id: 45c14585-b4ab-4e86-fe06-08dafa6244fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UXrgnV4XBQKY7vcaJu7VArq8oNHiY1kLHPKp3aNTYsUuP3daXmVNrVas3kQHOenYswfXRZemWHLQpRnC5RmRo1IYM4KhtG/e+o9aVvejs59nUcWhvaWYi30TrKZ9WMYUYMkhZi9dPjDy5o/WSzsQrkBRrWUPE0/9bqwrfSDWEK5tvxkeX5oCgRh+6Dp8WmEEZ3cYAQbq0C+354IuH00hmnxtCN9A1ei2IhwhU3bvteoS0n2OPjqEsmtiaDX9U8ij8Vv5NPzdIX0d7z2fQg0Pjy+PTC0yamoV6jUuKSuQqoSCk3WAqBVOxBuQWyREWuk0J1MA273Rl/dkzw0KAQKshQRQ18ajy3fX9B7ERkivUfVAt5szRF3L74Q0TOqkLoi+jNH/5E9P4qnr5ixBNMmML6HwFMyH//WLe+3AjaFcB9jbCUn6pe83wVLy4xB/T4MTOEkOsYMYpqXs8m77z8tQDHKA3svLWIaJBPQXvWnj+HZ9VByAXE3uDK8jmXk7V51Imo7PDCGwDzga1zKuiy0OA5F2t1eUGfaIUQNTLtpg99Opel0GiKZiQO2yic5EcpCnsAIiXryUdbygJ2yiuu0qDeSH+rIe2crL93DZI4j7iotAD87oHapW++oYp+3a08JfIyytuKReudDONfrRej5uJw== 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)(39860400002)(366004)(376002)(136003)(346002)(396003)(451199015)(6506007)(5660300002)(86362001)(66946007)(66476007)(44832011)(2906002)(8936002)(66556008)(38100700002)(316002)(107886003)(36756003)(6666004)(478600001)(4326008)(6486002)(41300700001)(8676002)(186003)(6512007)(83380400001)(1076003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5lVvvUCyZ03KMSv32MLtYbA+KFkC0XLvSf7HMvLVCW2taqt9+27oZ2/ESufQtGkBNpOQE7UjzKo7zQkta5DLtlZQz9T9NFJsQ3s9UcI8oqreA2DPU3oZe9q74fD9MKRiwuDa/tjw8xIKC9IOLcdmtquH9yKS4NnI5Vwc2hmeZLWnW+qbGoEc6uOfEAeO6TeK6yFG//g9uvc7tt3Zk1OjfglsieJRStrWQSfRo9iBQ/l2eVcILU7LtdHWQSMvGFzAJUH1H2tT8Ii3cCZMK8zHDyn0vPDt6fsmAZRFmglTr9JRWDB8gciyzQ8kN6eiASlE55zrsXe+9wkfh3IutbSqMQRhOZPz1jbwbjK0HhlDqTquVJli3+ra2v5xD22D/S8TAn3muaM2aI+IiH5jlmowZWI6N6j3LPxQVXFKEuj90mQWpYWjknF4+qAxc8B60d3EnhZii5prKMHOEIsnbosoemjbId+RszU/DakWrUbY7QPrSd3GzVCU3WZEq1p6oyEsfiqdRT7HT0OAWmOXLRpufAbsVzFVYB0FyVhRF5wy1cwlyagLubLnGOa0M/ODXqr4nEznf0COsdaAuzjGoauxpNg/xVffwSFKoMj4sUGjav0m9U2TE6eepSxXn5/cCjqGEN3SkQ+6Ns57NR7v1qmgEKqKvys1S/G1Kp/M26/ZTk0oWynCjfsx/9lWyPK3wl5W38ABQD7yEjJGupw9UbC9VM2u7ep/nxap4vIc07jFR9wjjPH8hpuKtKyAT939lFF+WuZOZkEKY0mhGwewh7Pb9gJdCJJ6vJ/s7Lx3LYY4BwGvcsIhxgeV+Gssar+hEe2uAUZSFj0HQ8sUpFeBj0VVmFyjF2ZJMqBXAgJMYQ8894pIjKcdssFm507pl0MFyK4wGJxRGVRIk8DkxDNnhf9gulKo3LySSM/zk6nv7h9Pxs5d8Zf7rtN1qodIV0BmEiUrc40Vq91X//4Aui/dcufWjDiH3nCfYCu6XsWnr9UCZ2FRdAcn++UFQWlK6qTlimo/geqNaAC9nCntOekEF3qwrzj9qNSsgXxGIXsW8WKF1qh93VgeaUPSxSI4twkoKKicByoULRwTJGwsYYjqKzmHSGiPuZWytd8P23GDIN0BL4SaegxZtlYNCCTVf90tF5ZQRE9cacsxY+t66qhaU714JefWdCXIRjT6DTvEE1y9mO4m94OvQEseyyjCPZ+Fk0oVOZhLhDXf3YreTPgqRVdHWU0LS0WF3g3EQKcl8gcZB9COJ43BdJ+geqO7xRKd/4unknv7iykdNpGofPNcGyOFCqO2hwPga7sCl7aJWH+MFKeIMgZog+dkfWWO3/KUsF/woL1waFQcsbkANff/3gs8qKPhYI0ivgUN16/7aYo4kGo3FVDDjOOrlFT0DrcWqvq2doPwVObSIOYVWRobf8Crx9SsRWbL++PEZThMyA4UMRQCV8zn6RPV4rdJuyWRtnLUe/qHHqPBMzGIqq4PFSUB1oKqAazi/uKpetpGySj5F15eW04A8R/PsUaYxyCIggw+OjvaRDJo0cwadNW0/+25jTGKEgXTjPa10yH/KyBmBUAqriG9RBinjoMe9u2H5BcR+oBBEHbD5A7cXtSGwFhBPifemFPR5tbU86aDBm2ZynNsBMiW66UcF2FMuacOrpWyKt7BALwl01jKPybtlPhu/g== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: xNh26DoQ38vYWrHyesRPzkqdi45yGMo7KA7/BYxByTgzPS4nzPi7IByteZjpUlHDB1+whNpovOGwATGCIJ7uVmvWt3eGIOtTUlwy2Rio1o2+vtAG3JS6/EkAxH6D4itOxBl02bQkbmZuaafcESUV5np6I4hXPODWK6ZafHHGe78xqTk0f+5N54Uk+E2s4cuqSQDJOC8QDVG9XCjiGB2s9464KMh7w2wM3UVRg5ntx1u/JCGBcjugsDyccEmEBQ1qaqI9vhTP/V5Hi5KbY8fAYxsFH+jkpjcMWgzYxtZr1tmKRY63pm9P0UiwQEIkUU8QqpqCYS553ZNgOoLJANw4crFq0oUn73bFVSJD0sDt8LBOmfunehiA7qiBCttiLtxC8e4g0NxPU6SkE2iMIV/UYCc6YIUAg2osj+a+vJhrxN5BydR6TaQIOP4w1kYqHrDdvvo29BEpqX4+BWfVf852YYp9O3gnV3z3QCDoKmu80oPYucq+sqOicipVYZ6BI408Wi5d26CCXgcNztdGyldd2W9kj+GVhLvjU/J+xbta4ADNJ5NoPc0K741kDmyA9DPaTn9W+IsFlf0x5uSNxXJGbrhMjMmvyg+ZBNQ4+gqyChxYliBMP1ev0QRvqPqZeUDIyX99GjUsXlEz8xbtx6Ho5y715dsXuVAuZ+AboTO8gyYpADpUBVo4fl0tWihHf2JpFvzacAYBEVC1tIXvaj/loaEzTp+wYnggQd5WoMvtxrY8OdrcQMu7B5sHLFg7BXD9vX+RyTnLLxBF7DuqeCpsfCtZEiCfbL+Dtkh+qLEjmseU5CwU3+s4GDomz2T9AL8kEgGz+5iGAnBW04eSev7Tja2pfd5MUsi8Zkp2WFLSLsLjIWY4gqPd0PSlMHgEtdeEmefQkTdMeY1YyVvr0JyYZ8rtj0HfQ0a9ZVrZjea7L7jt1JydTzlxWzABMF24FW4M X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45c14585-b4ab-4e86-fe06-08dafa6244fa 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:19.8791 (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: 8t2SXeAGisKmM+7/ZbUJtd9lZGFqioPX8M8kiIKzXKKzmf9DdnwMuV+V/w6/hMM5YJyQCC4L2EcpAgU+JYmdOYq224XRnMFhy+DBWYR4Q3g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4148 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 mlxscore=0 phishscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301190178 X-Proofpoint-ORIG-GUID: 2CG6b7mzfqCGAf3OkUnxrzOGJwckAUeC X-Proofpoint-GUID: 2CG6b7mzfqCGAf3OkUnxrzOGJwckAUeC X-Rspamd-Queue-Id: 2A9A9180010 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 8u7dyrjdnbw9rmp5yj37z1amjf3rzjb3 X-HE-Tag: 1674162933-396301 X-HE-Meta: U2FsdGVkX18YucaiyxUGEgwXbKF2KseKWIysOGim5nZXfBJ3uYY4LEqt8ngNGKllLBPw/WQ7fr4hqRQqqLvXegHTnmlHMnmSEte1tjxDXDWg3mEFZqpf6LxLAXn7vtuW7+fU9+/MhaZiIG8USnMP4A7W6h75Djig+TaMFvzEROwf10rDurrr/RIqy+HB5A5JUQp3GbVDNq2tAC72k7n0/EiZyp0W1Eu8TJJjlwyrevrTYiAmAtAOsG5wlX0f3tEXvwnLuyw7trQQ2AY/eq0UG6CmwytnXcwvgxjaZw5TArRXxkvNOYtqL56ADsQntRfee5Lp6vAixTyC5HkEceMGIQiiRiTMqrSJc8ObG14x1iVRjeVwXAvZaTZrNPyD4cZMv8ntU1OnBTt+fMnZ6tLZbYsWmE0796Pbs1AWLcJQL9Ssg09IhLG7VXJBJJHIBgIZr+t4lJI/KqhITGNN0gHomwbktZbOwzXJIIQ9jrhGSbK0srEfs10Vl31NSomNj0QgV9MWrl6V7bCmGCIvdBK6XktpJ9UtWT2oOREBqwUPOGzuEJtW7FFtl4ivgiieTRj3iFZKuY6HDfLi3/afpyVyHjNj8aduPY+/XifAM3U56v5sIIKKvHptbTBTOOieOj4+QF8LX09z0ZAOAN3G0CvCvzJ/SjqdJA8ggrApY2nkheBlCpUrrZ4Qi6NwHkDaBf8OwIWce/Lgg+yvZYsUP+Huex2aMSVMKymWzRcxkIHJ0tST1VSTzbS/xD/cjsZfcBih19U9t+7aX8K3FbuVO0xTDzehUAakCW1Gv5O+vVjqszGKWmOYNz/peRg5gfoUgY8+vRf0FG66L7Nl/weI0vA45+WA/aYMTOxwby/tIiLs2NJ7Qnl7rmC/RM/dfG03sd2gI4BRFQT3Z2LLuhA8YolUTkZ08Yotr0zox7Dp/aLxlrjES4U8vhmApMMdMXsvMYAfnmZaG2SRb5/teXx/zdh Ajx0lMDU 2DJzRSYZMm7DZ8r7oiXdILtWpBJNguDv1dba87vkMP66kqR+KNkSRPtAvuzcJJi5Kq8n7BJKlMVcJAd/BgsvpRVYnUJz4AaYJxkHwyMrZ8SKC6/nt5oFiKiKj4XimJ0+4sBAPhpsdQh9qKQUra9uU3yvmoZAofj3+AsIhhfNje3DwhbZ2Cjrt8dVg0vMylnXTdCxhSXRevO2VjlX9gk+GUgRecZ9Aq6+Uq0hUHkDTk6C4lVEcmqDvtuAUZinbnkJFtMZHwEFylbT4//9LX1hqPoR8U4Y0oURcZ45woOpVuQL3DFL+P3PBZx0KnMaoYboWGe2bkGpkG2bPLD/Wg+tJd/wUXThYB7E13lb1Hasx7DtR5X2VoeeDWvpvLPBi+HVenxCPstYFkicjJTMJ9EHWHCaZkEQcWRJ82LKWS7TeDUpPWh1JynNHVMIHZoL3kHdF/YHn X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Every caller of hugetlb_add_to_page_cache() 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 | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 880ebc58f330..76e146bdcba0 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -869,7 +869,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, } clear_huge_page(&folio->page, addr, pages_per_huge_page(h)); __folio_mark_uptodate(folio); - error = hugetlb_add_to_page_cache(&folio->page, mapping, index); + error = hugetlb_add_to_page_cache(folio, mapping, index); if (unlikely(error)) { restore_reserve_on_error(h, &pseudo_vma, addr, folio); folio_put(folio); diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e76be7e8df2c..2dcae9bb4495 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -722,7 +722,7 @@ struct folio *alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask); struct folio *alloc_hugetlb_folio_vma(struct hstate *h, struct vm_area_struct *vma, unsigned long address); -int hugetlb_add_to_page_cache(struct page *page, struct address_space *mapping, +int hugetlb_add_to_page_cache(struct folio *folio, struct address_space *mapping, pgoff_t idx); void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, unsigned long address, struct folio *folio); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 9568d49c12d6..4ab3eda6db18 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5663,10 +5663,9 @@ static bool hugetlbfs_pagecache_present(struct hstate *h, return folio != NULL; } -int hugetlb_add_to_page_cache(struct page *page, struct address_space *mapping, +int hugetlb_add_to_page_cache(struct folio *folio, struct address_space *mapping, pgoff_t idx) { - struct folio *folio = page_folio(page); struct inode *inode = mapping->host; struct hstate *h = hstate_inode(inode); int err; @@ -5678,7 +5677,7 @@ int hugetlb_add_to_page_cache(struct page *page, struct address_space *mapping, __folio_clear_locked(folio); return err; } - ClearHPageRestoreReserve(page); + folio_clear_hugetlb_restore_reserve(folio); /* * mark folio dirty so that it will not be removed from cache/file @@ -5837,7 +5836,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, new_page = true; if (vma->vm_flags & VM_MAYSHARE) { - int err = hugetlb_add_to_page_cache(&folio->page, mapping, idx); + int err = hugetlb_add_to_page_cache(folio, mapping, idx); if (err) { /* * err can't be -EEXIST which implies someone @@ -6269,7 +6268,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, * hugetlb_fault_mutex_table that here must be hold by * the caller. */ - ret = hugetlb_add_to_page_cache(&folio->page, mapping, idx); + ret = hugetlb_add_to_page_cache(folio, mapping, idx); if (ret) goto out_release_nounlock; page_in_pagecache = true;