From patchwork Thu Jan 19 21:14:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108766 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 D5F0EC004D4 for ; Thu, 19 Jan 2023 21:15:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 556EF6B0074; Thu, 19 Jan 2023 16:15:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EC266B0078; Thu, 19 Jan 2023 16:15:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 247A26B0075; Thu, 19 Jan 2023 16:15:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 143356B0073 for ; Thu, 19 Jan 2023 16:15:28 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DCC97160DF8 for ; Thu, 19 Jan 2023 21:15:27 +0000 (UTC) X-FDA: 80372804694.09.9B3071A Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id 53D62180019 for ; Thu, 19 Jan 2023 21:15:24 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=CbDbxWxP; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=f6tSu4lu; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf06.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1674162924; 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=RmtvA3kqCtgodpedmZsZAiY8pDqRCnqPRbwQa/+SAlM=; b=zEQJELlL/6HuJbrsOiZDfD6wequWZxB99BwMFbEblbbEUAdX0hpDxO1y5FRmdkBmZmmtjp ksoTdEBErdeE3Q491/m73el9NbAMkoMXAu9nYm1izBwEifV1YMr92xDYSYuf29uMKGQSYr mJoSenST5WHmIM28XnLEjztorp4R4yg= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=CbDbxWxP; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=f6tSu4lu; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf06.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1674162924; a=rsa-sha256; cv=pass; b=Q5IDTHSIgDuP0DuGHnWis8m0IhSe5M0drsecEHb/r+8rFSo6im0GkOVw1slrIksGiugOtf +bGLM0VUf7QNrnNK8uUxZ8rFtrbmdMPwv14Kndknak2CEXkjGobUuM6mE8mtXK4fsVK02P jg0x0Lu79B9rqMlS2SLFTY19DRx8/D8= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30JKx0Pj017696; Thu, 19 Jan 2023 21:15:00 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=RmtvA3kqCtgodpedmZsZAiY8pDqRCnqPRbwQa/+SAlM=; b=CbDbxWxPr06wb7g2iaw8qBy5A0Gv35+p2CcCzDzeEDj1I/r0nZtLXgMz1/sOjSE5Nwwc LgyWfiq33e+jOCTUs8fj4te1nAnBVKIZwYEqxmQeHIenlJNMfdTgZ4pS8+dDdus5M8ko 4DmX+Kb01NFhH+fl/y3BNDtvkYzrme4KVWLvXzFrz17dUtRG3WyID7NdojyYHeANhN4T /hyuB3r5YA2NuZTDX/S5JDVxrWTplQ74dN+H3WjpmWfVoSQDf/Ga2I2uPNE8IoITLZrC Ow+yy10X6rObl+fjVGqo5m3l4gsVfuQULHfei3AOpncRSthM0RmdD/WFOPTh3THa8pgw FQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3kaak9s1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:14:59 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30JJWBTR018769; Thu, 19 Jan 2023 21:14:58 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n6quh8svu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:14:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cLHZaFsGzzRIgNzf+brz4z0IphIgX2dEsVHQEdnRxbPvomNfCLT2SWS8RVrkwARNsZq+Kv6N9gq7mdG6XGViKsTC1NPOxs/fombOW0sZU1htIcfXuogMPUXBIaszVhi99UisJaJ2vUI2EXLhqGNbMmy8Y6MElD6LOaJToyJ0q4lNIN95N5oj9GmkqnXfOQWfIg5d0Scrueit7w0mnsgGgzLafN3HFKa/1yRsRQZI0I+2IlB1IgkkbWMBAfH6uJlKNpk27D0RGrT3om4Z6IwrqqMOvM9mpO/Fz2Ob6PqEeKx5iTULPPvuTbkQCKZkiMd9Jl4xSdKUqdXUYBmQ/UFGxw== 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=RmtvA3kqCtgodpedmZsZAiY8pDqRCnqPRbwQa/+SAlM=; b=BgpY+pPZt5xZgziMkfUEzcIikMEHKp1I1CYMYaFXlyMUrziYPQFSo4dJ6gBDU32U8iZaRcornnJk5Ec916HX0ftnMdOGF1r74bwOyyosgdHc5J6MsrLy4u2mKiQHIuEnc1Syhq8Nt0IjnVvWdmszLFMHaJQQUqPkFxPzaO08A9Eqt6co4kVXoFgZvBH5/RF/SJQVDBsnOwpEnhzZIz3fFwkBdymkaRF7C7y7lNw7VQbohJwbOzpstsci09vjZMiunfRMMgNcHKRdJ5qN4BYYIahxEZWsEqvw29Awd+XOBqmPwuOHV/GKxwsLZHsKaST39f2qgd8azKjFeqVZRLca+A== 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=RmtvA3kqCtgodpedmZsZAiY8pDqRCnqPRbwQa/+SAlM=; b=f6tSu4luhR17FgczoKyV9DAqBeFEs0h3OEisdWzOaDzgRTv43KZ+qrW26q5wCD98m2ziqBo3ih6i0ee+idOiOpuYoUWiWp6emuu80sQ6OYinccoEkfyEW5+Nc+IOxxwvRWxCDaArHfwishXTdz1Wk19j+f0NTDRuJeZq3nJ59FM= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by SA1PR10MB5823.namprd10.prod.outlook.com (2603:10b6:806:235::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.9; Thu, 19 Jan 2023 21:14:56 +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:14:56 +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 1/9] mm/hugetlb: convert hugetlb_install_page to folios Date: Thu, 19 Jan 2023 13:14:38 -0800 Message-Id: <20230119211446.54165-2-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: BY5PR16CA0032.namprd16.prod.outlook.com (2603:10b6:a03:1a0::45) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|SA1PR10MB5823:EE_ X-MS-Office365-Filtering-Correlation-Id: d22a0594-0986-473f-991a-08dafa6236e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QFOxjED1Lsdu9fR3AT3YphOFc8OUR5fM6fOJ9l6+NQHEbIDlPtHc8dJ2xg4qcMHXwNXsJzoRJO/YJ8bh9G/k6o1MoiDMZ5RrX/oZVv+hOoyTeDj8V9rfOCCW6aY+osN9UVrwWXv+OIRJWbILCQWMbcdlepMyUh/b8ZiYLeE3sL2M4zPG23G5wQOR9ITlycqZfP82kC+GwCjg+5Kl6/6GsQqdY49G2IYDfIJe21wWSK66zvD/zhxBpI3AKff9abAs67snIPw4ESb24I9r+SL7Qp28YHlzZQMK97NQEDeyZMvQvNajPM+/xwhUZc68ExYHXR/8DiDIiUDAnUd1O5qPqkwQU/wgE7oEIDSadpW8Rm7Sbimv9c1sANjjmhCrRLIRN9XMv5l1iLDO0Y5Llck378lJpWdsvI014hfOeZqaKWCLWbn/VTzzpwpw10t4mL0yUhTHv4eCwJYQ/K00cEdNpjjVMuGCcr8wz9xzBqMJCYja6Rz6ficWYd4tKaPyaQH/so4N5PvI/cUPBlQXARYuajCgmRTvIePcoxbMrvQEzTDerD6oy9kA+WrPqHQA7QY+TLitmH8+R3ngodS0ULy/6jOXp8x0qmolZii4tHWNnHmUmxukqT3S51LkHgr6oXfGNEa2aqgbQ3upEs8hz0CCtw== 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)(346002)(39860400002)(366004)(396003)(376002)(136003)(451199015)(66556008)(83380400001)(38100700002)(5660300002)(107886003)(4326008)(86362001)(8936002)(2906002)(66476007)(66946007)(44832011)(6512007)(41300700001)(6486002)(1076003)(478600001)(186003)(6506007)(2616005)(6666004)(8676002)(316002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b44ZdWPNM9MJxV0C5vf0/G4ya8Kq90q65sVLZSlp2lDbSOukNQ705szwuwSjnAjvEjzPnp9ihAQDPcq3ByY6H7hZufjnv/HY7beQVwTARuqrmvG/njwLiVy4LhDLoI662o2dE14JqfHw3TJlljMwMpKI4lQejQay+5WbhizbTLN+EmaxWfNZypHNOOTiGdC5QDpnZy2O+afQ04ptxi1fHQ7cskF+H4rnIidJpu0QGsr9vdByZSlRdroc8+z7Ln8dYdmZQbpGQIAok9gKq2OnXxM2UhXOxXNquPTwqWddhryEd3eB35XVX+zhYhGKyItLguStbZ5v/lv7YFx3nf+GQ2KSnLGbWVO5Z605NGjIZa9dBNGpGfiPCvrVYY57NXy5CWr07oUXi7gIjHTt/W6FU7zEQIy6V1r5j8ggfdrE61gpCrjYix2BqzPntM08pBnQz3uQ8Ic1OT6SkwHUamQ5Zw7VBY93n2vGJB7cFkQ06TlBMQ4cWwefTflVrVrhdcYZNZmCLHADK1b6NDsuiiiV5sIfwis01L2cWfGDK6PW6fL6th16lZnfu26BVlsvEVnvzmqC/9J2AzKKveGtHJekr+KnzgGyjmAkQmZ7VQ+4q2gkCzOAgiY4F7eS6WtSbD3UUiel/V8opnR5fPnEbAYrkJtZ38wgJDcQQ0P6V2WDT/YAyAqOe2+TXnBi98HUGcRnhHT92T29xipGk3G+kwL2wDavq8tlrXR/SAAq6HSAlFBPKRyJxRyDHJRgDi01diFFKfAPthRPaHV0zxCxLD4bx4nzedviKDFuNUhygfnooEQWludbrAptTS6nDeUzugJ6+xVRZFN+3QW3IsUY3wSDaxUhp/BfCwzfurbrt3lhrOrU2U8WyPyG7EhK9ZEq02POGK1073ZAwCYn/Vh5MS7yFU8y4sijmgUCBfFZvN7J1gWhZtdyp01SRi5aut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u7MoRO9/G+d0Tj9OeGEo9t3XulsuqQ0y+e6RsZOIrSa6OGnDW/l/+RBb1saawmjaAB+kB+HQ3J727gMsPgE7XDIruqKFWnix0uZWl1dpO1tswmOvJOVBMwRPqlCH//ILHZxwabR8r7pZjGMwBYfmf3jMEfxHMdtq6svNtTCF7Rv7CdCltgxafMcZiI5boNiknYTwUb9fvGhqD+EUXzmZ6wgCgFRGd9tMz/HGPtqKm3E25L+VvqMciy2sBm2KoIZJaZ/LpPUEvFea4YP4pq59T9zd+al7UR2Y9gjP9Tr7ZL+8Zqg1BRV/byTDmhLlXQYq/VGGjbhrWZobCWlFNrXu8LH6XWebgweuLa7dmc+gq9/ruC1t5Gm3a+9glUph5bgOadAfpnuQ4gkcHDQQ+I+tDft4ruVRWyAUEC8WbeZGr6M7eCVTbqU/3dzuZ83fdnTe141gyfnwP7mAokYRV3EGL5quv96w1uVt5rxWxEiqhUliLG+oMliZSbEAequ2Bh124XhI9c1TOesmIYiuM1Qr8q/+uiByu0KL0ahRoFiswaKTYAeH0jb9Ll9L/+iEMiOmzi3TsFxFU6s28KR18rxe4BUJiJyoEPHJ89fdfYxxGOisw/JUkWRqAmB+Un4/GBYKnjcEwitOOULxiJfX3e8TXuAgh+izb4XxnfJZNwnzbUZBwoI0IRVCmoCoPAt X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d22a0594-0986-473f-991a-08dafa6236e2 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:14:56.2780 (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: FrmxVsZpd9qTJqWhFGFG8fnbpgce0AYbfazSg41qNXUrDqBik0PLtTOsuruipah66+J2iL7taXVnGRU7Hr4sjgKCgwEPLw7QPD8xG148jg8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5823 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 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301190178 X-Proofpoint-GUID: M4TMB-CV8n1WS0qLuIIaqWGu-QRK-JYV X-Proofpoint-ORIG-GUID: M4TMB-CV8n1WS0qLuIIaqWGu-QRK-JYV X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: u8bexop6tm3nzdwok61y4c666bsmzdph X-Rspamd-Queue-Id: 53D62180019 X-HE-Tag: 1674162924-667110 X-HE-Meta: U2FsdGVkX18Tvn4oR7v6Vs4meSOpa1JbJRAJM8iKTKE+LGSpDqnn8CSZ0oAfo31Jn/ejYFB2XKgwLsQ3zCH3zB+VkXdwhS8rHO0i0w1t+8BDvG+wCpvXQAKcelIUTtmTw9SGp+LEZdIq3AGqB3lxHMr+I9wvfwnCFXwd5gegj25QsNNyx0r2gSZ0F3XG5o1GUFomdxLQ8yCb8Tqgo4/mxm6h6yMei+a5EKCsSSrHfG43XakhPPZy1vmsEFivWYdRaf6/7g8tGUmj/f7JToIU4297WlkHb0kJ76XDWqc5nFHJUVxT77mxV5PMh4ZjHWTU+3/+XfH+XGZBwuBbQ2VSQYgiSP6hxnbPeA5+iKdqlenHmC8GIBZQTPmcQxx74StG1jIwISBnRqze7dbUhWhGLVOOwCWRhxm9TllGJd8Cwsce+amigPSmmWL7wEsaR7UJV9GgAt1V3WBIRmHnsayx2WDHft3jdQT8S8XOyRQ/3yq7oD1/wqKFClyKIY65eqwRzJKAxs1mAhuJ5tO1YjXOnK9gzl0TzAMo6M0I7/d2v/onEHEBOdeEHNUtkLr8E7obOUIpN2teVVmresstTz+0PrSoLjDPacrmgxV9kPLPI9b4sOS7SheSSuDwA4IDSo7coc0UoLFMqps76TYysXlBuE73TN0mau69bUBMR84e7pRI1eykaE3I8pgZpKrRjSR6gw/hDW5PW5NL4osRxld5SBeEVOwBg6C4lEIDG9iTi4qL5aBwUdWn2UvndZ9csDdHWF8BcbceOlA1X6ualkl4RWhuIXh4N2lSbmPAuOGBN3ANxImUeN9iuZ4fhMahEbM0GHfBWc+0gKf9bOyePJCK7fGXErzehf91qqrrVRFKs2ozwotgmvkxlJnGC8/w0N/isPGRya5edNh8juXfau6YHdfzQlQC3zdUi8/3Vfsc6yax4cyvoto2XQNcxuDBsYLI1wUgwdH+qAsoCMaYhnZ ycgW/m53 n7BaB9eV5eWHytwrfjsJTti1c1nyFOXiFLVerIgt13SdVbjS2XxNsuVlnl5A/hB8k820Iin3lsFkVunfub4Fat3rcs+f5hHAdmISwrJ2Ky9/vwIEhtrJ1T+ITJgE/4F2ZnM4QXulxywZTcv8yIbUVAZNMSeFsurINGfG0rT4xrFt4A0jv0YnLS7kF68HEJe2K3L/NFW3hH3zKOWxAnqtXNBRvz+QP1vhx1xnSdnCMA3Idlx7jqK+GWlner/EUI1XHdJ3x5Psr+FbynnhTLzrPFFA5hY+fprCo0/2iioVe7qhyChp568ufssZcRm9R55/IL6Vi0QZ7gG0xAEkq9WBJisudpnAPDIOGXIyyad97kUT1fTU+cBdqSjSkMZxji4kxjTKdKsUxTuVg1/03IjG84X6vyocDnAzec2v+eYPZ0Ap2lGC7i+HiseVzJpuaIuWDvMbU 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: Change hugetlb_install_page() to hugetlb_install_folio(). This reduces one user of the Huge Page flag macros which take in a page. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index d20c8b09890e..849206e94742 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4946,14 +4946,14 @@ static bool is_hugetlb_entry_hwpoisoned(pte_t pte) } static void -hugetlb_install_page(struct vm_area_struct *vma, pte_t *ptep, unsigned long addr, - struct page *new_page) +hugetlb_install_folio(struct vm_area_struct *vma, pte_t *ptep, unsigned long addr, + struct folio *new_folio) { - __SetPageUptodate(new_page); - hugepage_add_new_anon_rmap(new_page, vma, addr); - set_huge_pte_at(vma->vm_mm, addr, ptep, make_huge_pte(vma, new_page, 1)); + __folio_mark_uptodate(new_folio); + hugepage_add_new_anon_rmap(&new_folio->page, vma, addr); + set_huge_pte_at(vma->vm_mm, addr, ptep, make_huge_pte(vma, &new_folio->page, 1)); hugetlb_count_add(pages_per_huge_page(hstate_vma(vma)), vma->vm_mm); - SetHPageMigratable(new_page); + folio_set_hugetlb_migratable(new_folio); } int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, @@ -5107,7 +5107,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, /* huge_ptep of dst_pte won't change as in child */ goto again; } - hugetlb_install_page(dst_vma, dst_pte, addr, new); + hugetlb_install_folio(dst_vma, dst_pte, addr, page_folio(new)); spin_unlock(src_ptl); spin_unlock(dst_ptl); continue; From patchwork Thu Jan 19 21:14:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108767 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 1A369C6379F for ; Thu, 19 Jan 2023 21:15:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A89936B0073; Thu, 19 Jan 2023 16:15:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A118C6B0075; Thu, 19 Jan 2023 16:15:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7281E6B007B; Thu, 19 Jan 2023 16:15:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3F9A06B0073 for ; Thu, 19 Jan 2023 16:15:28 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B276F160DF7 for ; Thu, 19 Jan 2023 21:15:27 +0000 (UTC) X-FDA: 80372804694.09.08CE849 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf03.hostedemail.com (Postfix) with ESMTP id 53B6820013 for ; Thu, 19 Jan 2023 21:15:24 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=QVzMNEdR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jxPsxp1t; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf03.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1674162924; 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=zsPQG8fDL482u8E62UY54HDAQGMVSvhN1uuGsS+Bkwk=; b=LoZD3mFIlX8mJeuW5Xji3f9wPhPTwspuJ469ly5JeXCTCSnPnyVXgcqAjBog9HMVsr443+ +cULxrUGUasL2APPFI5nB4O7SlGxu4whV6QOwpfFgLxNHp3Nt+p99QMgyMQFr8o9J9+g6Y 12zx9cywcM0nVm17Z0VK5g7kONFrHRA= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=QVzMNEdR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jxPsxp1t; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf03.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1674162924; a=rsa-sha256; cv=pass; b=3C+tqvJXeSzJij25l1Y21beRfm186p9u1aM3NA2SOAAX9ktRsQq6P7vX9PIigzkWmDzqJZ uS3ca7eJKUfJN7RM/zL/Av08PERkhyXpE0NvvVkycFE8c/SBngSv0yqkXPBZuI/+yomhF8 o9VpEC+aVfY1ACdhUjBUUJxy/UFke5Q= 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 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 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> 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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vYp1biR3+LZkYjCjpeuuDmDXGJ4ywBPcElq5hIFL33ExGouP1PcaP4KA1ReeC0/tatXKHEu86Ahokn2A7x+1+gaUtEeEu0Q6K7uGeBjJRXcTeAa9qQvB1Z2mXZC85CcdbrFxBeAFXqc3leNzEfK6AmaGfuzeCZhD1bJO3pGptYL/ZpCpg3JVLz6L5aEiYGHb5qoiee6zND+KO/8jjvqjOLifpXnGSF2Mc/tywtOhH79UTrija0ieXNqrLIyRVAU+UpR/aYKBAT/2TNP989IbghtyBDgZ4Pc55j1tt60k0D4TZpBEOt0kI8QGgNtmEwBsiNK39PgcxQE7C3Jige5qnT3z8ROzIHT+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-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 53B6820013 X-Stat-Signature: aod1bqhdmz697ddni19nwg1wnynoh1a3 X-HE-Tag: 1674162924-514787 X-HE-Meta: U2FsdGVkX19/ZKSFU15BJ/U3Rr4YVbB+ZideZ7qvt8vo/Bz46xI7fEJurPzejzQQjGTDZtXgu9btMz7MfqqoYkGLWzPwnRhmzYVUlNd8RV1LZFIyK2rh4iqMkaiKk1/FR+cXMhO0Eswjf+zNS/KDPCsBF1+L5zqSKPHH5F8cMKSKpNev1m1ZN1HEPvCGQPmYHGnQjf99m1tf/VnZVX2Im0IcwO1ZhswIpQOSJ8qm9Mnu/imdPec1PCNRe3HCgxUEZQZn9cEsuBtKl1FCORwZfYA/qkPkHveLizs27ffLtVd9/xH4mLsJ+IgrzQFED3wCUKypRvF4GjOLgktqe6FNZgqaYVoGhiudmKpmCsdlK1PURyK48Q+Wc5BKAqebNwVc0l4AGrZpTn8fy7z1SD59MhdTAqJZKkzL6JZmjRbnnZHzfw0pvel+JNNTaxmpw1dhXBLWevT1+7VIUwn/GQQiLRuIjuRnn5xvql0bfxoIUje8Pr53gkJ8YdOLpWStR3ZeqzeN1sJtjoImm+Yv4zeRtatwXf8L/46e9nvNhB9Ei7jM+gNLeEGfvC+90hbA7tYz44K2gxa8nVc3G+cJCRUCN4XG0fQmzHLSs+8t3Yyg3ovI1xC+UXtumvgG4i3aTuh5uV/twIBkzwGksN4esMJCf8LjW0OW04ovsTTo3jFLmv+G3MBqZnp/s2ahHqe3t6VeqDnpJHiYmvPGUpZwh2guWHwYf2t6MZ4dNMyiU7KLbUBx26XyXxqvI5s83vQecuWbk637XCf7dVGWH4Hh0nxOfJLRrbKPn3lb/waNxkikUPcBlsHFEILSAiIw9iKqkwfo9j0i4FYvyxesxAdQ4vwwpHrkUR3L+ZNrDEPd7QEMcUUMb0JgLyczJwEtCuQgnzRVsbvxnCYikodx8X7TZMhv9FAiGR4xNby7dPxI54vthTTFx6ghnVqTPAXmsJFF9nusZhx7eoVQxYRUBq9k+Y0 UUgHwidc qhmp7DCGzymRsa8CY14Hx+LN/K8OSUXrQMwotN08/0Un9qPwyIKEXgPjvZfRSMnzkx1kLrrvAPTFiJOj/yYMPqCCJ7hbQNTYzZyZ1uXYe0PDT0QYa4RWOgJTPiEQLd55ygnfwIe1cTU/iTCcJ99eAM9TA2Sik9UZsaNdJeG1Nluh3c0A4Cjsyj6/cdKkR4bfR8s9g7MehWoMnwPgaSS2cr0D6wqLmFmU9aFNaHvcnSxrJCwlqI6ePZajmPVBo+aHWXN12LeRKAhIlXWuteuKNv6ElJ3kIGiav4/4RrnnrTY4FWSsL4FdePtc///C9riFaL17UNaoYUDkeJYHnnxw4qsPytxESffRthizPL6U27XcBYv1KngOShylkPzn7DdmCzPJx8sasBuFevNyyK5KjZApNyQkHPm42FJDB3W2um7tsJy0U6uIT0J/MtJkIQD33SvOS 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: 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 --- mm/hugetlb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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, From patchwork Thu Jan 19 21:14:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108769 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 963D2C6379F for ; Thu, 19 Jan 2023 21:15:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C84136B0078; Thu, 19 Jan 2023 16:15:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C0D966B007D; Thu, 19 Jan 2023 16:15:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83AB06B007B; Thu, 19 Jan 2023 16:15:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 62F016B0078 for ; Thu, 19 Jan 2023 16:15:31 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 099C5160536 for ; Thu, 19 Jan 2023 21:15:30 +0000 (UTC) X-FDA: 80372804862.08.0325E27 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf10.hostedemail.com (Postfix) with ESMTP id 7DF80C0012 for ; Thu, 19 Jan 2023 21:15:26 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=WEBbfSvI; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OiE23BRc; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf10.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=1674162926; 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=P8ONpzIrTwJHXkSAMdbEViZE3APyT+eQytr+nrla0D4=; b=aoT4lqxLvWH3zF/fi3oVcHz3AeTeRLfA3T3gdJ6/jgvErulAfRLaCs8T65dUAHqbynugoD xhh3P2PZvJI4l+3ejydeKOu8vadU7FeeHNRigJvt8Xc+RwYyxij14D4FvyxywjndD3o+cu rH7r1l0JCxYaxjE8P/sF01TCue1hFoU= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=WEBbfSvI; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OiE23BRc; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf10.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=1674162926; a=rsa-sha256; cv=pass; b=N4iL+LPjWDYz9oKTzw+l1KBjF2V7F/wMn0AFZcCYin3Vw3FuLrr8M0rqehCUPNSu/wDspq mT+WUrQZ/qAzFyM+7nxzIKqqtndps043StZebxe7D2YGnneLo/0UOt9ZfAey6IueiCsADv u6rdSFzO5LB2+kaIGHQ95ihbXfXiAVo= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30JKx3ZH008407; Thu, 19 Jan 2023 21:15:09 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=P8ONpzIrTwJHXkSAMdbEViZE3APyT+eQytr+nrla0D4=; b=WEBbfSvIKL7zyFvdfVE6VaSg8ulre58/pe70f8iZmRuox7f8wIgTyIKzLdlwqsnyBM25 7ZgHLYELqDxgYJCK3dlz5zmj1T3lAzZAZiWIjjSUL1gJ4Jqmebt+WYlsI6ME0XY4YtUC egs2Rf2zq8WHGTV0uAtk7rk3869etbMIEI/0k6tAptVAGaGaoB5z//KFFapDXurnN4Jb O7zuX9r4dlUSJHnvTVJ11lPlIqjZJZVjqIQ0TTajResawbUsvICNIP5EWQR0cUVGprSm SAShA7283b45r/94RmBMG/M4/vUzd4B/eNC1iRm9DRKKicx7rc/h8rAr9MUQFFfsqZ8Z 9g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n78958x94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:08 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30JJZwGp027915; Thu, 19 Jan 2023 21:15:07 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n6quc8abw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DxDQsJZaClsp4uzKsAj5hZ5sTeYR7D7p/CAa27SZ3bR1QSuMw4rZy6cCJWKszfQHDckyos5mb69s2UmXhdBOfVBzqN9pwyaOqt3vbSdGqQvw1XPDVc92utBmNxJC0RKAOjkkhEdKX5V2mVXLkFxokhCGFEsHs3uKTgr1QEIIkvuXk6bALVD/EDXIoo1l3zeDqKP0QSxNY+wDNAVMfjL4j029EZJZw9cmXrea1V1VfnbUlbQi/nqekNWFUeu4l3pBXKsSp9LsCeLrNXoznPzuAvI1aTxJYE+BUbKpvqtdmmKvNIr1fYFxqitap+9EviGWbXMkHk5GfqZaxzCXdOEgLw== 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=P8ONpzIrTwJHXkSAMdbEViZE3APyT+eQytr+nrla0D4=; b=F7c3fgd8n+s/yW5PInQELS8LhUcf1N+M0zuRvB/NPRX4RUFK+dJQezavfWdDtkx4ntXx3sUB3G203XYAjIUmYFpWlqrWbqZDrJp0Vb/lxVCJaHtEd2E/Q1CFr2aHM60yvVNCl6Xdc/OWrsPZdo6x4/F1ssf6UXcg/VmA51zOi6QPcVb0/MgeFslnrRaayj96sN36hMSwF/kqHFfEhYeD+fnbDg++nA4J6DY7YcEb42qvHkJ24ShZ7r8QjgGUJ+XVHQqxRdKkY1t7X2hVD4PdvRITdU0rwUeqwy/606vl/2K9OSDIP/kWa2qwAN7hCEQPnrNGOSW2DK2tihAkUeS0QQ== 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=P8ONpzIrTwJHXkSAMdbEViZE3APyT+eQytr+nrla0D4=; b=OiE23BRcUYHNPmnmrg6RE9E1ebgmOIX07XXB6bKYjt/xa6DLLWKcBMu/wSrOdngoZF/n/2VWqqXWtn2c5jbQkmF7mtAAsOWq7nGgG2fM/Rt7fRRM8RekwSbq9VegfbSiNHvpZUgGiUE2FdcLuHv6kVzOTL0tj+tFN8hGEdljDqs= 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: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.6002.011; Thu, 19 Jan 2023 21:15: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, Sidhartha Kumar Subject: [PATCH 3/9] mm/hugetlb: convert putback_active_hugepage to take in a folio Date: Thu, 19 Jan 2023 13:14:40 -0800 Message-Id: <20230119211446.54165-4-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: BY3PR03CA0024.namprd03.prod.outlook.com (2603:10b6:a03:39a::29) 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: b16a18f2-097a-4e65-e183-08dafa623c0b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Exsey0OWJC8tVsfv2tg4U8ArmbfX9jkBUgC9/T/ppyX7rlultj4BPX6cT63LatNKGUfmykTMurAY4F5AZzkOrbIbTgYVdZfJuxlwnVuDhWH9M/4GT7o3q284o8iwx/jBFy1ILU/FsLHlOKy4/ow8uDkpIhLGqbIoL2hH20+w3BZxj1jH9ueOqb7lWiVOqWwAapBb2edtmvS66c3SMQz31t74AUyfo9DeeGBdQeJAE+j0u0+wUYO/iXwdym/YX6Mxi8EYZzkFH+LiU7OeiIPDA7UaJ+qdF6VLHxkXtLoK9Jfz3nAI3X+FnnimnN8ibHY6XhRpVZyUfpwjD1cIFGTSo1vZwWEw4AmY6GFN+y8+zDpsfWiuJKbYr0zo/xpj3N/ZRfgl8cow3oi73Shn2u5VLc5scsve5J8tln2JxU2UEBMWyb1XxPAAtjgKAE+dSHS4YNZEkuKsATMAdvEtqV1kwdwcdD8CnbTTx4Y9EB/FBubsnLUKmWjJVeIb1sYSmECiFzMW5gNOVrofHc8toFZgbIQuFY3FsEOpsanRf7AYKlTNx77GUXIlXHPV7CgtVd6MkT48idu3qLRq807d82N1vHoVfLvSvG/cbMdxiNBM2qThhRStZkZdhY3D3oaub64ZLSSw/YvPro0Jo7O67BjoXw== 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)(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: A80D5j2fqFTX7aDlX3yACCAye1YXgs0KwL0TsYy9WRifFbHYyIS9hcXwkWmlR85T34mBvd5DvVAMvEghrWXP/ERXGrMCCG70uxKDoM34/xKC26Wz7qxYx74Qkm7otHrfguqh+DYdaCU1hlu+SeR0tsSbjqvvMZOObxGadmPHMnkqB7r0ay/qVwSioK3DlwuBFqM9E2jMxbuhV3MMnTtahQrqbiGYpZgGp1UbV6mQsvsG6isyCFgLaqddGd0dCMMHbqlBTyO1Gb+Lk50L+W/wA8x8MGoLQl4dtli0Seh93qZ5zuJEF0PqSzSMaxoOMo6N8QIA+eDLWL+X1YSh1QUrvUhAbKR6c9hc79tsu0ImEhrJG6zDEqVEJsXA6sNCD3RuNXO2WUyxylvHv+VN+jTB9VZkfeTCRGTbdkk7Z9CkNZyeqj1eUhJ+czRo/BZ2gEwPtKltBuaNnoT/vBaIWEkVyBqGgpqrEaJdealek4YzHYhInn1RoOjMlkxKeicLuq0QVWZxbazj5fWnNXEN/6O/3C2QCpbHFvMIx4N2f738643fEW59thlqCFMYDY9BYuBm5yaTB48VsG2hplKMvgziObGe8BsVVV3RfcTpj/XLyceVffxXtiuPPYPdT7fhjtxl2sYm1ZlAHkpktiljmk7bIU9Z7QYOOAe1yJhN3Gwg80u8PE242yEEyGbI57u8PMfsnhPQlbT/Jn93Ds7pCQ+61Tf1P316K2n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/5l59/DdIr1H0817RpydAPPxHBHTXuUt3MPFsySvLs51s/UVQquhBEtLrIxcVjnTAZQlHH26IIQQ+E34BDhskzt5+Qzg6X9OJrW4RbU+dM34eEzDy3VxW+Be5gGGSWPUZNsF+w2soDPVpahQ5KAd+r3BhqNO9bul+WMKb++xrpLGqhCBmAbX6zJAnuLb4dfHx13glnv34ys9N13Pul+4b9k2mHnNdTyjp5wR4Btb02D5cOJSnFAh/Y60iePPp24l7Nxi6sIQJ8/WFAGD6aI7LGj8VvEaUAj6AJ/dI4KNzdxuXZ4qtgTOMuKBnKvcSUzVYdL7L2UHGW4cVtXAaRcKsdRh3W+DOO63woCNT3QlSFySA0mIpOQ+sYtAbakYoXqtJbhZT7d5KPM9+pNAi6ZPKTfpkeofV9jsdeoceziOz6RVZDiBr9eSQmm1S7+rm1pq1ah1ABE5bG2/xPjKCq9ffMgQg0vlFtjf5po5EsH8tVsHyi8p8+sDK57LeomqGkJKrzMJWneEj/4cK+OR1BFC3I+n5G3D8x38RKPgasSJbv56pB4E7eRchtah/Gljmv5w0vJWTdx4gGT8ITztKUSJwZKRvhnLLP9G2bO4PxHAFNQHDsA2ORP/lpeFZfeAuLeEFXfLhBY2l8Im5AtW3BaOxc0jJHx6z5s6wfix7fAcrEwICIBm7vIVDswz96IC22IwK5UOO2gdhC5aJsZcfwZYwXxkeDFz3jlUK6vlR4pxyygbh2bKoXOo2com9ssnJCtwBUESqY1cTWXCwZOGR39wU/CkM3F0Kfx0+ApZgFF9tkZOAmkABHRrePhfJ3w6dPEpik7812lfr3+M50WqZgvhzmPFB3siEOKyadiljavjK0/YZiPmVtYluck3frlTWB0ALqVLqNGwJqZxr9uDf X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b16a18f2-097a-4e65-e183-08dafa623c0b 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:05.0790 (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: /mEqyX7OEdmdS4snyBQQI7+CNtuCWhVQQZ/0mYcgGN9LWqo8+Ot1uaoTZB0FspJLfluElGtCuusn0C9YGvOBpWA62F6AMmfYFjcBCZPPslQ= 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 phishscore=0 bulkscore=0 suspectscore=0 spamscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301190178 X-Proofpoint-ORIG-GUID: 0CFDQ5Rd1e0o3TcRMDdds8c63c6BLrUN X-Proofpoint-GUID: 0CFDQ5Rd1e0o3TcRMDdds8c63c6BLrUN X-Rspamd-Queue-Id: 7DF80C0012 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: idiswyf6uynxc7e9grakcbmuoqqecsfw X-HE-Tag: 1674162926-391516 X-HE-Meta: U2FsdGVkX1+OhSCqC7mv/J/nJtZKYswULjLM9r0X5H6vuk3wQbVfafnK3iYuw4TfB3XFXXfRvhQILraQhpuibDqht5aJOxjZpYHvkveUy81U/vn0zVeHlqODQjYIqw/cb1/IeReSi/kAvEPE/mOt2tnoss3xZZ7Q2nWFB5I+fXU5lh0tkgHYG1gcJoCBL+aZWiEg04Ome5MF1dAwPzkqpySEDxwabKTONdz4jZGoCnrmJ0DcZswNupXO4+qIkE1o+JRu1oqM+Xa42NmKUnaA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GoNH2+tldMbgyO+NzUEvmnBum+feQ1t/QTdoFelpey8RTH63e0M3jvnVX0sHusKAQkWbquNdeGKd+Ho2cXYAFGCFPrfby 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: Convert putback_active_hugepage() to putback_active_hugetlb_folio(), this removes one user of the Huge Page macros which take in a page. The callers in migrate.c are also cleaned up by being able to directly use the src and dst folio variables. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- include/linux/hugetlb.h | 4 ++-- mm/hugetlb.c | 8 ++++---- mm/migrate.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 06eb59711e4a..f88c832bdfa4 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -174,7 +174,7 @@ int isolate_hugetlb(struct folio *folio, struct list_head *list); int get_hwpoison_hugetlb_folio(struct folio *folio, bool *hugetlb, bool unpoison); int get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared); -void putback_active_hugepage(struct page *page); +void putback_active_hugetlb_folio(struct folio *folio); void move_hugetlb_state(struct folio *old_folio, struct folio *new_folio, int reason); void free_huge_page(struct page *page); void hugetlb_fix_reserve_counts(struct inode *inode); @@ -428,7 +428,7 @@ static inline int get_huge_page_for_hwpoison(unsigned long pfn, int flags, return 0; } -static inline void putback_active_hugepage(struct page *page) +static inline void putback_active_hugetlb_folio(struct folio *folio) { } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 04cbdf5025a5..c37a26c8392c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -7302,13 +7302,13 @@ int get_huge_page_for_hwpoison(unsigned long pfn, int flags, return ret; } -void putback_active_hugepage(struct page *page) +void putback_active_hugetlb_folio(struct folio *folio) { spin_lock_irq(&hugetlb_lock); - SetHPageMigratable(page); - list_move_tail(&page->lru, &(page_hstate(page))->hugepage_activelist); + folio_set_hugetlb_migratable(folio); + list_move_tail(&folio->lru, &(folio_hstate(folio))->hugepage_activelist); spin_unlock_irq(&hugetlb_lock); - put_page(page); + folio_put(folio); } void move_hugetlb_state(struct folio *old_folio, struct folio *new_folio, int reason) diff --git a/mm/migrate.c b/mm/migrate.c index 92d53e0b609a..a35f2b36df01 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -151,7 +151,7 @@ void putback_movable_pages(struct list_head *l) list_for_each_entry_safe(page, page2, l, lru) { if (unlikely(PageHuge(page))) { - putback_active_hugepage(page); + putback_active_hugetlb_folio(page_folio(page)); continue; } list_del(&page->lru); @@ -1374,7 +1374,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, if (folio_ref_count(src) == 1) { /* page was freed from under us. So we are done. */ - putback_active_hugepage(hpage); + putback_active_hugetlb_folio(src); return MIGRATEPAGE_SUCCESS; } @@ -1459,7 +1459,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, folio_unlock(src); out: if (rc == MIGRATEPAGE_SUCCESS) - putback_active_hugepage(hpage); + putback_active_hugetlb_folio(src); else if (rc != -EAGAIN) list_move_tail(&src->lru, ret); @@ -1471,7 +1471,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, if (put_new_page) put_new_page(new_hpage, private); else - putback_active_hugepage(new_hpage); + putback_active_hugetlb_folio(dst); return rc; } From patchwork Thu Jan 19 21:14:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108768 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 24BC7C004D4 for ; Thu, 19 Jan 2023 21:15:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8400D6B0080; Thu, 19 Jan 2023 16:15:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C5A16B007E; Thu, 19 Jan 2023 16:15:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53B536B007D; Thu, 19 Jan 2023 16:15:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3733F6B0078 for ; Thu, 19 Jan 2023 16:15:31 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 129934060F for ; Thu, 19 Jan 2023 21:15:31 +0000 (UTC) X-FDA: 80372804862.10.0E156AD Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf08.hostedemail.com (Postfix) with ESMTP id 2270E160007 for ; Thu, 19 Jan 2023 21:15:25 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="sdZnZ7g/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Qf9RdkBx; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf08.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1674162926; 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=Lb3MhSGzC+YlVfqsSRiHS2gYkZi4Zy1MDQZFe/eP500=; b=xDwZLkxUM/pQCc3sKBCzfse7L3zaM0zcxaeixo+kPyC3yjBvEZQ3p0gaqc/UTspeOqVe4L KG12+mpH9E3oOJt1p1bxes/hAXicWscePLK9I8MO8YGXht07T5pCHIqgOSOiLvq35r6bxo 4N7qpaXlCmVr8XPYzYmU5BTJiTk2hFY= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="sdZnZ7g/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Qf9RdkBx; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf08.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1674162926; a=rsa-sha256; cv=pass; b=HHeUXPhFa4Rm+XeUV8bov+TLDdgYolY+yQaPdeoy5VA6cyuI99qnzY4U21JH0wIv25Bn9h GQirNnCn0DCXNG+wJhovieZNmuveW9e3vep3ow3u/VINfP+uvJpV5YL3lTqlqT5voQvuQt vkcQUvppuDM6mRfQNYhA9n+8i6V2L7s= Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30JKx1WI031429; Thu, 19 Jan 2023 21:15:12 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=Lb3MhSGzC+YlVfqsSRiHS2gYkZi4Zy1MDQZFe/eP500=; b=sdZnZ7g/cNDfhg5b3TJShFcbVFe3rkd2z5odl5nqYj9h7zGkcLNjl9xQu8sbHUuoYQkk 2QOtzb8Bgh1IPesLp2afhRKmRehcB0qd2p+OdTdJ98b+CPz70qzaX0e0fblEvYzLPqKr hAZfLOvxiwooGICDAyZ8+8Xxb5h/BPsdM2pcI/uThSGpCzwFdDf1aNyqOKe7wBnkF9bq S4/tk8kZKJWaZblwpMZTURyRgjnsyAyyIbts2HnFFGUSXtnUmMLG/k62JQ0gxtwwR8h5 R1ZQVVkGGVdq0aJqxVJyREdrxeKbsYX63jYQ2xIv27+rtLIa07/ZNf++cp3Xs86yerrW bw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n40mdjpmt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:11 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30JJXNB7018679; Thu, 19 Jan 2023 21:15:10 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2048.outbound.protection.outlook.com [104.47.74.48]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n6quh8tbc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GVOTIceGRA7eHI0BMOSLfNfG/O1cQzygDGVc7CE8ZiBWXCnPn008H6tnqXGBMrGHTnuW5uM2IK2xlMvbiLWjJar89cf4fEwnGL7K9OtmZkeYvfFKJ9P8Qd1ohyI5zTAi42Ov2meZXvnRtOiMp5NRKLz8yrPyw8Yy9+dmQFafkFJTD5V1OtMsdx1IMYuf8V8GrBNn7yvcfxw0Fu2cHupp9WObU0jOk2c2w4CoWM54VBKa7DUIVet4a7ASCvN3rhWMxIEb3DyY7PVnywmM8OCO4FWsXx6XqlNm1EockBObI6NeUc6OHsymRH6Zgz6XL6fxrwYvVWU8HIEJw++tLe8l/w== 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=Lb3MhSGzC+YlVfqsSRiHS2gYkZi4Zy1MDQZFe/eP500=; b=Oy4hE8F4ZQruaG52ErMme2InlbnbA7ryE2UUKsWQGGixqzCBMDUafVuFGSigKiBHLxTer9YovVdRDJRqwA5S330wnMdDyFszFaTPmJqpn3ygfoMK20AVbQIZ6iQ40wd2gaqlzPV8nPeqD4ECveoFHdRKWEEBcgUmVOAoAnH990wHziRsEkMRfVwbLB+Ntgzlz0xYsDGjeQn7XKVcItN8cmhXf+PS974mfd5yDrZKacK/XqPIJDu7DPaLahAPYWp2sZla9tTKH0n/mK0gwm6/6NPwWcrIGc3OXILA1iVcfdntxFOL0pp1MMfoslGIuQGXtqcKL+UVIuIEkVblvs3xtw== 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=Lb3MhSGzC+YlVfqsSRiHS2gYkZi4Zy1MDQZFe/eP500=; b=Qf9RdkBxQ0Q2WCTYRS/NM0SVdG2wUiPMs7gCrDCg0CHVnX5p1mhcY1gDZncb0vFqfzer8/XnY8j9Rj0xSETpXd0SnXaROAl/5DcY0dlFgMfVL+rOJ2CSoElB5HwAfrIkssajAkOrHT74k37w8gszGyoSPs0Tg58VFvl9zSBfJTA= 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:08 +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:08 +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 4/9] mm/rmap: change hugepage_add_new_anon_rmap to take in a folio Date: Thu, 19 Jan 2023 13:14:41 -0800 Message-Id: <20230119211446.54165-5-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: BY5PR13CA0032.namprd13.prod.outlook.com (2603:10b6:a03:180::45) 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: 4e0c61d5-7b6a-46d8-2cc7-08dafa623ddf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ED63qpPHxkhHjFMyLkRWLp4mN4YP16nRYtxMQCb4kupghspkfCSz/6gH0ZOfu3I8j4+JEXFaR8xVxCoYqHBoQdE/XoMElR6OKjNhEzkxWtAtsoLBp3kCFJ3xvupUKiMEJ+bQXIe06qk4GfENng2qzSfEy877DRGzY7crgeLRkxxz8pHeEA7uutd2nYP74ejEBKF4Z0Nba6/oiamxwbR7N2QzpLsNBuvQdBTFEw+mxCzl3LbIZO0zAE2iLrMmfvm9Q74EdOz5Pz8dJyG1AxTsk9Vikc4dOomrv+QMiFabikS5NKEko8vkQCgtifMX3pTBwQU02XEOLORLqqwMA9cBXEE3KgMwkOO3aj2K2yNwLVQ827ifdsfhhAdUfLuPGr+eJGXXODbnyIXSy1cXjzPBPrZtzMBC4GmzKfzDfc1vhqo+zZEw4qrD1DpmcmPITCbIS21Qy5B4lFmacweJocWF+54GzvYsOPxi0JpNH34nzNN/v0g8gRNFWREF9CMHO8A3q0gJEf+5Vg6oEca4e/Lffmv7StyVAQQ5+dil/k5v50fcsNECkbyFokBZjHUibxT3mWmCoPmpXJHgnHwaULRPJTpgJLXCvl80Z16DNOXkxoWxdAvsR8I92/d3YhL/oBHkNYGs7AqERJlw4Bp3H2Ecsw== 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)(30864003)(66476007)(478600001)(8936002)(44832011)(2906002)(5660300002)(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: /a9KMfO3772Jb1RrZm9S+SgGxyLUMJSJD8mHqSWUuvR1Jmqz8ZMmvjIo9mC3dlnGSXwGyPIPgnLsj2epVxZmoorLJOz4OYc6/7RpdMtcYwcpYhN3Ib/NfYtLc4V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bkJd8723ESeHeuiJJO+ZB0UuGxjetct4suFFig9RwzKcCWGATTaNzWg/wAF4yp4EnQ1o06WpHpID01K2rYsEN3zCP0+Duqt+3ntsNmtku0HDpXfFfebghWFM31rJGeZUpwJ141nPmA3ZvOyicTq4HYTeL4T4Zz9Ee0O9fiB93voiAj8D0hOo+9HxUr+g5Kp+ufDX10Q9En26Fv6WRfluucTJQG2B3EaTsnPwkt9EefXy5ZP+XZdhn9sR07J1pUZOu4P6Kx5ueTQqMqabjUTNINErryQW2+ENG26WUWay5aY7W5KbOzqe9A8f2SRaeet5k4cXCoVfUdRiG+Cr1pwBwVTOloQTTq9gohTV70GOQvTOsjyLqrTdFBKxpEF+tolklr6v9VJouodfOxX3sweAO1bB6TxfHTDpVLD3VEqnmP+RhYlqWOe/6i X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e0c61d5-7b6a-46d8-2cc7-08dafa623ddf 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:08.0933 (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: uzc1PayUBTn8QwNINePMcMRIs+2mVuVHc+os/8zMGiWkqceDqmhU4GwiZs+BCANkMfErOjy7xtTNV+9AE0hdh85NqLVWiBIFvACLk/n93dU= 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 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301190178 X-Proofpoint-ORIG-GUID: QQuKnIiI86Y5FVEVf4yTr8Tf79LWhpnA X-Proofpoint-GUID: QQuKnIiI86Y5FVEVf4yTr8Tf79LWhpnA X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2270E160007 X-Stat-Signature: eb9dbm7hbtj9m5oixyod14ijh47zboz8 X-HE-Tag: 1674162925-566256 X-HE-Meta: U2FsdGVkX19gjs+8bEP7rnyTBXDt5ZNGB6ibV6KUxy6CSGqF5nv8f28ZJ6dLNVc8ZEsMq+syf9xCPuOhEKo+SdrZs4xzySVILlK1DQeupsnpq69wMFOI3QiLCEX/q/5po+ic2vNCXekUvz+izkP5YvSTEE6OrV8C7VX7S8huXiYkqeqSLEGamKPq33lBZ8id/HXI7PMJ90E9GNGZUYqr7CC9OpwYTtQHIaghJi7Pp1FIBpfqLTLGw2YKdSznhNCcTj9JUOJ3HYNpxmwHYcHxjZGaWcnaSHHyk4vapoSyCqssl0wrkSFAhZ9heNM7t5qBtSpziUG4hY/8WUg5UBpeo3Fz4Tpo3/5SXEjV8cjB9AYv5kF3k0ALGeuBP7px82qVxDrEFsVhliQgf5+8z4ce108ktusxMHXjvBp/82+nuPruDuUD7k0DpGS+engceUQB7DCPBoy6G7lcFQTxKqMZQRsRo0ouusnilG2PDYMED2uO396nAW1qCWDuWMYGiyp+Lp8d+4NrJryPwYZu4niOh1hCdY6ZdTBvTORDAUQvYXwkpngdDab4vJV625C03vSyr4quNd7cLI2VeUAWifwhPElElI32dwXR/BRoPKrNrzUwJYHFE6sD78WLGtG59eRvpHJLllllMic7RSeGWpZ9j52/V5KcV9GE+/fh7MsZ3T5nlStV11U/d6pZXHc0pPcY9oueuThw+XNSmDGDBWkAz8O187X1VDfqdi4w4lMAPu9oxeKyCLP4H1QafgigAhe1hZYfnLK3PNXAfOC91wHdRKDRefYKXKsc4SCCwVf2V+oUku3Dc5oU32Ptx4BF9Iv+F93ei9X3bCvOiIw8DGIX2D/SD5v/ghQ1UQh4hEnGnQO/9r+d7BAj1S2Tln8dqnfBp2HI9xgI4u/DiXx59sUn4DEwBw9wDEXnn7fEKMNC2n9az1oIib/3Jx68MuXnQbTF9KQMZSbJzuoMomevM/9 6hQwxaxB uXUXm+cxGjJB5ajQcz5mNKY308A3MMcdb2oEoimNwF6C3DeefjOJhzT7uHrNtNRjBFmKO13hu7Rp4p906VOVd1d82e6dUvXG17r+P1GT43BmI1EmQ6/azXXBHBLyjamMuxvvNO0rAC4YFTLoIRI7qYfiwRhmf0mAvVWWaNI5ZCkoCpuHPC7WmySuYNBhWU3dcee5enJa/ToqC0+/sAz7d4qsA06NKL6u5sqCA5brjJDAYO/fojMutPS1VCeT3K1FhBe/weazWO9yQtce98Jojc+BWBGMuOI7iU4O2N/NFuUF6RTNKARFcJ2rW72PS3tTySj6dnH8hRXHR4hnQkToZUAJAi4s8QNuWKGatrvrXiw9fettoHMMw4HQ7og45Km2strgSLIB7gChkvxg5sG+D0q6h7lpV3PfVFn+ZSeNZkyPfnChLBHCAejecrLTw6VVeGHy9 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: Change hugepage_add_new_anon_rmap() to take in a folio directly. While adding a folio variable to the four call sites, convert page functions with their folio equivalents. This removes three callers of the Huge Page macros which take in a page. Signed-off-by: Sidhartha Kumar --- include/linux/rmap.h | 2 +- mm/hugetlb.c | 90 +++++++++++++++++++++++++------------------- mm/rmap.c | 6 +-- 3 files changed, 55 insertions(+), 43 deletions(-) diff --git a/include/linux/rmap.h b/include/linux/rmap.h index a6bd1f0a183d..a4570da03e58 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -203,7 +203,7 @@ void page_remove_rmap(struct page *, struct vm_area_struct *, void hugepage_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long address, rmap_t flags); -void hugepage_add_new_anon_rmap(struct page *, struct vm_area_struct *, +void hugepage_add_new_anon_rmap(struct folio *, struct vm_area_struct *, unsigned long address); static inline void __page_dup_rmap(struct page *page, bool compound) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c37a26c8392c..6f25055c3ba5 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4950,7 +4950,7 @@ hugetlb_install_folio(struct vm_area_struct *vma, pte_t *ptep, unsigned long add struct folio *new_folio) { __folio_mark_uptodate(new_folio); - hugepage_add_new_anon_rmap(&new_folio->page, vma, addr); + hugepage_add_new_anon_rmap(new_folio, vma, addr); set_huge_pte_at(vma->vm_mm, addr, ptep, make_huge_pte(vma, &new_folio->page, 1)); hugetlb_count_add(pages_per_huge_page(hstate_vma(vma)), vma->vm_mm); folio_set_hugetlb_migratable(new_folio); @@ -5479,6 +5479,7 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, pte_t pte; struct hstate *h = hstate_vma(vma); struct page *old_page, *new_page; + struct folio *new_folio = NULL; int outside_reserve = 0; vm_fault_t ret = 0; unsigned long haddr = address & huge_page_mask(h); @@ -5590,6 +5591,9 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, goto out_release_old; } + if (new_page) + new_folio = page_folio(new_page); + /* * When the original hugepage is shared one, it does not have * anon_vma prepared. @@ -5599,9 +5603,9 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, goto out_release_all; } - copy_user_huge_page(new_page, old_page, address, vma, + copy_user_huge_page(&new_folio->page, old_page, address, vma, pages_per_huge_page(h)); - __SetPageUptodate(new_page); + __folio_mark_uptodate(new_folio); mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, mm, haddr, haddr + huge_page_size(h)); @@ -5618,10 +5622,10 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, huge_ptep_clear_flush(vma, haddr, ptep); mmu_notifier_invalidate_range(mm, range.start, range.end); page_remove_rmap(old_page, vma, true); - hugepage_add_new_anon_rmap(new_page, vma, haddr); + hugepage_add_new_anon_rmap(new_folio, vma, haddr); set_huge_pte_at(mm, haddr, ptep, - make_huge_pte(vma, new_page, !unshare)); - SetHPageMigratable(new_page); + make_huge_pte(vma, &new_folio->page, !unshare)); + folio_set_hugetlb_migratable(new_folio); /* Make the old page be freed below */ new_page = old_page; } @@ -5633,8 +5637,8 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, * unshare) */ if (new_page != old_page) - restore_reserve_on_error(h, vma, haddr, new_page); - put_page(new_page); + restore_reserve_on_error(h, vma, haddr, &new_folio->page); + folio_put(new_folio); out_release_old: put_page(old_page); @@ -5756,6 +5760,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, int anon_rmap = 0; unsigned long size; struct page *page; + struct folio *folio = NULL; pte_t new_pte; spinlock_t *ptl; unsigned long haddr = address & huge_page_mask(h); @@ -5833,12 +5838,16 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, ret = 0; goto out; } - clear_huge_page(page, address, pages_per_huge_page(h)); - __SetPageUptodate(page); + + if (page) + folio = page_folio(page); + + clear_huge_page(&folio->page, address, pages_per_huge_page(h)); + __folio_mark_uptodate(folio); new_page = true; if (vma->vm_flags & VM_MAYSHARE) { - int err = hugetlb_add_to_page_cache(page, mapping, idx); + int err = hugetlb_add_to_page_cache(&folio->page, mapping, idx); if (err) { /* * err can't be -EEXIST which implies someone @@ -5847,13 +5856,13 @@ 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, page); - put_page(page); + restore_reserve_on_error(h, vma, haddr, &folio->page); + folio_put(folio); goto out; } new_pagecache_page = true; } else { - lock_page(page); + folio_lock(folio); if (unlikely(anon_vma_prepare(vma))) { ret = VM_FAULT_OOM; goto backout_unlocked; @@ -5861,12 +5870,13 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, anon_rmap = 1; } } else { + folio = page_folio(page); /* * If memory error occurs between mmap() and fault, some process * don't have hwpoisoned swap entry for errored virtual address. * So we need to block hugepage fault by PG_hwpoison bit check. */ - if (unlikely(PageHWPoison(page))) { + if (unlikely(folio_test_hwpoison(folio))) { ret = VM_FAULT_HWPOISON_LARGE | VM_FAULT_SET_HINDEX(hstate_index(h)); goto backout_unlocked; @@ -5874,8 +5884,8 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, /* Check for page in userfault range. */ if (userfaultfd_minor(vma)) { - unlock_page(page); - put_page(page); + folio_unlock(folio); + folio_put(folio); /* See comment in userfaultfd_missing() block above */ if (!hugetlb_pte_stable(h, mm, ptep, old_pte)) { ret = 0; @@ -5909,10 +5919,10 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, goto backout; if (anon_rmap) - hugepage_add_new_anon_rmap(page, vma, haddr); + hugepage_add_new_anon_rmap(folio, vma, haddr); else - page_dup_file_rmap(page, true); - new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE) + page_dup_file_rmap(&folio->page, true); + new_pte = make_huge_pte(vma, &folio->page, ((vma->vm_flags & VM_WRITE) && (vma->vm_flags & VM_SHARED))); /* * If this pte was previously wr-protected, keep it wr-protected even @@ -5925,7 +5935,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, page, ptl); + ret = hugetlb_wp(mm, vma, address, ptep, flags, &folio->page, ptl); } spin_unlock(ptl); @@ -5936,9 +5946,9 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, * been isolated for migration. */ if (new_page) - SetHPageMigratable(page); + folio_set_hugetlb_migratable(folio); - unlock_page(page); + folio_unlock(folio); out: hugetlb_vma_unlock_read(vma); mutex_unlock(&hugetlb_fault_mutex_table[hash]); @@ -5948,10 +5958,10 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, spin_unlock(ptl); backout_unlocked: if (new_page && !new_pagecache_page) - restore_reserve_on_error(h, vma, haddr, page); + restore_reserve_on_error(h, vma, haddr, &folio->page); - unlock_page(page); - put_page(page); + folio_unlock(folio); + folio_put(folio); goto out; } @@ -6176,6 +6186,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, spinlock_t *ptl; int ret = -ENOMEM; struct page *page; + struct folio *folio = NULL; int writable; bool page_in_pagecache = false; @@ -6251,12 +6262,15 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, *pagep = NULL; } + if (page) + folio = page_folio(page); + /* - * The memory barrier inside __SetPageUptodate makes sure that + * The memory barrier inside __folio_mark_uptodate makes sure that * preceding stores to the page contents become visible before * the set_pte_at() write. */ - __SetPageUptodate(page); + __folio_mark_uptodate(folio); /* Add shared, newly allocated pages to the page cache. */ if (vm_shared && !is_continue) { @@ -6271,7 +6285,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(page, mapping, idx); + ret = hugetlb_add_to_page_cache(&folio->page, mapping, idx); if (ret) goto out_release_nounlock; page_in_pagecache = true; @@ -6280,7 +6294,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, ptl = huge_pte_lock(h, dst_mm, dst_pte); ret = -EIO; - if (PageHWPoison(page)) + if (folio_test_hwpoison(folio)) goto out_release_unlock; /* @@ -6293,9 +6307,9 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, goto out_release_unlock; if (page_in_pagecache) - page_dup_file_rmap(page, true); + page_dup_file_rmap(&folio->page, true); else - hugepage_add_new_anon_rmap(page, dst_vma, dst_addr); + hugepage_add_new_anon_rmap(folio, dst_vma, dst_addr); /* * For either: (1) CONTINUE on a non-shared VMA, or (2) UFFDIO_COPY @@ -6306,7 +6320,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, else writable = dst_vma->vm_flags & VM_WRITE; - _dst_pte = make_huge_pte(dst_vma, page, writable); + _dst_pte = make_huge_pte(dst_vma, &folio->page, writable); /* * Always mark UFFDIO_COPY page dirty; note that this may not be * extremely important for hugetlbfs for now since swapping is not @@ -6328,20 +6342,20 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, spin_unlock(ptl); if (!is_continue) - SetHPageMigratable(page); + folio_set_hugetlb_migratable(folio); if (vm_shared || is_continue) - unlock_page(page); + folio_unlock(folio); ret = 0; out: return ret; out_release_unlock: spin_unlock(ptl); if (vm_shared || is_continue) - unlock_page(page); + folio_unlock(folio); out_release_nounlock: if (!page_in_pagecache) - restore_reserve_on_error(h, dst_vma, dst_addr, page); - put_page(page); + restore_reserve_on_error(h, dst_vma, dst_addr, &folio->page); + folio_put(folio); goto out; } #endif /* CONFIG_USERFAULTFD */ diff --git a/mm/rmap.c b/mm/rmap.c index 948ca17a96ad..e6d94bd19879 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -2547,15 +2547,13 @@ void hugepage_add_anon_rmap(struct page *page, struct vm_area_struct *vma, !!(flags & RMAP_EXCLUSIVE)); } -void hugepage_add_new_anon_rmap(struct page *page, +void hugepage_add_new_anon_rmap(struct folio *folio, struct vm_area_struct *vma, unsigned long address) { - struct folio *folio = page_folio(page); - BUG_ON(address < vma->vm_start || address >= vma->vm_end); /* increment count (starts at -1) */ atomic_set(&folio->_entire_mapcount, 0); folio_clear_hugetlb_restore_reserve(folio); - __page_set_anon_rmap(folio, page, vma, address, 1); + __page_set_anon_rmap(folio, &folio->page, vma, address, 1); } #endif /* CONFIG_HUGETLB_PAGE */ From patchwork Thu Jan 19 21:14:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108770 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 45BEDC678D4 for ; Thu, 19 Jan 2023 21:15:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D20556B007B; Thu, 19 Jan 2023 16:15:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C5BC26B007D; Thu, 19 Jan 2023 16:15:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A10FB6B007E; Thu, 19 Jan 2023 16:15:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 745AE6B007B for ; Thu, 19 Jan 2023 16:15:33 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2EBD080233 for ; Thu, 19 Jan 2023 21:15:33 +0000 (UTC) X-FDA: 80372804946.22.0BE1007 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf14.hostedemail.com (Postfix) with ESMTP id AF1C210001E for ; Thu, 19 Jan 2023 21:15:29 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Js7G3498; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hwJLMfjE; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf14.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=1674162929; 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=GYb+knLTbexJ/uzVeiIADOAI5vrG5GzfsA+zdeB1WS4=; b=7jY5yZbtGMIHoj/Nzh0YH85JqkdFYo3ShNjZlPOmW4nhyJA8LuXFu5M9evXzb2/hH3PJQ/ 7SqYMNHMH4KBtSmkoShIvHnGTpQHlmO2CqztkAWpPnKnNgBwlXkGKXBBz/8ZpZyvqK0Weq krWio1fv1jIpnZnSMo2IVD3d0jTaiAY= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Js7G3498; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hwJLMfjE; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf14.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=1674162929; a=rsa-sha256; cv=pass; b=AjUE+iEPa6DWeyVX4eMZQ1/r+Sdw9KMXxz4COCjqKYjrfA8O3TiRXTG74UvoO0n4NwxvrH 9Xcrm9uCNnjc9MnuS2DH9Ohf44zVAdUVbPL03C+f9zV7+v6ENyiRZHCvK7ww1EIFaiohAH r/4uVE00o5o68r42hG+BcryImBaKt0E= 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 30JKwkrb010055; Thu, 19 Jan 2023 21:15:16 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=GYb+knLTbexJ/uzVeiIADOAI5vrG5GzfsA+zdeB1WS4=; b=Js7G3498bNb4lQAbgEqSwauB/bU9fyDV1m7R0zt2RcZuYEG4hgwyaC7TYyM+6D7Sh+LG oMZETbkP644t9grbj2fRCdnN2JNckzwmy20zcwFV12j8khdKOtZ+ppKXBBxWD4r7BhH+ 7BiQr6Wrfi9kI1NErZJRgPoAzwTyK/wiDFWD6n4Rpoq+ucBdfRy71ePGZoTulg+o4zXA 1T7VazkfpndYMRSWidfIQuj0JaXGN9XPtY0JxkegnoNy/oU5c+bzGcxULF7tW5jQvanM ulXbEvLpLe7RiIVxQShCllu0Lc1PfhRs9UZRH7ZPB0R7JpCJhiwx8FpvxYlt647XcgpU jw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3medkdva-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:16 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30JLDiNF018698; Thu, 19 Jan 2023 21:15:14 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2048.outbound.protection.outlook.com [104.47.57.48]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n6quh8tg1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z4Oi9dJgGLosP9so4eQf76H5sfgrzsUwFb+IvDYovyiIHuTpJtndUxtMk72i/zVSeHSm9nmHl2K4T3Vhk3hQJd5YsUVdeX+4FDuEy9cn5G/5lAW4DSlalxDy+K8AJf79AKm4ABvIaj2f5z5wHQi9Qx151xMgV5R5Vo8Mp1d/YZtNOlYcmZUWAE2KmGM5dviBgNmrd3RReDabojEFMksC3IaaYar1G6aQ/vL0zcYHRsllnRd9S/TbxDja64DgZ9tBzRFnF7y3L8L9xVIlpChZA7cluPzIxnl5DimH97wPYgqNFnrZYeAgyH1/jcbkRgWRh1k68iGfzewAk5bngLPRiw== 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=GYb+knLTbexJ/uzVeiIADOAI5vrG5GzfsA+zdeB1WS4=; b=AMVFumpRxu0q63xu2wbYD0PKcStjti0jPYBWSpu9C27Gb95YoVbQ/adTEbWduG6TyNRoXhIFlkOK7UDt+4FWpg1bNCPmHYPt9KAqOFPBHFJaE6qtRIEfSIeDDUovHHZAG2KfcfPYf2j+bjvudNbtAv+nktJ1MhJ3n1Oje9+w8B2vkQLEXZKJJnaisQQ2xTZIVK4FlKRSZkqFOCP/LP/rko69PgfAyybUwQ4winY47jI3p+2IxRmXSpzvlJgwpcSnzBjHG7tQGMTRPE0/xwJL0+VhW2zqZpOPOasjxCLw4xh4jPQ/ClmbHmj+7zKssnRqz0iSUI984a6zwmAKmlnAoA== 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=GYb+knLTbexJ/uzVeiIADOAI5vrG5GzfsA+zdeB1WS4=; b=hwJLMfjE92dZ4GpZJ3DuUS7XiDxQbrEn+REfwod//qMz80ioYxn0Q5QTFkobYdWA9SjNq+a2xqpIBs4VNYDkqKlGTfc3U6mD44HRdrabwrv7QEAhKulvj+fTTUlUS4caeNmdAzI0ZQLSE7TW9gT6+3fRqb4k68w2Pr2FKIVI+u4= 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:11 +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:11 +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 5/9] mm/hugetlb: convert alloc_huge_page to alloc_hugetlb_folio Date: Thu, 19 Jan 2023 13:14:42 -0800 Message-Id: <20230119211446.54165-6-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: SJ0PR03CA0281.namprd03.prod.outlook.com (2603:10b6:a03:39e::16) 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: d6151c72-6de9-4a0d-0236-08dafa623fdb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jLOczRA67EZmUuymv1DJYdmMvE9woS4V37tJ4ZKWjSTqWVpFRF2EBBKvyeBtuKW0W38DQaFghDJgzuYUb8esPPbjRwWt07ZVF3y0GGjMOwlWox7Q89zo8IIyAeDyBVChK0/CJ16z4qA9H2q82n+/SBXbobc81P0KsP+qWx+P3Qri0UERt34K09f1vdsExWeE4VKKOXj7en+EFyFgeHHkUkFAgaB6l6T/zYKdN07pQ3xfq67Jrp6ZeRFhaLgG6bu4NiwzB09jfk/0kq42R2yzUQMWVgqEj7zt0mu3sQZXfC8wzk/6msECsntv80TZFhQKlkPFZsxh/J3tKWs6RyshfVmbkfpY/AqnywZ7ig45pizENo3Gs2Xp50zWefHEpGUPFapis6mMJc+sS8E0vXdi+/ktBrDycTw2qUDHzQU4ZGZWtX3oCIG72ESZovZHETDo7BVlzHg5lipUQ9+mohnA+bHs+dcoeQiqPM+lEIFxZlWLPDEBBKykiq8/Cz8KWnFz+tFVOQaEfmk5xKgaajRId7P14DQbTHoE3p6by4gX/Qw7saryIZGDMMrbCkdAyaPBpjdjVNSvedyBbtVNHdrSuR7P5g35Vg8zy4y1TxTSy+PRDf2Djn3fOnKJphH8l72U0b+Jl/yo6Y3W4oM6WJpHbxK5SI3KsZtdlhxuaRzO2gpFKd0uQfq9Un1vVWmyYW22 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)(30864003)(2906002)(8936002)(66556008)(38100700002)(316002)(107886003)(36756003)(6666004)(478600001)(4326008)(6486002)(41300700001)(8676002)(186003)(6512007)(83380400001)(1076003)(2616005)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xa9a/g9GiR8PjecpvF9/aMd04znLLmMWGRZQ3fLPJ7YIo2f9TTTCl5cG16XqxdiTdizl4rObWCZbj3Mit5CV9B1MQL2z4Tc0s4+e0G7+6bn256AzmWsWL3lay76CALegqu966pGkorS00lzcA5DCRRzq8RoFfWYLCZIRSKoPQW9lUUlR+KXU44SFEvznz932gnrCQDBd33CdKgQ0ZE4JKo/52GyMG1n4ZJH+GVhIklrNo3WB5daRIwzE71WwIA2o8q89M+kl7BJC/0T9gvWnxGGDQR/j/hdP7V3C2ULDtoUwOXEcx9z4HdwsCS1JIm+0xM9L1Ac1yDi3jd0/o6TKsUgPsZkiDl0apJl0DBVUlH8W41LUcM+W6ZWMkmkqAhUi4bZDovHrFt5UicMQZfNXV7P1Jdoxnxo4y7iaxnlqS6uTPKFSPQckwVZARldSPYX9tO+0lR9CfOfjZRSGk9r0kgg7+11wnDq8taNerFgRT1a6jJbBLi0sQgLOdpIgjDAIN+Y3a6pBNwCExyb2sJ8UuBBYWVijIuFjV2UrdeYUQ0ssaYfFPy3PAmmtS+qK71RzdN65Ny/wz8mVHwj+Xe441q7hjGX4hB1tNkX3FF4Dd+IhF9DZgzb/lw0bvykAVroqd6r1D1/VMYc8qLi+e0E2QP3qWTDtPnBcBsdlyPgzOPgn9UpRv0PPv8aV74PCT0hHVkyzjxRWV3j4GnikmwPSSVk/LeDhewZC4y3+/s4ku9l94uaFAi9TZs1TOq6L+VoFFAPdrPzKGUV2cooNmrj6tmt2iU8SIze4CB2z9uBaLSdm7klfIc0hmmzz+6xg5YXE7DpxB5Q3S+4If6kfamc0XTK5wMPfuMzrQ/zmt6C18DSUADAcN/OykZm3J6LD0K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urdRrxoi1woeZrBzvtD/el76D/MDlS4/lh4Q4FqBS3jX7vNUn1BWjH0JUVWyfDwxCsWEIfGsAdNoRldJUuK9V+p/udB01nkKOXkEt6tfSM4XL7P2r3Tn9B5mYkv79Ltfqb5UT5T1nXBF/lr71tXXBNPm6ok7JLGkuCHaMl9SmO7y17op5F3wkJbadEqp3F0+ZwRE58x8T+Pbuev3gc6iZl74dLW9qOwMd561Htw4t5GLFUkUKyKYIgLMWUNJnbo6HEnuD8LralePeBJJYAiCDPAEpDVVAifr8TR8HY1+xf/kSyRIGGwwH4hMhWXb6SH6m7t8wwe/a1KwlgsCVxBC6N4CMzrmqAl5Cd2GKSOqo4Rr9jRLTzXfxxXSkDciYMmyy1qwJe9zW58ajtomJ8SFSgVr1HKh64tD/dSWkrSSWupSlNGKk+u4A7tVxClwQkap585iCz5ot0aRkESLZoF0BiPnD48iqwmcAbVp+YmVMH9aIgSOY36ME+Zs9fvE+7WmgvM83ocPdnV81kq+nJVo8943qec4w14AuGmtims51jgw3Yuek2An+uylklTLqeFf3fKeHzlWa4fUPBTp7bxZPcWIZVq2PH2lJ/Qz7HTllo772ezszlP3imehdB04LLXdJzTzcuKODYkOZGt8U0vz05NfH4q29hj0SeuiDxzVLHUf7CiMQxXYRfUOFpnPavnLR0WO4nWFlo/X3eakqDj0cFjwYJDzR10WeY5T6SzCfV31kdAY X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6151c72-6de9-4a0d-0236-08dafa623fdb 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:11.5165 (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: mvut+1pMwoaHNH+H5Bb8O5oNgZ0tO+tpU2iEiQYsC7Ljp14nUOeUuIQpcAba4/XP464HFv0oAAyL2l2sr6QV7kySr2W8sCCwfyGA/wvi9gE= 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 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301190178 X-Proofpoint-ORIG-GUID: g3RfW7cwUdjzMdXp-gfxlsfdP3aqLzZp X-Proofpoint-GUID: g3RfW7cwUdjzMdXp-gfxlsfdP3aqLzZp X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: AF1C210001E X-Stat-Signature: 9uf9ugmn6ad6xffo8d5orgq4fsayqzyr X-HE-Tag: 1674162929-268565 X-HE-Meta: U2FsdGVkX18KkocT7EcevohNwjYpWcb5nQtHYBD1lafwStO/xwwfSVR6p+oqWui+p3NmwoRLmuZ7rTkSFa5nlbLAxGbYDCpL4VLTQSg0yPtDu5cNeHzdscDqj0+zyA5rsjCMVeFnLT3TnEdzqptZxyLJq7Jc39avZ4U65Ht1qycUwAO+h7qhJiZj719x+W1gVHUxzJNLH7mgvWOGV/ndsYI6+QIEmAcQyCOU/WNHxXaWh+qz4/ThdjrXiTU1iL9wHu3E6EB4D0wLyDNfNogOMoyvajdjwGZwskem9TKl5wjKyaBB2kZtw/ZD3VtNeU9Onfbf31pCKugBlQX2mj6sZEoHG5MXRK7Hv+oUkHOn9USRnAvETBgsoXgnT0kVO0cQj0zNVcBWX5Wbf1JSkH5E7gDTk1xYDwNqH2ZBCKMDbnwEHpw0l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ulk X-Loop: owner-majordomo@kvack.org List-ID: Change alloc_huge_page() to alloc_hugetlb_folio() by changing all callers to handle the now folio return type of the function. In this conversion, alloc_huge_page_vma() is also changed to alloc_hugetlb_folio_vma(). Many additions of the use of &folio->page are cleaned up in subsequent patches. Signed-off-by: Sidhartha Kumar --- fs/hugetlbfs/inode.c | 38 +++++++------- include/linux/hugetlb.h | 8 +-- mm/hugetlb.c | 113 +++++++++++++++++----------------------- mm/mempolicy.c | 6 ++- 4 files changed, 76 insertions(+), 89 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 48f1a8ad2243..e2f8951103be 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -819,7 +819,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, * This is supposed to be the vaddr where the page is being * faulted in, but we have no vaddr here. */ - struct page *page; + struct folio *folio; unsigned long addr; cond_resched(); @@ -844,48 +844,48 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, mutex_lock(&hugetlb_fault_mutex_table[hash]); /* See if already present in mapping to avoid alloc/free */ - page = find_get_page(mapping, index); - if (page) { - put_page(page); + 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; } /* - * Allocate page without setting the avoid_reserve argument. + * Allocate folio without setting the avoid_reserve argument. * There certainly are no reserves associated with the * pseudo_vma. However, there could be shared mappings with * reserves for the file at the inode level. If we fallocate - * pages in these areas, we need to consume the reserves + * folios in these areas, we need to consume the reserves * to keep reservation accounting consistent. */ - page = alloc_huge_page(&pseudo_vma, addr, 0); + folio = alloc_hugetlb_folio(&pseudo_vma, addr, 0); hugetlb_drop_vma_policy(&pseudo_vma); - if (IS_ERR(page)) { + if (IS_ERR(folio)) { mutex_unlock(&hugetlb_fault_mutex_table[hash]); - error = PTR_ERR(page); + error = PTR_ERR(folio); goto out; } - clear_huge_page(page, addr, pages_per_huge_page(h)); - __SetPageUptodate(page); - error = hugetlb_add_to_page_cache(page, mapping, index); + 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); if (unlikely(error)) { - restore_reserve_on_error(h, &pseudo_vma, addr, page); - put_page(page); + restore_reserve_on_error(h, &pseudo_vma, addr, &folio->page); + folio_put(folio); mutex_unlock(&hugetlb_fault_mutex_table[hash]); goto out; } mutex_unlock(&hugetlb_fault_mutex_table[hash]); - SetHPageMigratable(page); + folio_set_hugetlb_migratable(folio); /* - * unlock_page because locked by hugetlb_add_to_page_cache() - * put_page() due to reference from alloc_huge_page() + * folio_unlock because locked by hugetlb_add_to_page_cache() + * folio_put() due to reference from alloc_hugetlb_folio() */ - unlock_page(page); - put_page(page); + folio_unlock(folio); + folio_put(folio); } if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index f88c832bdfa4..8f054d81e63b 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -716,11 +716,11 @@ struct huge_bootmem_page { }; int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list); -struct page *alloc_huge_page(struct vm_area_struct *vma, +struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve); struct folio *alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask); -struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, +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, pgoff_t idx); @@ -1032,7 +1032,7 @@ static inline int isolate_or_dissolve_huge_page(struct page *page, return -ENOMEM; } -static inline struct page *alloc_huge_page(struct vm_area_struct *vma, +static inline struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve) { @@ -1046,7 +1046,7 @@ alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, return NULL; } -static inline struct page *alloc_huge_page_vma(struct hstate *h, +static inline struct folio *alloc_hugetlb_folio_vma(struct hstate *h, struct vm_area_struct *vma, unsigned long address) { diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6f25055c3ba5..46467e80716f 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2493,7 +2493,7 @@ struct folio *alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, } /* mempolicy aware migration callback */ -struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, +struct folio *alloc_hugetlb_folio_vma(struct hstate *h, struct vm_area_struct *vma, unsigned long address) { struct mempolicy *mpol; @@ -2507,7 +2507,7 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, folio = alloc_hugetlb_folio_nodemask(h, node, nodemask, gfp_mask); mpol_cond_put(mpol); - return &folio->page; + return folio; } /* @@ -2798,14 +2798,14 @@ static long vma_del_reservation(struct hstate *h, /* * This routine is called to restore reservation information on error paths. - * It should ONLY be called for pages allocated via alloc_huge_page(), and - * the hugetlb mutex should remain held when calling this routine. + * It should ONLY be called for folios allocated via alloc_hugetlb_folio(), + * 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 - * not set. However, alloc_huge_page always updates the reserve map. + * 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 * global reserve count. But, free_huge_page does not have enough context @@ -2814,7 +2814,7 @@ static long vma_del_reservation(struct hstate *h, * reserve count adjustments to be made by free_huge_page. Make sure the * reserve map indicates there is a reservation present. * - * In case 2, simply undo reserve map modifications done by alloc_huge_page. + * 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) @@ -2844,8 +2844,8 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, if (!rc) { /* * This indicates there is an entry in the reserve map - * not added by alloc_huge_page. We know it was added - * before the alloc_huge_page call, otherwise + * not added by alloc_hugetlb_folio. We know it was added + * before the alloc_hugetlb_folio call, otherwise * hugetlb_restore_reserve would be set on the folio. * Remove the entry so that a subsequent allocation * does not consume a reservation. @@ -3014,7 +3014,7 @@ int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list) return ret; } -struct page *alloc_huge_page(struct vm_area_struct *vma, +struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve) { struct hugepage_subpool *spool = subpool_vma(vma); @@ -3130,7 +3130,7 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, hugetlb_cgroup_uncharge_folio_rsvd(hstate_index(h), pages_per_huge_page(h), folio); } - return &folio->page; + return folio; out_uncharge_cgroup: hugetlb_cgroup_uncharge_cgroup(idx, pages_per_huge_page(h), h_cg); @@ -5080,34 +5080,34 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, } else if (page_try_dup_anon_rmap(ptepage, true, src_vma)) { pte_t src_pte_old = entry; - struct page *new; + struct folio *new_folio; spin_unlock(src_ptl); spin_unlock(dst_ptl); /* Do not use reserve as it's private owned */ - new = alloc_huge_page(dst_vma, addr, 1); - if (IS_ERR(new)) { + new_folio = alloc_hugetlb_folio(dst_vma, addr, 1); + if (IS_ERR(new_folio)) { put_page(ptepage); - ret = PTR_ERR(new); + ret = PTR_ERR(new_folio); break; } - copy_user_huge_page(new, ptepage, addr, dst_vma, + copy_user_huge_page(&new_folio->page, ptepage, addr, dst_vma, npages); put_page(ptepage); - /* Install the new huge page if src pte stable */ + /* Install the new hugetlb folio if src pte stable */ dst_ptl = huge_pte_lock(h, dst, dst_pte); src_ptl = huge_pte_lockptr(h, src, src_pte); spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING); entry = huge_ptep_get(src_pte); if (!pte_same(src_pte_old, entry)) { restore_reserve_on_error(h, dst_vma, addr, - new); - put_page(new); + &new_folio->page); + folio_put(new_folio); /* huge_ptep of dst_pte won't change as in child */ goto again; } - hugetlb_install_folio(dst_vma, dst_pte, addr, page_folio(new)); + hugetlb_install_folio(dst_vma, dst_pte, addr, new_folio); spin_unlock(src_ptl); spin_unlock(dst_ptl); continue; @@ -5478,8 +5478,8 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, const bool unshare = flags & FAULT_FLAG_UNSHARE; pte_t pte; struct hstate *h = hstate_vma(vma); - struct page *old_page, *new_page; - struct folio *new_folio = NULL; + struct page *old_page; + struct folio *new_folio; int outside_reserve = 0; vm_fault_t ret = 0; unsigned long haddr = address & huge_page_mask(h); @@ -5540,9 +5540,9 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, * be acquired again before returning to the caller, as expected. */ spin_unlock(ptl); - new_page = alloc_huge_page(vma, haddr, outside_reserve); + new_folio = alloc_hugetlb_folio(vma, haddr, outside_reserve); - if (IS_ERR(new_page)) { + if (IS_ERR(new_folio)) { /* * If a process owning a MAP_PRIVATE mapping fails to COW, * it is due to references held by a child and an insufficient @@ -5587,13 +5587,9 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, return 0; } - ret = vmf_error(PTR_ERR(new_page)); + ret = vmf_error(PTR_ERR(new_folio)); goto out_release_old; } - - if (new_page) - new_folio = page_folio(new_page); - /* * When the original hugepage is shared one, it does not have * anon_vma prepared. @@ -5627,7 +5623,7 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, make_huge_pte(vma, &new_folio->page, !unshare)); folio_set_hugetlb_migratable(new_folio); /* Make the old page be freed below */ - new_page = old_page; + new_folio = page_folio(old_page); } spin_unlock(ptl); mmu_notifier_invalidate_range_end(&range); @@ -5636,7 +5632,7 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, * No restore in case of successful pagetable update (Break COW or * unshare) */ - if (new_page != old_page) + if (new_folio != page_folio(old_page)) restore_reserve_on_error(h, vma, haddr, &new_folio->page); folio_put(new_folio); out_release_old: @@ -5759,8 +5755,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, vm_fault_t ret = VM_FAULT_SIGBUS; int anon_rmap = 0; unsigned long size; - struct page *page; - struct folio *folio = NULL; + struct folio *folio; pte_t new_pte; spinlock_t *ptl; unsigned long haddr = address & huge_page_mask(h); @@ -5784,8 +5779,8 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, * before we get page_table_lock. */ new_page = false; - page = find_lock_page(mapping, idx); - if (!page) { + folio = filemap_lock_folio(mapping, idx); + if (!folio) { size = i_size_read(mapping->host) >> huge_page_shift(h); if (idx >= size) goto out; @@ -5818,8 +5813,8 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, VM_UFFD_MISSING); } - page = alloc_huge_page(vma, haddr, 0); - if (IS_ERR(page)) { + folio = alloc_hugetlb_folio(vma, haddr, 0); + if (IS_ERR(folio)) { /* * Returning error will result in faulting task being * sent SIGBUS. The hugetlb fault mutex prevents two @@ -5833,15 +5828,11 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, * sure there really is no pte entry. */ if (hugetlb_pte_stable(h, mm, ptep, old_pte)) - ret = vmf_error(PTR_ERR(page)); + ret = vmf_error(PTR_ERR(folio)); else ret = 0; goto out; } - - if (page) - folio = page_folio(page); - clear_huge_page(&folio->page, address, pages_per_huge_page(h)); __folio_mark_uptodate(folio); new_page = true; @@ -5870,7 +5861,6 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, anon_rmap = 1; } } else { - folio = page_folio(page); /* * If memory error occurs between mmap() and fault, some process * don't have hwpoisoned swap entry for errored virtual address. @@ -6185,15 +6175,14 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t _dst_pte; spinlock_t *ptl; int ret = -ENOMEM; - struct page *page; - struct folio *folio = NULL; + struct folio *folio; int writable; bool page_in_pagecache = false; if (is_continue) { ret = -EFAULT; - page = find_lock_page(mapping, idx); - if (!page) + folio = filemap_lock_folio(mapping, idx); + if (!folio) goto out; page_in_pagecache = true; } else if (!*pagep) { @@ -6206,34 +6195,34 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, goto out; } - page = alloc_huge_page(dst_vma, dst_addr, 0); - if (IS_ERR(page)) { + folio = alloc_hugetlb_folio(dst_vma, dst_addr, 0); + if (IS_ERR(folio)) { ret = -ENOMEM; goto out; } - ret = copy_huge_page_from_user(page, + ret = copy_huge_page_from_user(&folio->page, (const void __user *) src_addr, pages_per_huge_page(h), false); /* fallback to copy_from_user outside mmap_lock */ if (unlikely(ret)) { ret = -ENOENT; - /* Free the allocated page which may have + /* Free the allocated folio which may have * consumed a reservation. */ - restore_reserve_on_error(h, dst_vma, dst_addr, page); - put_page(page); + restore_reserve_on_error(h, dst_vma, dst_addr, &folio->page); + folio_put(folio); - /* Allocate a temporary page to hold the copied + /* Allocate a temporary folio to hold the copied * contents. */ - page = alloc_huge_page_vma(h, dst_vma, dst_addr); - if (!page) { + folio = alloc_hugetlb_folio_vma(h, dst_vma, dst_addr); + if (!folio) { ret = -ENOMEM; goto out; } - *pagep = page; + *pagep = &folio->page; /* Set the outparam pagep and return to the caller to * copy the contents outside the lock. Don't free the * page. @@ -6249,22 +6238,18 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, goto out; } - page = alloc_huge_page(dst_vma, dst_addr, 0); - if (IS_ERR(page)) { + folio = alloc_hugetlb_folio(dst_vma, dst_addr, 0); + if (IS_ERR(folio)) { put_page(*pagep); ret = -ENOMEM; *pagep = NULL; goto out; } - copy_user_huge_page(page, *pagep, dst_addr, dst_vma, + copy_user_huge_page(&folio->page, *pagep, dst_addr, dst_vma, pages_per_huge_page(h)); put_page(*pagep); *pagep = NULL; } - - if (page) - folio = page_folio(page); - /* * The memory barrier inside __folio_mark_uptodate makes sure that * preceding stores to the page contents become visible before @@ -6887,7 +6872,7 @@ bool hugetlb_reserve_pages(struct inode *inode, /* * pages in this range were added to the reserve * map between region_chg and region_add. This - * indicates a race with alloc_huge_page. Adjust + * indicates a race with alloc_hugetlb_folio. Adjust * the subpool and reserve counts modified above * based on the difference. */ diff --git a/mm/mempolicy.c b/mm/mempolicy.c index fd99d303e34f..945b41c245a5 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1218,9 +1218,11 @@ static struct page *new_page(struct page *page, unsigned long start) break; } - if (folio_test_hugetlb(src)) - return alloc_huge_page_vma(page_hstate(&src->page), + if (folio_test_hugetlb(src)) { + dst = alloc_hugetlb_folio_vma(folio_hstate(src), vma, address); + return &dst->page; + } if (folio_test_large(src)) gfp = GFP_TRANSHUGE; From patchwork Thu Jan 19 21:14:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108772 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 C0AE8C6379F for ; Thu, 19 Jan 2023 21:15:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 557576B007E; Thu, 19 Jan 2023 16:15:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 490BE6B0081; Thu, 19 Jan 2023 16:15:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26F046B0083; Thu, 19 Jan 2023 16:15:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0926A6B0081 for ; Thu, 19 Jan 2023 16:15:41 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C8E51AB232 for ; Thu, 19 Jan 2023 21:15:40 +0000 (UTC) X-FDA: 80372805240.10.BF2F210 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 4EE7740012 for ; Thu, 19 Jan 2023 21:15:37 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="czV/pYIs"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=l69gYxcp; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf11.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1674162937; 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=eajZ6BEFzwRRcAfH/MaHIcKZWur6SUr+SVPX61qbPAo=; b=4ujm2ew62bbhGVeXzMDWDmbNvOnfo+7iguPGL3NjGoqsOnEWUWAQhddx4pSPrddbYGRgZK zb1tETA7Aymj7G7eF4WhLJvMp/c+T3d5BnUstJfxdsajrfrID7g1Z9yGgq0y/sL/zeTrvE 2r8tBCf6R5OnhA4i2ThhV2nX92i6i0Y= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="czV/pYIs"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=l69gYxcp; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf11.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1674162937; a=rsa-sha256; cv=pass; b=nRuD8GIKolvToIZAMV3mQM/PJ1OCOlUZVU+K0trxBHazkL3rxYf5NogzE/d5cxs7sXXFv5 Y4lyZ/iX6m/XHGpK0PzrO/vpQ/6j/K0Q7zD+UUUa5Ru7OLJYwkOhIpcuDjHlWDSKnkn/J+ xOteX92yk6t3H6Yg2PKYRhpGBaxP0bY= 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 30JKxAxJ028142; Thu, 19 Jan 2023 21:15:20 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=eajZ6BEFzwRRcAfH/MaHIcKZWur6SUr+SVPX61qbPAo=; b=czV/pYIsntIESziVOKhDes2aiUKRe89urajibF9SQ6sKYiOaIirXk2b8SYd/6IZYVDGc lr5d1ppFAiLOwb+lFbHcJZgGvRzQ+QxaRy3mx2BZbcjVeATaKGGhTM37elTxQzyfH8bn a5891TMF9Bznkvw7z03iKeouKfFEb4jijRlnydBbdMJPDnCaxed6F/1DHMzsIFPm9idf Nojb5xV9E08Po5QmmtzJWqDQnrdn+rR92FMxDijr59/ZugU8c0ofF+xjkjpdRNO3pzOa AThj0QtHPFwdaoAwTJbhh8xNl3ActJI/O0KHy/KpwB3tZ/M6ImOjiH4Ruj4TjHpkaYU+ ag== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3k013atk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:19 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30JL9XI6018694; Thu, 19 Jan 2023 21:15:18 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2042.outbound.protection.outlook.com [104.47.74.42]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n6quh8tmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QfZVaNaN+KtCXo/0pisTKB0rYR1JxHxXx4VyvtELMfBIC+L8f/V2vmTAObOu0QGrJaiGiePvOBmlnewfUEKbXwFazZU3etxMYYeVB8VPX4rqQhLiFdBpAeImNnIvJxhDkqZqyImIFqIvugW3TynwmTqYQL4QVWJQS+Hi303GZ4pn3ZSJGKW2IPcNLKY7x8lILmT4kzeWEkTe6NABW8SCyCynEmaai5E4M6XbMMBX7Bjr/Tz5mOcZZlXqqlqIhHtGpr2AsVEfXsnWjz//uIRL2JxAaInQ75YJVKcJ5SHITzU7bh0ErDH9BQTRXvxledse02duPDEqLoL7eYU7eVNiuA== 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=eajZ6BEFzwRRcAfH/MaHIcKZWur6SUr+SVPX61qbPAo=; b=ji3qDmxfltN0zQsTWN8EeeQYAcLW6kW2qrJTRf6zemB5ko+KCRBb9NCXbaTVLipTGIVLkD6wKLc0OtG9KaQWs0/2kRCE3co748Ws/XLievz0GJ6jqXSxrEbIGB8zxhkALSs0lWkK+uSjar4haIrrzNGRQ0mGL65vOvYQzgtKz0ecXvsSXnH7CKoWnrY3gCZUMfKu3+lyGr/9bIAvZ3wGajTRTZiZbzBIPaOdw11/SpjbzPwfIQGYCxFkZ5nW8zECzzlrOEIeB0k6mtrH9MaxLwyUmVjWS/ZPDjODjG1LTdtidtKUOSfHN/tnkQOPIbnSME8PhLoWo97KarHnjL+BJQ== 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=eajZ6BEFzwRRcAfH/MaHIcKZWur6SUr+SVPX61qbPAo=; b=l69gYxcpPq7wflv1sLLJPLbjmxykf4drcZkzUnUVUhPvx5DlRMK/v1tl07HWh7HGlfcTQJ4FdoPOoEGD+PQlLM7Jw2hUYaeyuGfvBM46+N+Xv4nGF8no/AwupLIoVvvtxJhpalAkPXLlphBS7XHtHbvr7kww48YpG7jkEudlT2E= 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:16 +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:16 +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 6/9] mm/hugetlb: convert restore_reserve_on_error to take in a folio Date: Thu, 19 Jan 2023 13:14:43 -0800 Message-Id: <20230119211446.54165-7-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: SJ0PR03CA0291.namprd03.prod.outlook.com (2603:10b6:a03:39e::26) 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: d9709ee5-3f23-4d51-e8a9-08dafa62429c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZA2OpWItrijEzYlpfChi3S1vOcgoPhgTvux9eIk+RfqftszHHRrNKPxEWzOy0jQsggnemcVPojfA7RGF72LDnbHUILQoK4nRkE4O9z5XL12RUr0EfBAqDuLEJpVKBTZr6hwXyDt0Bg0uLxwJYe31XHD2Md7fOFsZJkeOZo8SxDX4f19antmbt476v1ii7Of8rGNsNtw5RcLErURlI1Itwln9y05LMDiuyuT7cc7zc78xzSDAbIFttv3b+CQHmrB/loc2Zb68Dx7Qzj9IaEIYsN1ywIoe7i+iRXHWEpWJMEfjc7oRVpJNhwkV3jOP+HoXD7TBGPfUnpgi7/fUXYz2x+/1LatTDohUNqmIiOfbOlXKcv4TbLe1NaNvdhhnivn2/+dfGnIxmrwN3Jv0fRsUof9+0414brFMjPy+GmYBsjn5KhAl4biX6dVJKvWSe61q0s2HmMQJFgpWiGhe1huYqCB1JmVhB7wvciqcqMqDcFBxX07oVBym0K7T4EqwoId7VXO29I2hHNUgzVHMzsBqBfN3zmSGQsiObGAM9jLvo1AftvAwv2glyk27j90KSkbxzF06EADGa06LzrnGQv24teENTpLqgtJbssD7AfkmYZsY1NYqZ98/29fXnFnK6wJwfGDa0J4Osm0YZqqNUunM3A== 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)(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: PLovkJ/RWZW6noKElQf83e7bqpROum//tnKMS7w0s3s4RAfyOXnspM97Fr2lFCxxpmLpLfulv4XBba8nbxkECgs9zk6AjM3rjiMVpE8dJ7xy3qnrZ6mA1rdBemofg4PljZF4TchtoU68J3IUQXn6qPRVvuTiVzTZDtIYeKszWiRnDt7oF2M7kgW6bb9AamHxyiI/wed8ekRKJ3tqCMJHPKZMHnJqVQkD+VAYcC1UoHILZnNCHxOORmZiIJUKavx0npMADpF1A+O7C+HjdLA5yJQQwxqkLZumRp5D9W2Sb7rfEDaA/LPQE1KXIZzBXLYFuYwENRWKxw+L+Fp1N+UOiG4vb7SUd9uaNf2momAjCvdRCS98C7uBQi4Csh0DFGadx0iQETWhdbF4o+cahOupkyRwYHyRYTFrdF1BSPlCQLvOV5rr46Pi3Hi4tWevhfQCdxRKL0oD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Wk1o2Tc51Z3L6/p2LLvGVHeEsBEWERoNeUnghcM7lOlL4SDDksH5hyzwOslroOG+5I5jfTtGfXowdCi0MkgCb/LpnCvRSGBlgX1cuX1SodgWyP X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9709ee5-3f23-4d51-e8a9-08dafa62429c 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:16.0476 (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: eMncciwByK42ahoAFSX6SP36VcjXjHQ1YtN3JxDqUCMRCeZqreisKu8l5Q13iwiV9MjBjKbq4TL6kNqIg+e1gNfBVC0nce0OFxVFCWA0Ki0= 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 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301190178 X-Proofpoint-GUID: Oj6PdwfMtkh_oXFQY0eAAe7QagN6blGb X-Proofpoint-ORIG-GUID: Oj6PdwfMtkh_oXFQY0eAAe7QagN6blGb X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4EE7740012 X-Stat-Signature: im7k5kjsw4kzefraqmbfj8xfji5qcre1 X-HE-Tag: 1674162937-982927 X-HE-Me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1SDIo0U+GbF/dFL/rALQumJXdI/UdBgQLExlPwTHiBrELecDppDWP/tgcztL+Wun/0qzE9J9JEzLMQS3GFjuI0Tudu9cUU7A5flW9fg4UHJ7GVr09bfssLF8iZ8Q6f791A6afzb+/89OV+kVtENk4WcCTuLDWeh9dwxtGBcuc1RY2DwzhNFSeTZhGiGJO1Tb+stPw8R3wnY+uLYcUd4TvvU+PmtaFoycfxfh9lJqbGso2OZ9jEDBQi5eYRvEcjZwxJRL0sMuNyuMPs6KI7sUwTcB5JXqhnnhHxzKWpR2SXRq9at/ZLhhJDHy/uK1l29J1yGxlfaAL2s/uT2RN8EGdTA3wPUY7RRvbQNmypdVc8qP 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 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 e2f8951103be..880ebc58f330 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -871,7 +871,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 8f054d81e63b..e76be7e8df2c 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 46467e80716f..9568d49c12d6 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; @@ -5633,7 +5632,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); @@ -5847,7 +5846,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; } @@ -5948,7 +5947,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, spin_unlock(ptl); backout_unlocked: if (new_page && !new_pagecache_page) - restore_reserve_on_error(h, vma, haddr, &folio->page); + restore_reserve_on_error(h, vma, haddr, folio); folio_unlock(folio); folio_put(folio); @@ -6211,7 +6210,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 (!page_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; } 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/l2eVcILU7LtdHWQSMvGFzAJUH1H2tT8Ii3cCZMK8zHDyn0vPDt6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16/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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olUTkZ08Yotr0zox7Dp/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; From patchwork Thu Jan 19 21:14:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108773 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 3E60BC46467 for ; Thu, 19 Jan 2023 21:15:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E0986B0081; Thu, 19 Jan 2023 16:15:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 72F226B0085; Thu, 19 Jan 2023 16:15:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A6B26B0082; Thu, 19 Jan 2023 16:15:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E2D506B007E for ; Thu, 19 Jan 2023 16:15:40 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B9B4E14030C for ; Thu, 19 Jan 2023 21:15:40 +0000 (UTC) X-FDA: 80372805240.08.284CB63 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf05.hostedemail.com (Postfix) with ESMTP id 4308010000A for ; Thu, 19 Jan 2023 21:15:37 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=xZLVvhuv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jnh9FoxN; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.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=1674162937; 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=N+yn86ESbBpJl8IWFmBr7oglLMvx4RStv5pLlKp0ZEM=; b=KCyrq4ASehsQWBHREiCNr2PBbwTzqq6boY+gto/QkRxc0XCKST7sXMWba1qmuArgRCzkNy xGIrjPbL7wkcE4P0BD6sjjqwGzWtCW+7+ExVTsGdeuNo0af4Dt5TmmxGCA6SGpwQ63/jau R2PNd873RTnvoHHRbWXubb0MuqkxOU8= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=xZLVvhuv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jnh9FoxN; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.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=1674162937; a=rsa-sha256; cv=pass; b=bj13D59q4kWoBQqbBqOFmSwho41AK/yT4mVwl0ITORQguqT8UzNtssekxWpoLfHC3Fe4Ty +STamCXZHI4/qrwEiiVJpsuDoQkwFpd8I+qY0ShM3T1WO1G57yRgQpbVd/IXJK8n5arUQX lyDwUhlaFt0UB4QuUkEdHFhMpiONs98= 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 30JKwkre010055; Thu, 19 Jan 2023 21:15:26 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=N+yn86ESbBpJl8IWFmBr7oglLMvx4RStv5pLlKp0ZEM=; b=xZLVvhuvysCfuePvrw3nVMGtQyUcFRkEzBxdH6E8/TJOuOt1VVPn5wp2lce2E9/BPHY1 coVjbV/X0JhCr9htvQW52Aihdt6FjjQYICxi1LI2Og24fMyM76faibbIr+HThnzsHaBE SVe7FRDCLLWQKzMuFq/7s2eg2UTeSy2IUP+zs4RS++3ymq1Nr+JS0sc91jgXHMAPPI3m GPTYAvn4eC6lyMru3uv9gwGLVPyuNBuYrRUvJuL9gWEvxSJgLxjtgygxVF/iA2Mo4EZ5 TCk8mVV9NSvAFiGha6P5eyTubZuGH7shivNRXkW0cM9690Fgi/pioTT31626CuYnbIpB DA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3medkdw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:26 +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 30JLEQkL013443; Thu, 19 Jan 2023 21:15:25 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2045.outbound.protection.outlook.com [104.47.57.45]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n6qme9njw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=exHkHQOIWQ0dqw8IYbZWrnuaH7fDww3AjSyE1yw/z7hyRZLp7+2VCvW5trJlcEfq/Y4fBhWBtbhAgVFALZPd+dCUmL4GxuKG3CJkh7v7QikALwIucBu5imocm7i8zQjiMtGHgc2ogKeqHKBzhF8KXsGZljQjV/5wLVso2WieYWpgRARTexX3G9jqHVhuuG+l9fisjTXXi0VHBpzHHM6Rhj6SqxC6inH4D+7vIump1DORMxzhV4UC6dL7PEtBcAFKDVAlaUew6E+aBGBQtMaPAdaO7ixTamFIZYF14hi/xYML7aTPUdgqBL4XgVnp75MnlJnE4OxmVjXjNjJhVBDjhQ== 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=N+yn86ESbBpJl8IWFmBr7oglLMvx4RStv5pLlKp0ZEM=; b=Eog71K7bZBB5H8VWNwjxmrqnHji0HH44ppcD8BUkO5cFdAQEaETxHUMH9F0YvGcEJrRmmgNrul+/LjiS8hN89XrKbRYvPOvEmFYSd77hB06JcJ+uIoUGPmq0+xkVAN3PNdsDoJpyFitXTB4GQboas4KQqTdat8GLPz3yOtnbWFO8x2/AYkCKo++eDml8muBh/h1F6iypf7nYRSKjtPtj1IxOVmy2Gjzo5avIXpK6ZTZBzy3GvEgnxvoZYYPDaVkclUum+uxq75UTYjuMJrHe8ffWM+um4X7X9EW79nlwbCCr/rTAAfAoleXha5OTN/rTjKzF9bScMaFm2jW+MUhtqg== 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=N+yn86ESbBpJl8IWFmBr7oglLMvx4RStv5pLlKp0ZEM=; b=jnh9FoxNITU9cGwKPzckjSdvYFMaW+EQL2Hkb56M7uIlU5HJeI59/E19Q4zOaRndAj/ZzO3TXBCk4purseLcDeIfIsCJ5egckH3Uro1Qf0udYOi1mzlz23EjnV2/Hm6dTY+8ween9fyOkSUH7H+tOzyQlcd7eTHU6g2K6ZTC1dw= 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:23 +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:23 +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 8/9] mm/hugetlb: convert hugetlb_wp() to take in a folio Date: Thu, 19 Jan 2023 13:14:45 -0800 Message-Id: <20230119211446.54165-9-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: SJ0PR05CA0011.namprd05.prod.outlook.com (2603:10b6:a03:33b::16) 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: 913cc73c-1485-4e11-d31e-08dafa6246fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zVmMkJXFS1s2aZ2tefNuwmks4I5ZCiWA2CkghMlp/jYMkaqwDSUCMHHsnN0Z0XaIn2z8WGvtevVkMEKtX0FjE+yFcDDMSddomZdB3p0ogHe8eLuov75S+XpZOWr6GHhnopZhoRidVkWHSlymBEFB5qFkkuVt10D3tED9bKgHHwyhtB7k4KthLyi1TIhIirdlWOWLYsLJPvc+mVlZTbwVTVUvp8rxkB3zlmdw5iaWnLgP3UJQWFjTs5D+RClmzkvGESDeWEV8mQ9ugqQrNTvn2LAC4ObxIedzR72Ia5aWKkZ9c0JyOEw12FiKGm/HH+ErPDYVLjDxolDf7N0Vhtw1BAmCIbUj4V8dqN7PUzCMXhcKge2p4j7vloSvzgBEkjm03HOZ5omhdt952btLRdTjeGrLzDw+ymhU8Igtb09TEdqeL3zLzbpTufZbQBD+juQxtjkYrlC4aVjPN50pAUbeKbYa+MpesH9pjYYYuIyqQOT8sWjffghtjVURukI1x65Qynhq88pxhA+xPK7l0oOK9+/31ucb28gJRBLdYq84QYlRebhuM7eIiEi8KgRA+7jZc3Vz7HCSpkuPg7csDK7DdF3sACXP3CxLUDI3IwGkDjg5k6zbWhSZ6uLu+D/ltn+aoZQkTnAQSycpJ5+nHr1xXg== 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)(66899015)(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: m1pBqf6B8SMfFm0UNvtkuo81SiUbVhSsCnu85RCz6JCU/JXAT3lNeKEhmEby97wbCXISV6rEOqzP/4Ho7hXxS+s263ztjBvrfMV41vwOxtKm4EqFTmUGEzls2yPhVqZ+PeluimzXUQvLdmEpO6242m8YGXXMtGkrhIy2OQtW7qtqqbeM77q0mpMWTdx0I9TgRGK28ddvpQ12EQVnIyHPr9kYYn5Ea0VGMXiDwTUfnLy2UcCREDNETUg2c1WpOg3HstWGaPJdx+jxKctrGMHTKixaqyNzot5wsVoqcYkkzYytDFZTaDAMbH1G1inzfCTPi05TkxVbIHQmgT3siNlM5oqMivHWF153BVE3niSU0GWXXocm6YLw9NdTZgTfAckUOvJJfrxWhyCi6GR9R/K7ZbFJsXHd29Xfp0Y2uBy1sQ8z5Z4AAe8JkJDIidfUUYw3eesLPSIaYjmSQUOsrNSydz7tOPeVs8x+jIYR4ETprgCQXg+VrQjtGTrn+ErqKu7O5pJPb/+PMd4pD0itMbaHGJUoZ/w1R7+/AGV9OKZJ/PJuTwhcG+H7DauQrLuYQT1LKfVz0E2oK3vKMpZKLiQYO2vjKQt5yINvkECMN0+HHTiHPdJYh159X6q7fchFnAQjsUUIBGgqHfzy/wz5WHJt+M4IAsIZ9sjgcL0IX1pRaju9AWkVI40FVrRFLcSOSxDyWGdpVGzbHl/j081m1j3ieTbJUR8eqs01fDAJMWy6GARPWXRFgJFmmKLIlGQLtrXX5GXG3HtHffoHDLKh9iLpoD5y5GvIJujzsplgDsz0PlkzO34vk7Vd+HLDSoCU2FJjaEdQxcXkDXUf9QglndHfPdDUnf8skjEj5ah6k5jqP783czqVe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2wQn4Gft6E95gjBli37TOTTh3Q9/Z0XL/c5Q9HaOrr8YZQF0nggo3S3AWL9bryiz8AKjYd9xBS3hY5nhIFZ16O9UGTNarDkQ2woyJMhMhsnGxkSw2Tqf3TwEP6knvf6xSynwTct0OHHhhrUxXb3VChJCwk4fl8xTZItAhQ/zklLP9q+KuXoxbarhzfENcUD3hR1UpTYhQqgLG+/f7V556ydDsHlYTZ8AcZdc02+9riaV5F4oVLcF2zT8+Q2+RC408hAMgQ2nNqJFgfMx1diDycP2Je2MpPOebLF7EgDOcz7/0H8EmY/lW8kYkGT01UblBl1ivDDFtljNgJ01VxByMm1MVW85Q8REiowir0yvZEtpP7gA3iHxw7AxvFObVgxVPg/LFfAXlcRBr80pZ4GpLcA78tegIPGbKBVxzMbE8cTnC85FAfxitFPA/lkCvPBPGnlOp14oANCtsRIm/6UYxoBhN7u676rmcrduqr/bZMbEQ4acWZ44Y9vqQVPJ64ruO1r9QGQBfpTCt4lnnTvtrwhYsDEYeVbyLN+FLeGL/q/ljcqdT2Mbmn/Ejsgox7OvKrD52NQoPnzm8boSxkVQehLvroGnwS0DF64WkPcRxQlvP19pyTlQcCBAH86AySPaCoFn/hp+vSrC1x7XnJ9451oeG87V0uquALkXTHPCiQpTIWfwwXg1EDplgmBlbKBsCzPaPzEvoj13gYo99XpyB4G99KWuMLsc/ZdQQ7qR3ShHG+v8GwvRC/bt X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 913cc73c-1485-4e11-d31e-08dafa6246fb 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:23.3025 (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: RLzOi28GAyrYTvKS83yrpTiva+q9SMI+mlFCriPDHOJbNTWREg1Tkt6IQzDAIwgcYQt7Dta+LjNRyXQqImvJus3xwJtipyUQa9EmrvFfdD4= 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 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301190178 X-Proofpoint-ORIG-GUID: t8iyFIkF5VwWwoQvov5nVgHRYOHmEaa3 X-Proofpoint-GUID: t8iyFIkF5VwWwoQvov5nVgHRYOHmEaa3 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4308010000A X-Stat-Signature: 6pdqxk3hasoqpgkxxzdh61amaajmocns X-Rspam-User: X-HE-Tag: 1674162937-444329 X-HE-Meta: U2FsdGVkX19Hcjax0hv+ajLbNtYIQVwvjxEKntw86oPIRhbBqHWdzxdhlg6WyrEn8fFn4UGO0BXgL4MNUoC7aPXzO7ML6zrEk7typLyfy1oUnd6W/NrxjiYVjApEdgS6JyJ+Ad76Y9rY16/AqkSO77rUq/52X8/ZrMOd48xBdWzVjFv6JnE0ebpz5D3o6m5X6pZRyxwhrAT32GK+8W+21Z4/qRVqjreXHTSsDFyHHhiTEkM348XsCpfci00fD5t/4TrJc8DJwTm+FzhDWA3pKI1tL7Z+xV6Y+iJ/rTND8Uh90L0eLU67/ZWB6FiBeiLZo8tJf1VLSyRBWivgMZDR+odSGM7xt4Qk/LcbSv/JODMofrfXD7zyGHoWD7sxT+a6hwzRC7wFD8mR8TIZgwGDxCpeYufAocEhiJmCQP1XSfRc2xU+URyzUn53e2OnCr716jUs9x756paWCsBr1YylDcv009Y1HIW1Zy9n7eEcnbVJSYqgPsVt/MnktqqHkpnaKd5xNHpu2e8skkj/dHPTW7hkf0Of0+2HEHSVMhzZVGHTdvjifXLsHoB2F0sf9yqNSKKE2fZJY47uxhfBLHt8FUu80tdzaAvcBdOQnfl9oClJn2oyqeVI4surSKFMkhSx8DxRldmErdk4Yil5KQJTj6sV+VRr1jqF+7D7Hrc3BJ7Z3lAkel+pkR80gFxlv7Plfnc3pCPd6IvhuAvyl6Tz4gXfk78/NnfXFUTGut0mu3KQ757FGlJNeKYVfIt9w69Wvf0ondubj6Sf4BxFYCs24dZwRJlWdb/uE+BVqzeaSEQ1aluiunfrv+VgqLZaUKj2Er4IepGbuSR2nqR8VW6Y+udEkCvkLcvbyHV6KdMv2xKlOcD9brDT7IzOj2mx67ELwHALubXr8+rQlnSVAs9v/wJtt50XmRXaf7dA8padcT2xtUqfb3+I7ymU5xS3afjtxnYSIje0vVZfFhvpx9y RXxFMDDW jeD5w5d20iZtYH/G/3+Qs5UCQ87mR+WUsIYwK9FRU650KczBewIZOeAuBADEoa6/E6P0v30Y7mLqVs1zxtruisaBpm2WA8y2SdQ9F5a2MbksglrzXB0zMMmACBHyGmbeC9kpa4jE8uJOSR9IRmKW50CcQvAiUqdLwRoTLnukkHBr+IKp/eeG8QysITA3W+X3AGpf3IPku94NXnk0IBp8VdT9QA6/V70u6ciegLNUTjSJ4T2YMqr1pZDk/EMoF0u8l1MR3zPURvfCD5bWocZDhKUs3gfCNw29zueeIHxiMvQbPTQEQ+ckYti+5fJGoDAC6LNcRzTq/54zwOE1TwCWnqI7YtHHtRrF9+3MlT2cXRHincfpqwRKJWK79h7tntzzQssMfEO1PQ9p4W04G+ur3xRNxLNJMc7YOijwSlkBixbpBEHBRvkSkhH/RAZaEL0VjItNx 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: 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 --- mm/hugetlb.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 4ab3eda6db18..20127271b64c 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); @@ -5923,7 +5923,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); @@ -5986,7 +5986,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; @@ -6068,7 +6068,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); @@ -6088,9 +6088,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]); @@ -6099,22 +6099,22 @@ 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; } - get_page(page); + folio_get(pagecache_folio); 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); @@ -6125,15 +6125,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); From patchwork Thu Jan 19 21:14:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13108774 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 EC29AC004D4 for ; Thu, 19 Jan 2023 21:15:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 817696B0083; Thu, 19 Jan 2023 16:15:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 777EF6B0085; Thu, 19 Jan 2023 16:15:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E0F86B0087; Thu, 19 Jan 2023 16:15:44 -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 34EE66B0083 for ; Thu, 19 Jan 2023 16:15:44 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 04B9B160DF7 for ; Thu, 19 Jan 2023 21:15:44 +0000 (UTC) X-FDA: 80372805408.07.BA86B0D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf17.hostedemail.com (Postfix) with ESMTP id A3E514001F for ; Thu, 19 Jan 2023 21:15:40 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=khvChgNx; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ZysFuDSz; spf=pass (imf17.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"); 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=1674162940; 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=8YPmBgiWXHv6nshpCJp4+H8Ty8HRSgwtJRlGF4JM4EY=; b=QJ3A5wVxN/e+E6KTLhJ9NSTuqUvmkUFu8TiiUz5p85FkSTR2GwjIYfPtyjb+RgITpYl6Ks s70QOTvOw/vWUcIu6cX7zIUmgXo1EKjJWL3pALGM+9rYMN2KSw5Qs0QwPlUT5RmjluecKO E4ZP63qs5vNaftlVC5InyvDIF2nnhvA= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=khvChgNx; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ZysFuDSz; spf=pass (imf17.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"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1674162940; a=rsa-sha256; cv=pass; b=eX/7HIIRtLdrmh+82LXxMCM3YLDnsDUoGDXgmMYTqWx50+THhTIW94q0GpBxGIIeWGLLf7 C19LJgQ9FcSe8+pzJ8dfrq1uBguCF21U8dRvvi91c6uehyrTmgK3OSC+CP/qJegAsJerda 0XNsKYjnBPpqmCszp8MzgXPMdwr6Y7k= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30JKwx6L008067; Thu, 19 Jan 2023 21:15:29 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-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=8YPmBgiWXHv6nshpCJp4+H8Ty8HRSgwtJRlGF4JM4EY=; b=khvChgNxrgMXeqe22fvI+I+KrESMTEsHyArPzt1Kddn7SmTTwGVqDB5Mv0FKFK3tfG3k IHiuFYNVg7dHidiP71s68gRfbNMKw6+MyQn4eHlA8Nk7sifl4Pj+IFt1LBgQs/upksdk XUojjGnsKbEy8ZQDT+oL9+WDPRc+O8UAk3gJ6z/0WgapyPPQE0YG9U/gx8Ou6FWviarR 9z/Y92g6z2DO/KsC01bfJ017LFz91wraINrgRbvg6FLS416xSq1EA+tHguUAicEWjNMn HHeGPfWJKNy5GyQxbr5UdnHGwH8s9kKBKZWhf43HBbwbhx+geOTBGhDDYX0fEayiyz3h IA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n78958xa6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:29 +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 30JJb3dh004704; Thu, 19 Jan 2023 21:15:29 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2043.outbound.protection.outlook.com [104.47.74.43]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n6r2v088m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jan 2023 21:15:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GzRHy9A/itwLFxpVgKayhawUN2lP19y5iJGP8Rl1EcsrZN8cp0JARYNdCgn8VHgjKs0V3MT6hyoAjdY1hiuJktG7qhUL7N0mbKwc1btHz9mGeq8vgqXvF0neCAPue0p8qzDtHMtBLZEzV//fCRW/qH3kU75vEicxvmzu88bqkEOOuEo4+NnA2FCi7BlhYaUoYCP8yEob2BJefwqV2Vd5ZG3pd2vf/kM72/oLFBL1/dKxs96IDwNlUo3BGGL6BLN5xBPkr3XwBSo7TuZ4PB2sY5ymkvz+pYS7Cv3S/j1YErR2n3IREiOBwpmZ2UhigHffOkRnEHy5vzQDc7kItQ6oCA== 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=8YPmBgiWXHv6nshpCJp4+H8Ty8HRSgwtJRlGF4JM4EY=; b=VkBAuyQ5d6+IVbNRwtfQSLUJsYbkBzpshsidGYWquvIPfSVGCsbGQ55MH3DvGWvZjHJZPNyKR6WfOCIw4GC6nbzxkx94BWzYIh4RKe9s1oHl/6a13pO38VWULM/T8fbjVEnI61OKWMopmrEkk4K0PL2PtDVqMbB4N8eUSNXE3fPHF3IBwK6fcZpo72+lj+V7mrJjf9PfJp0LwXlCc7hF9uwCOW++bPWVxvxOqGY83OrpTQ85PrStGiZWUCHZ2jYXMgCUCzNtIP4/qc9Xhvo7xiCpDXEMNcUh8J7aLbpPDwUZiXRm36DH+cV6TOWkeT9tVTsCTM37wZtqqvhUGjDV1w== 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=8YPmBgiWXHv6nshpCJp4+H8Ty8HRSgwtJRlGF4JM4EY=; b=ZysFuDSzfhJulQkRCWN5mqttdXCP0X+Lcygc47Cup4kYLmpnqkgh/KeJOrWjqhSNM63pd+8M8ixmazzWf04QgDmTvGwGS0nzd5YyJDayPExY4k4RHyTJchz8sxi8n5nMrLY3mZKePp8+hGZMwPXqaYzb+lfdCE+ulZqhzOkHxdo= 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:26 +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:26 +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 9/9] Documentation/mm: update hugetlbfs documentation to mention alloc_hugetlb_folio Date: Thu, 19 Jan 2023 13:14:46 -0800 Message-Id: <20230119211446.54165-10-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: SJ0PR05CA0158.namprd05.prod.outlook.com (2603:10b6:a03:339::13) 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: fafc298b-5b38-427d-4351-08dafa6248fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ONeavsU7A7ykjoRuUpzt7m35SIiIJVwpufzluAsch8q6Nnh420heKnL5ZhBNkckfbDprN7xabLKCMRg1anPm9Ri+qadC4vfs4ghqRWaMSfJ0Ehw1AOm5i5dXy2wuER4DpIIhzyNpGfec3swS4lMrrRiddu5mvsNS0OZctur67zU5Oa2rVxZvVYvUm59G5YRJHXZgcfs5LFjbro+FsWd0+JmtzpSAFoVawgDE4nokE9cnXd7q9B60NilDj5cdcTp8ZSJCshsK1qVaZwVu3mWiQ10TV7bDZpphhMjRzbgLtSQJmpyeCxmvWpo2UkxTjKPUcDEj6JkJrg1GmveRZR60o3zrlBQEGpf3kes2OnSxXrUKJC1KfNAElf0b7iaTRVMJOLBTdLh04/SgK4w1eFOBfoTxN5PLPuFA6OZIjJT+/hjPD8FNrobi0v//cYZ8fh4kihwVdWAEAqrq27f0t8R2hZdFXHZsonvPQGQiU5JJ2GUmCx/ONtgbmc17ZnPufVUdAgZ5lE9Scpt5NN2qiqFhbjWmoAjACt7ADnSrcT1N5wH5Xo+i6fHeyxf9f/PyqI94XEujWCHc+03Joe8jGK1EyizELSmglbrR+pJAZhsPWxDSyrcX6b0EzqYLOZTstj3Qsz8+50TKeG18Q2JTfsfbWw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:zh-cn;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)(15650500001)(2906002)(5660300002)(4326008)(8676002)(1076003)(41300700001)(2616005)(6512007)(83380400001)(186003)(107886003)(316002)(6666004)(86362001)(66574015)(36756003)(6506007)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?zr2rkX/IeYmgyYwPidSjZMeCUyjE?= =?utf-8?q?X0MPwsvX07pfEnpd/BgRHbbvZpKExBSpbf1zywsncqGeqXKvJ9xiCBOOuTaqjN8a3?= =?utf-8?q?k+Fp37iCuOe9qEiTv8xVnYCDgpAL30s2slQRhv9o58csVIAWylw+Z03mVtGKx4VU0?= =?utf-8?q?+ZDslkN/Mk4MQHcGvM2L0PqwSFcH/v43+HNBQdb73WY09y2uHcBx1IJgBbDNNb55S?= =?utf-8?q?OKnCE/G7aoNMS1rIM0gNIEM0QuR8vmaH4UiVx2aKDul49NQyd52Fw+cv+rA+gYbID?= =?utf-8?q?rMg/qojZBce2gVShR9QpsRYXcHZiXC2O1/w9R1jqTTj1+NTBCD944LnNnQFw1GKIJ?= =?utf-8?q?vK7FDnp8Dx9yrkafRhfwBdien/bybIv70fbEvsXbS5diH66PBWivi+PKtHbOQsaN1?= =?utf-8?q?De3gt7Hmfk9zX3HmkNl1BicjmCSMkQcR82m0vxYM3MajaGclUGdIyXELIQ3oMT/6g?= =?utf-8?q?U3opqXYvcUG0TwzVArXTgggqqzOVKQiHRTRoFiRLAKISsP3nd7rGbjTIe04mxMloz?= =?utf-8?q?/fC987TOT3jXsdbULwilMKtJfRT6II6j9m4T75SkD0b4RtjU745gp0Ve9uLXRc0cL?= =?utf-8?q?uqYivTjvedLQiffBpJ80HiCvu/ZCpJ5mqH0eE3EiLy52sCQLJMkfU1siSzCNvE/IO?= =?utf-8?q?FoMEtjFZnixrpvSLC7xm1T4Uc5+lmmqpMjRkBmysmNQa4loBtopkm7EC6hNTBMCFD?= =?utf-8?q?g/HmeVW+wZOsqtGDmS+pq9jk0oRqZYz/+uXAEzTSyryXnBUnUCBC4mAwFN4cqyprm?= =?ut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Mnyj5wBEdVC66eDSgwR1GH07Pi+o3ToD2EZt9W9Gcc5?= =?utf-8?q?rVo2qA6yR2YO8ie56PnXd4jrt+ESKwuKcD?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fafc298b-5b38-427d-4351-08dafa6248fc 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:26.7076 (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: vngtJTHiHIr8VwNwNobihGHe+9MapskawYYSiWD7gt4bduK1Jn0a+V1nFU032BxN9/TutaVMh6Aiwi/5EpB4do5cB5dQpMwe6md5KMM/ez4= 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-ORIG-GUID: mk9yI2SgoqrUBZG-z_Taoy5eg0hBg_ug X-Proofpoint-GUID: mk9yI2SgoqrUBZG-z_Taoy5eg0hBg_ug X-Rspamd-Queue-Id: A3E514001F X-Stat-Signature: jak4xf4zy6db8zfzowih9h5rp99986s5 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1674162940-21584 X-HE-Meta: U2FsdGVkX19pai95bwDG6OcoZ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aWHrq3QFr8/9avTLrlIEGpEbKX8bJy++bsd+EkJoslyQ2LTlEE6VabUS01p0SVJAPsDaoZYFLve0II7PYVCfndljTQoNYyHtF6LcCBN9uB7lXM7vc8WSDXlfLywmjJ3Gxmq+3nX824IsKleD4W+ji5KJ1RlEmu0RgwifJLWDxGzExinYpXTWU3qpzWlkfiWoaTzTBv/GHvWZJjTOmMJXyBUwJLKDGU/JgzoAmcOYcwIdqFhs6hXzqVU3sTKTsx82ZNie5CbyU/LdQcApZBtArXGlp3sA3WxdpZUojBtRWkZ6YddtPIzE3pVgupqgrtHwYBpAR44yNQGYkKYOA8f 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: alloc_huge_page() has been renamed to alloc_hugetlb_folio() so update the documentation which mentions alloc_huge_page(). Subpool information has been moved from page->private to having a dedicated field in struct folio, reflect this in the documentation. Signed-off-by: Sidhartha Kumar --- Documentation/mm/hugetlbfs_reserv.rst | 21 ++++++++++--------- .../zh_CN/mm/hugetlbfs_reserv.rst | 14 ++++++------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Documentation/mm/hugetlbfs_reserv.rst b/Documentation/mm/hugetlbfs_reserv.rst index f143954e0d05..611728c49bff 100644 --- a/Documentation/mm/hugetlbfs_reserv.rst +++ b/Documentation/mm/hugetlbfs_reserv.rst @@ -181,14 +181,14 @@ Consuming Reservations/Allocating a Huge Page Reservations are consumed when huge pages associated with the reservations are allocated and instantiated in the corresponding mapping. The allocation -is performed within the routine alloc_huge_page():: +is performed within the routine alloc_hugetlb_folio():: - struct page *alloc_huge_page(struct vm_area_struct *vma, + struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve) -alloc_huge_page is passed a VMA pointer and a virtual address, so it can +alloc_hugetlb_folio is passed a VMA pointer and a virtual address, so it can consult the reservation map to determine if a reservation exists. In addition, -alloc_huge_page takes the argument avoid_reserve which indicates reserves +alloc_hugetlb_folio takes the argument avoid_reserve which indicates reserves should not be used even if it appears they have been set aside for the specified address. The avoid_reserve argument is most often used in the case of Copy on Write and Page Migration where additional copies of an existing @@ -208,7 +208,8 @@ a reservation for the allocation. After determining whether a reservation exists and can be used for the allocation, the routine dequeue_huge_page_vma() is called. This routine takes two arguments related to reservations: -- avoid_reserve, this is the same value/argument passed to alloc_huge_page() +- avoid_reserve, this is the same value/argument passed to + alloc_hugetlb_folio(). - chg, even though this argument is of type long only the values 0 or 1 are passed to dequeue_huge_page_vma. If the value is 0, it indicates a reservation exists (see the section "Memory Policy and Reservations" for @@ -233,9 +234,9 @@ the scope reservations. Even if a surplus page is allocated, the same reservation based adjustments as above will be made: SetPagePrivate(page) and resv_huge_pages--. -After obtaining a new huge page, (page)->private is set to the value of -the subpool associated with the page if it exists. This will be used for -subpool accounting when the page is freed. +After obtaining a new hugetlb folio, (folio)->_hugetlb_subpool is set to the +value of the subpool associated with the page if it exists. This will be used +for subpool accounting when the folio is freed. The routine vma_commit_reservation() is then called to adjust the reserve map based on the consumption of the reservation. In general, this involves @@ -246,8 +247,8 @@ was no reservation in a shared mapping or this was a private mapping a new entry must be created. It is possible that the reserve map could have been changed between the call -to vma_needs_reservation() at the beginning of alloc_huge_page() and the -call to vma_commit_reservation() after the page was allocated. This would +to vma_needs_reservation() at the beginning of alloc_hugetlb_folio() and the +call to vma_commit_reservation() after the folio was allocated. This would be possible if hugetlb_reserve_pages was called for the same page in a shared mapping. In such cases, the reservation count and subpool free page count will be off by one. This rare condition can be identified by comparing the diff --git a/Documentation/translations/zh_CN/mm/hugetlbfs_reserv.rst b/Documentation/translations/zh_CN/mm/hugetlbfs_reserv.rst index 752e5696cd47..826a50c47389 100644 --- a/Documentation/translations/zh_CN/mm/hugetlbfs_reserv.rst +++ b/Documentation/translations/zh_CN/mm/hugetlbfs_reserv.rst @@ -142,14 +142,14 @@ HPAGE_RESV_OWNER标志被设置,以表明该VMA拥有预留。 消耗预留/分配一个巨页 =========================== -当与预留相关的巨页在相应的映射中被分配和实例化时,预留就被消耗了。该分配是在函数alloc_huge_page() +当与预留相关的巨页在相应的映射中被分配和实例化时,预留就被消耗了。该分配是在函数alloc_hugetlb_folio() 中进行的:: - struct page *alloc_huge_page(struct vm_area_struct *vma, + struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve) -alloc_huge_page被传递给一个VMA指针和一个虚拟地址,因此它可以查阅预留映射以确定是否存在预留。 -此外,alloc_huge_page需要一个参数avoid_reserve,该参数表示即使看起来已经为指定的地址预留了 +alloc_hugetlb_folio被传递给一个VMA指针和一个虚拟地址,因此它可以查阅预留映射以确定是否存在预留。 +此外,alloc_hugetlb_folio需要一个参数avoid_reserve,该参数表示即使看起来已经为指定的地址预留了 预留,也不应该使用预留。avoid_reserve参数最常被用于写时拷贝和页面迁移的情况下,即现有页面的额 外拷贝被分配。 @@ -162,7 +162,7 @@ vma_needs_reservation()返回的值通常为0或1。如果该地址存在预留 确定预留是否存在并可用于分配后,调用dequeue_huge_page_vma()函数。这个函数需要两个与预留有关 的参数: -- avoid_reserve,这是传递给alloc_huge_page()的同一个值/参数。 +- avoid_reserve,这是传递给alloc_hugetlb_folio()的同一个值/参数。 - chg,尽管这个参数的类型是long,但只有0或1的值被传递给dequeue_huge_page_vma。如果该值为0, 则表明存在预留(关于可能的问题,请参见 “预留和内存策略” 一节)。如果值 为1,则表示不存在预留,如果可能的话,必须从全局空闲池中取出该页。 @@ -179,7 +179,7 @@ free_huge_pages的值被递减。如果有一个与该页相关的预留,将 的剩余巨页和超额分配的问题。即使分配了一个多余的页面,也会进行与上面一样的基于预留的调整: SetPagePrivate(page) 和 resv_huge_pages--. -在获得一个新的巨页后,(page)->private被设置为与该页面相关的子池的值,如果它存在的话。当页 +在获得一个新的巨页后,(folio)->_hugetlb_subpool被设置为与该页面相关的子池的值,如果它存在的话。当页 面被释放时,这将被用于子池的计数。 然后调用函数vma_commit_reservation(),根据预留的消耗情况调整预留映射。一般来说,这涉及 @@ -199,7 +199,7 @@ SetPagePrivate(page)和resv_huge_pages-。 已经存在,所以不做任何改变。然而,如果共享映射中没有预留,或者这是一个私有映射,则必须创建 一个新的条目。 -在alloc_huge_page()开始调用vma_needs_reservation()和页面分配后调用 +在alloc_hugetlb_folio()开始调用vma_needs_reservation()和页面分配后调用 vma_commit_reservation()之间,预留映射有可能被改变。如果hugetlb_reserve_pages在共 享映射中为同一页面被调用,这将是可能的。在这种情况下,预留计数和子池空闲页计数会有一个偏差。 这种罕见的情况可以通过比较vma_needs_reservation和vma_commit_reservation的返回值来