From patchwork Fri Jan 13 22:30:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13101705 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 58FF4C677F1 for ; Fri, 13 Jan 2023 22:31:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05EB88E0001; Fri, 13 Jan 2023 17:31:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F2CEE8E0005; Fri, 13 Jan 2023 17:31:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D09E38E0006; Fri, 13 Jan 2023 17:31:42 -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 BD0708E0001 for ; Fri, 13 Jan 2023 17:31:42 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8A6AE1405A7 for ; Fri, 13 Jan 2023 22:31:42 +0000 (UTC) X-FDA: 80351224044.07.596E28A Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 4435E120008 for ; Fri, 13 Jan 2023 22:31:39 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=BkMwvgpk; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cMGE4ulw; spf=pass (imf29.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"); 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=1673649099; 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=t+cvMLTPBSJVaKyqZq16czoCTbRPJGAIrZqEk13/WdQ=; b=5GQMXRkgeAJgMiJh9BcAybDfVLZiAlxkkt2TTlPxBGKJl9y7Xnsr3PDZtMKpYmcAVsOaXq eh83Ayvetr/7asa/8Mzpgx9RMcaRJfFjQcGcph9NyQUNuYADtSFVl5ukWfuYbjtO3OtlXO lqHlwnDLcbWm4eUqeG2t0Atqr8usK68= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=BkMwvgpk; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cMGE4ulw; spf=pass (imf29.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"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673649099; a=rsa-sha256; cv=pass; b=jWXNnDV/qMUxB7kfgk41WVyU59JUEOtLr68ySDftkjBU16W7PA97Yu7ExLQ0+Ype0i8c1W hzDw2t5lETGzYd4+B7wWamKd8dY7cRAaxKndlMsAC1VKg3kT/XHL2vd+6U7esb3NRUNixI C+Qdfkk/okIKs/qdzeRf9i8DfmEEWZM= 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 30DLYhXA015860; Fri, 13 Jan 2023 22:31:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=t+cvMLTPBSJVaKyqZq16czoCTbRPJGAIrZqEk13/WdQ=; b=BkMwvgpkHMHYZs60YEuxguveKpDekLEieUkqDY63SGcGS6MHu7cbaqMwkGNe7Gcy1989 VJukAQ/lIAb6GIEo6mXCWLbvrizCc8hlK7NUUH6vQCbixIdn/mPmhXN7T1bj91pw7Sy6 g87ZaoICW5FLYpeQqHNtzRLPrFeyDtHlOcUtpHEkYw8xDXXsK2q77A+MTvSUU55bpugp xyFUku/a/6ZGSmdLFeglBk1IZH9njIFIUswikzKOYyzZh9uA2tjh5L43azDo2p0IMDA1 EAovBQTGnMrnFmTGM4dx24LdNshJGmM4nnuJYdKM0+jWvZalB221bPIgiCjbH8bNZgun 1Q== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3av80ph3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:08 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30DLJ7X8031512; Fri, 13 Jan 2023 22:31:06 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n3f3y20wp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XUdOFVYAKez53r7jPZAOY/yzSkob3k6/ywTazpL5AkFsA/pBF1/Ceu4fWYt4frMMaexWrocc5KeBI0DJOI8TPRcDCHjMhJaNpalXBoAENxhflJDZ4qCPTqRCrz1wvNRZ4L9EC564sliEMex1xoWoJagijAONO1+mzsRep7NDgLjWeJmaAL9Q6seINLsoBhb7Nb7xAffIb+Wb3U19g3qgSkaJOaU9pcrvJKcfijDpCuwxrX7xTALuCtoQ0wC90dGL1Cgh+b68/0tNEEkQai+wrqZC0Qi6W3LWGl4cSBKJyj8J29D7XR50b3jzhgiFpo72a++nu0aR6beFykP6l7AP6A== 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=t+cvMLTPBSJVaKyqZq16czoCTbRPJGAIrZqEk13/WdQ=; b=hWtI31Hp79cZW5pBm8EinHumPN3RAHhe8t3r2D00LiXlafjabCGemNn+jnt6+zYHucLX/2KeUo/7h3yDXWuK904EjHdvqjS8mdqtlcb62j1J1KrlCaezbO+WxXN9zbSQeZl6FB1QOobVlgDjcyI/9HV0FbI6zIiqVY5FzeXuy2m5gkax0guVWzoMw8BjGxwnJjw/HPkN62UxdGP1Ow9oBp1NQIk3TiWzmjo2EuaLbQGIUvKvGfiTKRS0W3FR8sHYKK9GO6NBjzc5V0kDdVTV9rUawBeY+sPrXFaJ6x0QBVbMvBB6dfMl1djPcIpd/fKGSENE1KmNoWVEXE+Bx4XKqw== 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=t+cvMLTPBSJVaKyqZq16czoCTbRPJGAIrZqEk13/WdQ=; b=cMGE4ulwxFlGnDlBLqZgf7xwdKw81CCe0eta3LHP/siB0FKuAmz2ujrui0bADS8+Jun4G1XRbgcq2CijLeCMm2l4+9E+fjPRxd4gBn4qfFHwAvLJgPmE5619DbTZiyWl+wvG+/bf6QrarHdF1k5nfSNkMxzd5MplAowxAYw8WXQ= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by IA0PR10MB7326.namprd10.prod.outlook.com (2603:10b6:208:40d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 22:31:04 +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; Fri, 13 Jan 2023 22:31:04 +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 mm-unstable v3 1/8] mm/hugetlb: convert isolate_hugetlb to folios Date: Fri, 13 Jan 2023 16:30:50 -0600 Message-Id: <20230113223057.173292-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113223057.173292-1-sidhartha.kumar@oracle.com> References: <20230113223057.173292-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH2PR02CA0001.namprd02.prod.outlook.com (2603:10b6:610:4e::11) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|IA0PR10MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: db1858b1-774a-44a1-624a-08daf5b5dadd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2UbRuZBdy1xcpq8yRSO+qqYaVg7AX0hFLRmnhC7tQDKwpdpOtjKx72SfHlX7ACovXPv22khdvi4IRoYFzJnORytrFhauHJ7ZZzTrUSk9hBSaHhptwIU6Dvd9gGcZdrhOTOUAPnJd9NctsuZPrJuej3xOXb+jLla4xP1B37FfXu9tIChPFEkWfPATNYDyNCMqSI5OpEQIO/pb52waG4lxz1dqrQCYdFp/N3JxNqnaGP4HHNYR2aFhK8Dm4OkqIBARkQKuAhAyGGK6nC4hVu3iSepeAEunkX2mvVjitniaGogBk2pXtnrVchmDSL8Et8McpXbxCmk71/sCJ55EIztDbs+UR3bPNt5bu4YyQz9jKl8i2nYlBOyswqZs3A4ViHmYXc2WUDUQw9gLAvQoM1uk+bbTjl0UpJlVzzkHQrkPmkAGrxgb0aRiBCu27SntiOlK4jtk8HM45P+bSFH2H4C7T4wcxNE0eRo1THeEwutqeqxfsMgYRpwQXHfgsoEQgsK/9jiXYZx1OI85tNYyvRd2QJ2ftBh77fsKo9nlssHdL7cBUzidG5dmPnjCZEa35kFgHupmbCbNobGmdk3kqzMHeSoTAy+tnvm3sk42jyulfkcLTdFnLMA+ZR8z8vSVMf2DOW89/4LwJHXjt5uuS/KpdA== 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(83380400001)(44832011)(38100700002)(86362001)(2906002)(41300700001)(8936002)(5660300002)(6666004)(107886003)(478600001)(6506007)(1076003)(2616005)(26005)(186003)(6512007)(8676002)(66556008)(316002)(4326008)(66946007)(6486002)(66476007)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xfn+H1Ao5WoNGwaQOUABfOEPzn8MZSAZrkuxlgJYtoZ3EWHKm8vDAakiq0jU72t4GjTJFXr2rHktnol5gmpQa8apSEILL2saaOHEKV1QYAgC3whkdNaBpPfmg7v9wU/mtsBbg/i5zTIC+SK37yf3B7kbfSu9cSDR5/FktFMIMM6Zu80lMKHKRAYuLe1g3Yyk/0puwumxpkPzSGJECGybbHUeYMPay8nH9puLQUTfvV/sV2Yd3yZH/mIIghLzBDr6XtcC5PHCnRohuEvN8u8Qy7WIj8jeTsUoxVLH1Mh3AuxvQAMXBJmCXmLYItV4lgYPV019AnK10176uRvHbmTvpNHjq6fqUEdAw3wF/+z2zVoV+l41wKHryMZ5GMIabFoFVeolIjr9uQYWUaETzanudBHjAHyFcURWMiLVWvDTrirDxIVTOE+vXIYajAlxWY+PB35b2uEl1hap6AcgjJ/pyrFeBAWXrc1owJI0cI3WdjSDFdIDxUO4palN8+qeVMs1n1HA6/y4v2o8JCtDmgb6D2oXmkWmqzr7AV3L77BN7JF3jgHNhLytgWv7v/I3C23ifweu3TVrhHgAQoPmEcnelMDgdaZH8J+WpU46/WWbv9tc7bJ0moIvSuAegJ1XpPIqg4GAV3/xgAnmVi7X9eb1+uLoSrd6XciRMAtpflcxXnPMje5eKRS6LHlVKOFsV68ZRM4dq5WPGtV55Ef7zACBjyieRdv15EGqpplWsHdHcBJPNkbMbLeM3myPwV6QMmrr0Najc3hZBpWUqfAbHGDLvjfdVliPpN3Rpjpb+5Efq0M+1Ui4blEpG0lXH60TrWBai2jqivHHfjF+egLcURnzuqLE+Omkte/42RNY8CsAXRP1HZIirUn+pKAl/f747DRDinhMShPprkOyXYmH8VapATW4aN44kJ53h9YuKq2BkpSxYDZnFkw42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E/TQ6FP1GQZrU7LSOUfPMVl4lPjHgPPnRo1T9EaUgQ3F+Pdjq22HKr75riPr9BFZzLcZcOV97oyiVArXNnRqCOUsBhekVQVikDyPM6khkGNu4uNMTOTpe8rxjYyRGIGm+Hkg6OVLjaQh5Ibz6+7WAz/AjNMHe/KGkMo/C/TuIuHK8QuKkpCfXuDSL0sDHY3RlyA6Zb+9+0VVj3WDT1SUzSZayLuEsVoWErSCsloUvRPFHqQLMDNFZ9zQYfEIFNV/DVe9K8ovndRGjw61oMZU+vS6Sv+AiOrDwj8GhU9CS9TstFGU+9/5Pmt3Gva4kSWFILgNRVLagGBrRTZ/rW0TkYUewy7YfvuUrtZE6L0ip5jkqm70cBgMXhzKSj8bqhFTv9Ug/4H8hau4oucS9ZSHij73k2WN51L0u7bx3rZmhS667G+olSz79/bfDV9J77oO9f5QvD49VZwqK/slfAn+8rbxjc4X0xnEbCVHv7snlYDmIjfu3JDZcDqRVhche04riI/Kp8FVe00NUktH0mAUJgqt6onwm5Ciq8hR0MI8VgljiygxjlMPTXs9LDu0I3KAZx7bWptl1KFnGnHPK/9AxUaX+A81NImqx4DsjQV1ygxLfA8ez X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: db1858b1-774a-44a1-624a-08daf5b5dadd X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 22:31:04.0404 (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: c57UxOF1Lft875HDJYChWlYmnRTfaqugZBt1iejspZv0QXXIPk2jDCs9f6RvcLyfyqq6IshZmjh2q/3xtCU4uf5KZYfTZqo1zuT348BYzAA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7326 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_10,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 mlxlogscore=823 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130154 X-Proofpoint-ORIG-GUID: xSUdV6INIKqzmjeR1zNO8GvwqaYNOMw0 X-Proofpoint-GUID: xSUdV6INIKqzmjeR1zNO8GvwqaYNOMw0 X-Rspamd-Queue-Id: 4435E120008 X-Stat-Signature: hk4nqcu4gbymubjhj6jwgk3im4ogksif X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1673649099-691006 X-HE-Meta: U2FsdGVkX18ajYKmLSyUYBY71DHUbgLLPJt4pDxyWhKcOOGse18KOnCTp8a5McoMp7y84qa5iT7jPTZtpR4LomhmfbLLNCzOUOmOGoDy4VyDLGWrieVOXLhj4MaGvfIPTdUXrlu0S4d0F3CIo9gdTtyGmIW5iiY7ej3TrgoWrOfncmOvYv/oR1k7DwANNzKe8WJvoyiNgJZne1hxU9iBOtSMXjTZHBJW6XCs6VcZCJRZIbwJTRSt/2FKpOreS2HYHdBsX0CjDdOGO64ESHnDBPhuL1bLFG0FQNQG+0nQCaV0WDPZVhqrLB7aOolsREliFtbx7i5SWT0mCbARe7kjL3ZrAA5GnsH8k8Y+NccNqnfVlESO4AoHfi1JG6O5hpeWY6aa3M4S6gUo9DXzcB3g/YxrKg4+Xs8ibv2flc3dde2mP26b1v681N4gcKl81Ym21hDR8NZv4dLXQEFGSxxNNNUaRwjVBnWdGds3Ar9a868D+w4DLN9o0/Dwk1WTQpXrsA+8QSBEsRn5/4clOwwQqbob9EwflLa5DEekwk3v2BTXshXEN6aRxZNBTZppHKjq9j3B07AAvu/saEz0csCwlFoqS066ELVkY6bYRGZiCH1HZlkQWYh0h3kUrBRib+lovpXFjAzw7ZMyeLzJCSnA6TSZ5os9d6iJEDBRShNMKVYhe16e46RQuBilnYmt3p4I9iEmU/LDeQo4Ddmyd/Q1AhPbLmh8eGDrRdaXdyfI4PomdU6H0C1Fyw3S5ZloTKjKSUlV4Gpx37eYi4gmmniM+ITxUe9r8TAVAP5oRND+iEEtOhgLU2pcXLVUG10VruKxqbWkYZ0SUU8HkiUDBB7ATvBCo6WHSlItScYa+GRRioo6uCQfBE9Xq0lKoLy4HLJxI6dyQKeSZ+MNd3CuFkwPkgGkT3S8TLICje/0F4SGl28BoVvC2sD2/6qTDirQ0kCaKcQ1OOE+mtouX0DxkfM TQ6Ulv+l sQrmI21/ltFWC3zZrzagxkhSImvF8YzEp2nHTkn3agk042Met5JNg3Psm7/c3oYmYO5b4w38RA9SPX2tSleclk1QN2MdfBK/BJOb0DouSZVtGJmR+tfZoMclEXXzFTwLchjlrao+FxZ31So/WZ2hZPYgpFg== 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 isolate_hugetlb() to take in a folio and convert its callers to pass a folio. Use page_folio() to convert the callers to use a folio is safe as isolate_hugetlb() operates on a head page. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- include/linux/hugetlb.h | 4 ++-- mm/gup.c | 2 +- mm/hugetlb.c | 16 ++++++++-------- mm/memory-failure.c | 2 +- mm/memory_hotplug.c | 2 +- mm/mempolicy.c | 2 +- mm/migrate.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 551834cd5299..482929b2d044 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -169,7 +169,7 @@ bool hugetlb_reserve_pages(struct inode *inode, long from, long to, vm_flags_t vm_flags); long hugetlb_unreserve_pages(struct inode *inode, long start, long end, long freed); -int isolate_hugetlb(struct page *page, struct list_head *list); +int isolate_hugetlb(struct folio *folio, struct list_head *list); int get_hwpoison_huge_page(struct page *page, bool *hugetlb, bool unpoison); int get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared); @@ -374,7 +374,7 @@ static inline pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr, return NULL; } -static inline int isolate_hugetlb(struct page *page, struct list_head *list) +static inline int isolate_hugetlb(struct folio *folio, struct list_head *list) { return -EBUSY; } diff --git a/mm/gup.c b/mm/gup.c index 5182abaaecde..bdb00b9df89e 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1843,7 +1843,7 @@ static unsigned long collect_longterm_unpinnable_pages( continue; if (folio_test_hugetlb(folio)) { - isolate_hugetlb(&folio->page, movable_page_list); + isolate_hugetlb(folio, movable_page_list); continue; } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 0c58f6519b9a..540f33d8cc51 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2781,7 +2781,7 @@ static int alloc_and_dissolve_hugetlb_folio(struct hstate *h, * Fail with -EBUSY if not possible. */ spin_unlock_irq(&hugetlb_lock); - ret = isolate_hugetlb(&old_folio->page, list); + ret = isolate_hugetlb(old_folio, list); spin_lock_irq(&hugetlb_lock); goto free_new; } else if (!folio_test_hugetlb_freed(old_folio)) { @@ -2856,7 +2856,7 @@ int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list) if (hstate_is_gigantic(h)) return -ENOMEM; - if (folio_ref_count(folio) && !isolate_hugetlb(&folio->page, list)) + if (folio_ref_count(folio) && !isolate_hugetlb(folio, list)) ret = 0; else if (!folio_ref_count(folio)) ret = alloc_and_dissolve_hugetlb_folio(h, folio, list); @@ -7271,19 +7271,19 @@ __weak unsigned long hugetlb_mask_last_page(struct hstate *h) * These functions are overwritable if your architecture needs its own * behavior. */ -int isolate_hugetlb(struct page *page, struct list_head *list) +int isolate_hugetlb(struct folio *folio, struct list_head *list) { int ret = 0; spin_lock_irq(&hugetlb_lock); - if (!PageHeadHuge(page) || - !HPageMigratable(page) || - !get_page_unless_zero(page)) { + if (!folio_test_hugetlb(folio) || + !folio_test_hugetlb_migratable(folio) || + !folio_try_get(folio)) { ret = -EBUSY; goto unlock; } - ClearHPageMigratable(page); - list_move_tail(&page->lru, list); + folio_clear_hugetlb_migratable(folio); + list_move_tail(&folio->lru, list); unlock: spin_unlock_irq(&hugetlb_lock); return ret; diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c77a9e37e27e..9a80d7830b40 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2437,7 +2437,7 @@ static bool isolate_page(struct page *page, struct list_head *pagelist) bool isolated = false; if (PageHuge(page)) { - isolated = !isolate_hugetlb(page, pagelist); + isolated = !isolate_hugetlb(page_folio(page), pagelist); } else { bool lru = !__PageMovable(page); diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index fd40f7e9f176..a1e8c3e9ab08 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1641,7 +1641,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) if (PageHuge(page)) { pfn = page_to_pfn(head) + compound_nr(head) - 1; - isolate_hugetlb(head, &source); + isolate_hugetlb(folio, &source); continue; } else if (PageTransHuge(page)) pfn = page_to_pfn(head) + thp_nr_pages(page) - 1; diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 61aa9aedb728..4e62b26539c9 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -601,7 +601,7 @@ static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, /* With MPOL_MF_MOVE, we migrate only unshared hugepage. */ if (flags & (MPOL_MF_MOVE_ALL) || (flags & MPOL_MF_MOVE && page_mapcount(page) == 1)) { - if (isolate_hugetlb(page, qp->pagelist) && + if (isolate_hugetlb(page_folio(page), qp->pagelist) && (flags & MPOL_MF_STRICT)) /* * Failed to isolate page but allow migrating pages diff --git a/mm/migrate.c b/mm/migrate.c index 4aea647a0180..6932b3d5a9dd 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1732,7 +1732,7 @@ static int add_page_for_migration(struct mm_struct *mm, unsigned long addr, if (PageHuge(page)) { if (PageHead(page)) { - err = isolate_hugetlb(page, pagelist); + err = isolate_hugetlb(page_folio(page), pagelist); if (!err) err = 1; } From patchwork Fri Jan 13 22:30:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13101704 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 C5DF7C6379F for ; Fri, 13 Jan 2023 22:31:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D3068E0003; Fri, 13 Jan 2023 17:31:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 457EE8E0001; Fri, 13 Jan 2023 17:31:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2358C8E0003; Fri, 13 Jan 2023 17:31:42 -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 11A528E0001 for ; Fri, 13 Jan 2023 17:31:42 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D6974160842 for ; Fri, 13 Jan 2023 22:31:41 +0000 (UTC) X-FDA: 80351224002.09.BAC6A46 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf20.hostedemail.com (Postfix) with ESMTP id AD6921C0006 for ; Fri, 13 Jan 2023 22:31:38 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Jw6GqB2h; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=S3Koee86; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf20.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=1673649098; 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=ia/pKYvs485DK07VT5Hlv1uptsr6AIwYUeTt8NNpORU=; b=odUChUnhoLeSc29hKenqWNpJyNh2LYgwyOn7+pQ/LHLtZCR+yqFno4HN0RTBKgEdkFweaY fPnGHOQXuFCbJu4a79JQyohhLzbVWkzLrh8KvRoIBPXEIP2PcruqSQ52uD8vpKKLy54MLj 0Bd4pTRMrAwB31hGZnhyx17+vTPMCMU= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Jw6GqB2h; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=S3Koee86; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf20.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=1673649098; a=rsa-sha256; cv=pass; b=f+x+gH3+DacfnaZpY5UpLnWb2YT5Pa/xFw0INyPdi2n9UAtLV6Ueuri8428XRJkw1TBwDq 4D4JFYEVXWvZe/zjy4mTexGQUGDiO05+RNPpcAurMpC8olobaiBW/m9uaYxhajPeBShHS2 4DC2xGgzpNy7KXXxuj3H57DM9BIHSbo= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30DMV9ff008583; Fri, 13 Jan 2023 22:31: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=ia/pKYvs485DK07VT5Hlv1uptsr6AIwYUeTt8NNpORU=; b=Jw6GqB2hgGTR6Rcc6nIA1Ojc0/hqI1N+I9O7+b5MdZ2Ef8QvGz/LbkLRA4pflql+PWAK fZ849rIRfV7zdTAcYql/7Y7dbsgc/3sApWAELV7dRBjKxh6qxI2FtMq24vcimr10MjQM fYrjxXKulIIFPk36LXmKi15Gua2kKMge2pv1kReJOicYEi4bqKx8mlh1VL01JLGrE+H4 vh9Bs/Wb6m8jLI9vXL0BcZQmkSb/GZJw5Dek84v+eocwphfJicgzzZwobiBSl4w3l/8/ XxdWLFmlJhIr9RWtT1txF16X1WGvOk2GjKA6LS0n46YpomXhmUa4kz8+Yz7dhE6EPoAQ 7g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3e0w09kb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:09 +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 30DKwdj3006706; Fri, 13 Jan 2023 22:31:08 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n3etdjkpm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gfOqV9YRSE+4HTuD/oYDSoVVA9mWBLvgPy5equXLURJaxp6VncCkOXrzk/HCbeHwOn39kibSG/yv/cvSBeQWakNRQC97A3O862tvLjTZ0W05SCY20b0MY/2XpB+YPx3CeFpvnkCM/OY0oFORyzI1xluDrJmJhv7EhIoKrQ1/tQ9pjZ95Qu6d2DgITZXTCNJ70p+RV2tEwM4sydFjZ5u9bEJ45ExOz6Ok/df/ulPvVSrngLc9p11qr+QInWwKbn7kQvSExkc13qbj0clr29cQBhcpuYaWmCd1OWL60Ugi6F6EUPxzaKoZQNP+kyScM1KkNy9Z+6J2IOmqUAmxkEYTiA== 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=ia/pKYvs485DK07VT5Hlv1uptsr6AIwYUeTt8NNpORU=; b=Jq7C+tDpIcCRe1tnouLR5dc9YkLLS0/BQladBDCWnTgXhIAaA9Y193N8AT6xRTapVp8eOcAvdA96MVmSATf+tIRsoXDNggNqTvM7N511SwxKejWDrygogiKM3j0wVr9J+4HrGZCAQb6e2Im9kMz9b+EakDjBNU/WekNNfpilhfvaxY47vp/fsjcbQBpVXabVaPdmpZ07yx0AQH3/BB4G4N7/qOEDYx6GDY7jRYjnrp2PTNtzuLZWrc+qrahwf8+k3WbDUpQYkvfaNriA/8fVPT9vaySYk4/77lZUnVcxdagvXsminnht9U3or9l+LMpiZsHDm/Ml6v1xw+x1mKD6oQ== 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=ia/pKYvs485DK07VT5Hlv1uptsr6AIwYUeTt8NNpORU=; b=S3Koee86dj807nA2lgdskpnLZm7O27RKKF8JRlRWh5WDY4hyearAHyHy1YRLyKtzmPj3YncULqyL1GHNbLMRQMkavxhQH0oDd2VNNzKdAKtt2wNyoJyplZAdQXtbLH+p2MLJlkjx+eRVX5pmY4QRFoO0fEsdx/167HhKI1561Gk= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by IA0PR10MB7326.namprd10.prod.outlook.com (2603:10b6:208:40d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 22:31: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; Fri, 13 Jan 2023 22:31: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 mm-unstable v3 2/8] mm/hugetlb: convert __update_and_free_page() to folios Date: Fri, 13 Jan 2023 16:30:51 -0600 Message-Id: <20230113223057.173292-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113223057.173292-1-sidhartha.kumar@oracle.com> References: <20230113223057.173292-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH2PR04CA0010.namprd04.prod.outlook.com (2603:10b6:610:52::20) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|IA0PR10MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: aa827c21-9c6c-40ec-5b8b-08daf5b5dbe1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2HeMp3wHJmawI74fn8kEuHRKGG0V6gmeHJAyh2k8OcWMvZTMiAfLIFSSQuCxIWGjgMy3NdYNZUXs5FVa6bEHD134apkF4UzmozF627bKTzyt7af51zszm80W7jrAWCArBQYcTuC9drL2nB/L1Nc6TjGasi7yQhh2ccf/a9EPsRYLOjlkg9Koo3ZQ28uOgHFOQJg8D7oxDsLk68MFABqsV7PHSxEd0QQoXe32f/8XbmaYBsUzZiTBy7xbO7pZXCWi9R+ws3qYZ6WY0XVotaBgBPEnc/DPv5a+TvjLfsd3myJ0N5/5bWn6lfS1ITKEjajm7+oyNmLUVBySdRXm1rr+MymenFV4GnFrmTKxEfs9idkwBY/MBgINH1ze4kpJwdMc10xtg4rjt5MzjcorXXabIybMNIP08zdr8nrSSLXuYtSpBx5PBXBHPW9k4M4BNALhCshQMpxz1hf+6ESB0khTXXJytyhKTZRCJ7zxfep2k7WugOX+RgKVZ7xMaId3CFeXnEmMEHOvPb0yDcSZzctFrDCT9PKhfk1dUYnrNvwUpPTUrFfvbiUPEZ9VQ+uh9S4cvlMSEXY++PeWfiMsMJ14I35T534t7n1SjzwWwFVJ+XGx01kH4qEoTJJ7tbjae+5D4sNQ5hCTyWBWmtJ06MJe9Q== 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(83380400001)(44832011)(38100700002)(86362001)(2906002)(41300700001)(8936002)(5660300002)(6666004)(107886003)(478600001)(6506007)(1076003)(2616005)(26005)(186003)(6512007)(8676002)(66556008)(316002)(4326008)(66946007)(6486002)(66476007)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N58X2uiiWbldboHnvSFd8wWeL4HAHyCLj1jMcFBQYWotf/dv6B0xl0aLUv8mOQaoAEQT7RV8NxAIm1a6xWPz+Lp5QmDmyBpr85ySHo8NveRQcX0Ehp+dynKhdR8rG2fmimYjy2x1UDT9hA3ghCFdKGCcVBi6xOExe3r2rgHewZJxf1ZWcFCQO5Y8UdL+/bLOSsp3eaQaBY8pqHM+9DLwyL+fiB1XKjZI4DYA0XCKUHnDwcra4O8bb1RA0Vf1h1i2ORBmCk/yP7OygF7PaIb/oT9V4QtgaMNbe3hJfIYQ6wg95JUPg3Ut9dVRCidMiyMWjhOGofxI0TIWX+Tr5n5w0yh9UMQ2Hj0laB982scZ+MKPWb8BDhPaAKRCuFgLWDa5jd3bHQpciBEcP7PuwAzJaur2gbX9LNk5/GMWopsB55l4ezd+5+OprWThmqZHnDSFP1qsgSwKGQ79O87R2yO29+aZsfzqAjmlrLHW1Rvok131BKopW6QS8kv6PjftKglnwO729SpQ6zLnetY25/RpXa6Gam1OvM+ET0FkC8o+9f0CCQBYYSPcXqyoGIcoiyVGHULT7wrwVovoVRzrBL/iwVxIyvT48FxmUjAMqKcUca3MrepiCbH0SYe0YXT449kGDEsHOIc056kEm78YTu4ZMrzADkOHasHvnj0RcMp5Iw0FLeZciG4TvOaLM482oCFh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cDYRozW2WhJkhIls3mUWI/5mUSMHe20lUz9Ob9AYy2XqgLd+SoQQQ8R41PDdWAowPayVc2Xd2WIsJOYDvr+NAp+Qk0pnETy8dH6zF8sBro0ZH8382Am4Y62TiFOYWtZ9tjlvByEiW19y8ezF2Du5BX7ZcdAW9O2sLyohSRO4oSfMvuFrkPR9f+aDqNVM/tZdTeeyVLm/1Qt+M3o4DR5bz4ohSFbslzCQP09QRqWCGpdUqirXctT7ZwXLc1GFhlNopGGYIvRuPQhI6tov6DBrNU0lpg90aw2R+jBuXCWtxcxlnFQnJOrwUnMMxE9gY3T5OIg7+BYTSQNj8JZx1BK5Gd1HOyKxfRs1t9GQ/6xDo9kfo73tXlRgeHuhrrOJ9frpv13YssWssiKNwG1EODik7w3TbVN1qKsl7xUab9XZzk0sltdN2X7p7IpAhumWnvHQg31sAYdHF4/R0hQYOAKZstVUPsk52WSNZ//3vtzydemCM1+UcrC+SZj9cNOgRL3T4yEBtK361R+KV6R89/WF4tSZgGKNyeApKGglBqMGjIh4aj40WuTYYlx3kvjHULDNnjJMA4rk2vsi+39l5vqdTK5z1BUqsBro9oQQOvZVSGaz5P1nk0Ghlncvxxt67h1E3SA5s+rJzjx6do0acAgBWTPown32h/6G/uaP8yJxNIiO/wQ0lD9tXiUA7vud6J1YDbczkkXrz9gsN/jBTzcaktifQdouiMXHSEjbEfA0mJANcj3VcKhpk9MfxanUbP8vBi6kh4aL2YRGrSpDBmpyrehkwDme1QLno0kTYqvbsdjfN04r6dtyjQDOaVE1pPfpSsUQ7k5W3OpvdZtd6z7bfKhQ44yg607zjzrUBJ6l1rSRrX9wKlLnqY X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa827c21-9c6c-40ec-5b8b-08daf5b5dbe1 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 22:31:05.8366 (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: 4tmrZS6KneDh+V8DCD94HaxelKk6l01bJMEpXEm6nyhl2s+8VpvBldSV1yADOaTg6UIOpbW5bvm0Bh3/cG9EOrinodTrrnRSjFOG1xrcntU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7326 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_10,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130154 X-Proofpoint-ORIG-GUID: y-v1TNK3pjDmSLTPAnL_iSYu4xlVEXCh X-Proofpoint-GUID: y-v1TNK3pjDmSLTPAnL_iSYu4xlVEXCh X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: AD6921C0006 X-Stat-Signature: 961ot4o68mwi8rs7e9zkyekzcx4edhn4 X-HE-Tag: 1673649098-474235 X-HE-Meta: U2FsdGVkX1+8rSyN0WxW1yK/5KfjziQLiEAMHoHtlKC+GmrjoYMkS6m+OOrTlLr7ZvjXbIlxl3ee4EGmj+8bXzA3hon2tucQFYjiURA7+D1Q2mTqM9Q/vgG0eeNNGVspUqSh+qBVwseMwDJRloFt6qHS3zr4v1BSQXeJHEwnkfiVFUy0z+vfEuyDkHZ0221GpdUx4ecelEWN6S9ciJpc28v3gQVIRGCCITFyXvI+b5TVwDn7jP41rG1n11zchtyxrQebkGjMBNDSzfStiNR7s77EfDz5vHkbxAbom/NVB5Tq5ntlZIkEvfz7zJXh9wPnadVBBZdFhdid2ErLfoa5Ke8lr0oILpaOHQeT2Jx7q4vRVHRYkpFX5NprxLOcN1hVv0rOaP5kX5CW3gxsBRddKEXzv0c7gYKk2jOdeISg20ps46FFr7GdsyJEoiBYygp0VRneDu6CWLJDUNcmiZzf6vE2LlK4/XuJwojThwy14+5Qdvt0cLSjp2bqWmWNCKkSYp52r+I8bb5EvvVSN/b/z1znaGCgM6ML/cTbshdOYZ9mcVzOk0gbv6HhfLXTK7u3Ec7qvSGvVmH+qr0O7MRkeTg1dyS7OJGbLDclgKij73s2fa7GOoooa5aRqGy/YsMLYb2sw+2ifxFRXyekpytcAzPXSoMOeeMMbIZFDJ3qIdQb/kIP5tveogR8X7iEVKkp44/1AGz14S/mc/u+Ev7fmAi8+8PZSQTQAdBMI52Xv6SccMFimfVvJ9RKOeZM6dQp2K+wnfMDmApMhYzK3bo43izvbn1XYPezcq7NJYlF1vBpIA0O8WnDyvZc1iayUvzUs7E0GJteAU0I8oYnuDPd9pvltKHqzrRtrzmMpnroCjnrzkx+9RCGgQoQpxwy+VZroOypXyCNMdWStheqnc9GAhBM2u1u8ITEsgwkKfMl5aI5wEOf1BjMlvara3z2i+w5ZtGHYODcKyYXMm729sO /h3KJxKh C7KieoEl6fdlReATkpNww40KHxBIQ/1sEVNpKTn2PMwxxp2KpAvqbar/YcKkXC9hNls5VDeduF4SvLYM1esHAl5THjQLYnQ49lGsdCWnAl5NqmRTneMbKGOJ/UWnMbgE9dlLr4KBJjKcGVjPEPhLU4clN8Q== 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 __update_and_free_page() to __update_and_free_hugetlb_folio() by changing its callers to pass in a folio. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 540f33d8cc51..9155bb5ee570 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1556,10 +1556,10 @@ static void add_hugetlb_folio(struct hstate *h, struct folio *folio, enqueue_hugetlb_folio(h, folio); } -static void __update_and_free_page(struct hstate *h, struct page *page) +static void __update_and_free_hugetlb_folio(struct hstate *h, + struct folio *folio) { int i; - struct folio *folio = page_folio(page); struct page *subpage; if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported()) @@ -1572,7 +1572,7 @@ static void __update_and_free_page(struct hstate *h, struct page *page) if (folio_test_hugetlb_raw_hwp_unreliable(folio)) return; - if (hugetlb_vmemmap_restore(h, page)) { + if (hugetlb_vmemmap_restore(h, &folio->page)) { spin_lock_irq(&hugetlb_lock); /* * If we cannot allocate vmemmap pages, just refuse to free the @@ -1608,7 +1608,7 @@ static void __update_and_free_page(struct hstate *h, struct page *page) destroy_compound_gigantic_folio(folio, huge_page_order(h)); free_gigantic_folio(folio, huge_page_order(h)); } else { - __free_pages(page, huge_page_order(h)); + __free_pages(&folio->page, huge_page_order(h)); } } @@ -1648,7 +1648,7 @@ static void free_hpage_workfn(struct work_struct *work) */ h = size_to_hstate(page_size(page)); - __update_and_free_page(h, page); + __update_and_free_hugetlb_folio(h, page_folio(page)); cond_resched(); } @@ -1665,7 +1665,7 @@ static void update_and_free_hugetlb_folio(struct hstate *h, struct folio *folio, bool atomic) { if (!folio_test_hugetlb_vmemmap_optimized(folio) || !atomic) { - __update_and_free_page(h, &folio->page); + __update_and_free_hugetlb_folio(h, folio); return; } From patchwork Fri Jan 13 22:30:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13101703 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 5E6DFC3DA78 for ; Fri, 13 Jan 2023 22:31:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD2BA8E0002; Fri, 13 Jan 2023 17:31:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B82668E0001; Fri, 13 Jan 2023 17:31:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 986F18E0002; Fri, 13 Jan 2023 17:31:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 862D88E0001 for ; Fri, 13 Jan 2023 17:31:40 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 549938033E for ; Fri, 13 Jan 2023 22:31:40 +0000 (UTC) X-FDA: 80351223960.29.E09BFE5 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf30.hostedemail.com (Postfix) with ESMTP id 2C02180004 for ; Fri, 13 Jan 2023 22:31:36 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=UENJuRBP; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NviBA3+R; spf=pass (imf30.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=1673649097; 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=HWdBF1Wlcs9D9iqHgpLX6ouOUWk7M0HHi9i4cwaLOUU=; b=JT0XJBP9/YuoIPZAX7dSIGbVMjK4/MAlMTd2S15D1tWaWzjJouxbV4i4jOLwVigFyVzcwS p8xetWJypL0RsovCh7VLHnxeloJ9LmMelUFukJ7GM5BVLTzQ2ZiFv1vTEPjycIqfAMTaZc 7XNLpiJWRRU7u20ArvNGD8b9LjDMMDw= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=UENJuRBP; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NviBA3+R; spf=pass (imf30.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=1673649097; a=rsa-sha256; cv=pass; b=C8G5wEi82mymXZ+PI63T72gvo0CHurps7TJmIvwDB/CZ7uPjbn03NRxOg57S1Cm0f/SQ1z DvRhquRP5GVbzNiZ3JL+o17SX13bRnG+CpeLP2CN9jKKOy1fEOz8U/nEYnJvqD1aooPlDW sZBhyKaZ3YYgcAPnvAsyBsOxVTCm8W0= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30DK4LNV017071; Fri, 13 Jan 2023 22:31:10 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=HWdBF1Wlcs9D9iqHgpLX6ouOUWk7M0HHi9i4cwaLOUU=; b=UENJuRBPW6JC9H42G/FhSnfJkedG6DSf/aATX3gsN9YAIET8pf5y97e52Sz9t64Bu3YG 6T+BIkU2lAxjnLNuoKW7Rr07v9mfTPycoEmj/j5Em8y0NcXnwo7B3jxTLmoZev76muD6 D+xc195GpM769uSCepHVO1x0M6zXlTFPchf+D/S4ZnX1KQqfH1r3FEmV8jJOOa0QXe5l ysWjovB2/p4UW66JI4IMxn/tQ8VYeZz7uCuOjgTMZ96zkVBRPSxmUl/HwERG5HPIoDNw FNmjrUbAQpzJYpMxW3iBS8G79e00RbZRe0FngoADuLEhlx8oqi74zf4IHh8UyczgdlhS Zg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0btwwjf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:09 +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 30DKwdj4006706; Fri, 13 Jan 2023 22:31:08 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n3etdjkpm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E1zu5bnjXvSRnfZvO+VvggFUVHPszOSXvDhHqMNy6pckr4vnW5f1D6saqMmP8PMMaUheuIEFdKMFkFPlsM+9ys0k8Uciur6efPXzVNGDWzJVekK1+K3rRO4ahEw66+gS9PKOIpOXNNCemha51ZvJqxglilgPFBCgOWEkcpsccKYNs0yn9qWD83NmvdjaukMOQzc5MI1sR7j4uGSZXyMHO33qUoVXm4PWm5bWqXt+Dp1rYtRwtV6Q3kMlnWlSuAVWWFu96HxCeWXs82PkMG6ORqxbnAAfT4jPg2dpaA8TwJSRnLYGf6ZTTzXhQIR4JyLaNXezEwdVOxkNpnbqdhGrDA== 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=HWdBF1Wlcs9D9iqHgpLX6ouOUWk7M0HHi9i4cwaLOUU=; b=P7FehP0ofzRDQ6xhoE44m2W0kuO5QtNh8ikVpO8DDmaU6QSYPbUUKakhzEgs53slFlkA9c7OvZIufiJAd7x33HlF5Mg2WZMd2qKZdKKoM5tVIOZnFxjlqR6oJs+vJ/baFEmHgZ7cUhslLYF8xSEtx48KfZgMQjH3WsmJ7T4dLoveb4PN3zsb6yPGpRx1SITLSQTeA4pxd2LebXuWKh96R9+YFJColde62S1ZbfZ5mRl0p3LdqI5GNLJ54B4s4xQ1pc9Sdad9hT5Kb0y9IV8hWmgF8mto9w0GOgXKjSiqJObmUUJkHJVLvnuF3Hji5ShKzINVzv5Atya4jvJnumFcuA== 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=HWdBF1Wlcs9D9iqHgpLX6ouOUWk7M0HHi9i4cwaLOUU=; b=NviBA3+RQyD1yy4HVTJH1QjsRviJD2Hq+35K1+7JJL2uSSSOJNzvCm7NtjeijIGFiqdKHddsqjZbbrFqiZFecQMhurh+qy7wYj8wMvE4WMOX0iA8KgUDQGhtxsPYosZMcpbzL00GslI57kch7FzFuDn+VbMuhR7jbYKdj4eNZ7U= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by IA0PR10MB7326.namprd10.prod.outlook.com (2603:10b6:208:40d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 22:31:07 +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; Fri, 13 Jan 2023 22:31:07 +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 mm-unstable v3 3/8] mm/hugetlb: convert dequeue_hugetlb_page functions to folios Date: Fri, 13 Jan 2023 16:30:52 -0600 Message-Id: <20230113223057.173292-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113223057.173292-1-sidhartha.kumar@oracle.com> References: <20230113223057.173292-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH2PR04CA0006.namprd04.prod.outlook.com (2603:10b6:610:52::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_|IA0PR10MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 310e7877-a5ad-4ccb-8c05-08daf5b5dcec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q6GSPKYmSIORPbHfUeUvMuYTTqdKYkmYju/D4e7ODsy9DIFE1W1r/HYkcPDh0htgInvItTPtWt/3HMwwWySrP7G2D5inUiSvIJ9g/lrEoiTc1iA2DowTfZq7R3GH63pNMkR43v9K1jsLA2yWb0oYURbOXZXOG//7D4CYeWzgQeQfbY48QxcuwFDRVZ/vVaxxKhR/mpz6gHuwUueAwk0zN9WMCKRhnK7RbW7e72M4gP5ndbFF+yAafk441pYG9qBxlUL5loBnc9k8Y4o1ZyrFlSAmJNa7u0IGs2iIa5gSF+C2eEr4ni36d/iYpfYn5k+KQKuT8Rrp2xQu/+cKfM++8gWK6b44vyTO75FVheyGHhz+qGmt10H0GMvND1uA4suWkYzMA1ExqxObvMFE0yn0uD52BEhhUPL1HLBHMP9zZ7b672JfhmdgQxTuD288ZKRBZFaRgLjsoeCOw5vRR2wfHnCrUAp6DkhtMdDfPNJWl0HdvxfLuD3R1egcXzq012SYdVCERyQWq5Im2+ihRITHRD/L0Gub1iExT0R60ci16MxedloZ58poLHPBpC/q6ReVgNuvY0o0MAndUlskK4ypp5izT8cVdPgLD5GExGWB++dgtAslNSVy9nO0JO68DWkEXqeCok9cNkzOubOUmUaDZQ== 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(83380400001)(44832011)(38100700002)(86362001)(2906002)(41300700001)(8936002)(5660300002)(6666004)(107886003)(478600001)(6506007)(1076003)(2616005)(26005)(186003)(6512007)(8676002)(66556008)(316002)(4326008)(66946007)(6486002)(66476007)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TcKLX/1KKs6Xz6QfgDdFHniUobMiEuorpQvnpEgmLto02NgK3hhB0GeMj+Dh2q6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BDQLKfmRSKkCEyzp3CQYOyqfwArHscYbhpoFpANwzgFxVevXlISnkpM+1ImRkh7IL249g0eypJ3d2Y/MD5zlmjUci90oADAFFCy+D8/ANwMN4ZPfdoDTzAoCPLlxCI6axQoHUx4Gxc6OCJYwDg4BcaVHli9E3sdtbIyXN8JSv0+wE36URO1Unh5lJvVZIeIKLtAlLqFElHyw0bx9YA1v6T6tpX7laJrZP6hdKRAF90SqV1S9oW3gzfRWaQeUEaOq8HIJdwZgPlXjE/chi2F0np8+KP4mp/pQnfNx2jG4GdpixBRBlyXUg+OjNp5EYeSL7epL6XTmBFVrl7ScCi410fHEqPNjG7HYr4qPWyyWU8OXG5wbU6Kh+caSthpEPy4zHXG9WVSDibQXv6AWGP7p2tTjkUNeByPKE7OiRIyGorSSgW8TPpIultV8itp7tzPYlyaX6s2JyrVady6j X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 310e7877-a5ad-4ccb-8c05-08daf5b5dcec X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 22:31:07.4003 (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: eXg2HmkNdzZHV8w4wG19ZgV4Nx2d1KOUxc9rHeltLpI/uB/lFFlvhpKUwguQPBwwk/leKh7apEhiib6n7qOkKeFItobwh3B4fixcymqHSWg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7326 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_10,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130154 X-Proofpoint-GUID: UwhZjTw3rZ1-cxucN7E9ckJqDl7cuW1e X-Proofpoint-ORIG-GUID: UwhZjTw3rZ1-cxucN7E9ckJqDl7cuW1e X-Rspamd-Queue-Id: 2C02180004 X-Stat-Signature: qp38oaih8cxt86z47fk3ssgwpbthazb3 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1673649096-600954 X-HE-Meta: U2FsdGVkX1968dAu2RUn+TN1b5OeLsgwdy2tcKKCtyytCzqcv19+D5D+UUwIqdBru3DC/a0LvCBJmHCa1z9kkAvj+BNAPDei14IjRKJs48hR4uyicUSSgYi+BZ/76Vy2I6Moa6tSvSl5rQJhjngIAD+d0O9ywnMbuBYmHIH1RuKzQafLjpLPqc2LC21hWH4zdQJ/QshrzLxoGuUT+O+SHLyV+Clqq75bBfO02RHmCuqJ9C352uef7Mj75SWOQfNnNg25CCLDEZl8EiqbNgXVpddPk8L7mmCFTvcnlhWUle6YZODKBBcNkCa7HncmnygBNTmkOSF+3KZuiy449NNvpbmzangn0eKW78A/0SasRZ7VItFWnrvPztQrNZB/DetxGKigrFjmvlikosmOEPVtcxw3DBk4qzYs0sD200CzK3z2yijTjE6iVGNGSWIuM8L9yYebRbm3JWBebMBSZLzjXLvGY8RMSmZ514oicrxo80EGIRxGr7n0VU6bnDkfjZwGaUZRkosTrEbgbZn63Lgcn5IZSvouryFs0dkSOKQt59r5fg19YYFJzEr07Hw4fFokba8kbsAZvcFRksXqyr5cIVqCH9wWc2xHIVhuvQ/YxBeFKd4scwi/BB8beJYeaN47wh1eanFqqexC96XWyLrb/1MDKVRDwZz2yxbJ38vX/FwBwA6RakYrtHYXzoBzKuES2ObIbBY/h8zUv97d0ejqyAnlKaROfqoAKuP8KI/XWFTA398RZUbcNN/obEoIyUx+1oY0Umr8VRR6pXkL/LmNQvx4lyoy60qebZbiS2fBl4O9nj1CQ0vpzocqIl1qoIVjjt442vbsCYS4ItJTyvHB/A9DRgwJhT9igz+47hzaKRH26kux4l2Nmxd0y03pstSa4bqBcYXX6LZWDJI5JsjZDYjEzuS3U28JblrAWrZaplbjfVuDjw455mEL1QM6rc6cKepiNz1dD2wIE9aZ3M2 pjXFo9A4 b3GT79oJaVpRo7sOX7ZTJQ/UxzuUHgw6WgyDHtKFPGeVyEnsU3JTvLlW1DfTS2toLg+WIffFwUxVhGaIJastditgDdQINC/agN2ub4269i48ZzdtXeQFU6EcyewZZKjSni4OeEmO0IPfwhCxjENJSisaItQ== 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: dequeue_huge_page_node_exact() is changed to dequeue_hugetlb_folio_node_ exact() and dequeue_huge_page_nodemask() is changed to dequeue_hugetlb_ folio_nodemask(). Update their callers to pass in a folio. Signed-off-by: Sidhartha Kumar --- mm/hugetlb.c | 56 ++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 9155bb5ee570..c206a8c1ddb6 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1140,32 +1140,33 @@ static void enqueue_hugetlb_folio(struct hstate *h, struct folio *folio) folio_set_hugetlb_freed(folio); } -static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid) +static struct folio *dequeue_hugetlb_folio_node_exact(struct hstate *h, + int nid) { - struct page *page; + struct folio *folio; bool pin = !!(current->flags & PF_MEMALLOC_PIN); lockdep_assert_held(&hugetlb_lock); - list_for_each_entry(page, &h->hugepage_freelists[nid], lru) { - if (pin && !is_longterm_pinnable_page(page)) + list_for_each_entry(folio, &h->hugepage_freelists[nid], lru) { + if (pin && !folio_is_longterm_pinnable(folio)) continue; - if (PageHWPoison(page)) + if (folio_test_hwpoison(folio)) continue; - list_move(&page->lru, &h->hugepage_activelist); - set_page_refcounted(page); - ClearHPageFreed(page); + list_move(&folio->lru, &h->hugepage_activelist); + folio_ref_unfreeze(folio, 1); + folio_clear_hugetlb_freed(folio); h->free_huge_pages--; h->free_huge_pages_node[nid]--; - return page; + return folio; } return NULL; } -static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, int nid, - nodemask_t *nmask) +static struct folio *dequeue_hugetlb_folio_nodemask(struct hstate *h, gfp_t gfp_mask, + int nid, nodemask_t *nmask) { unsigned int cpuset_mems_cookie; struct zonelist *zonelist; @@ -1178,7 +1179,7 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, retry_cpuset: cpuset_mems_cookie = read_mems_allowed_begin(); for_each_zone_zonelist_nodemask(zone, z, zonelist, gfp_zone(gfp_mask), nmask) { - struct page *page; + struct folio *folio; if (!cpuset_zone_allowed(zone, gfp_mask)) continue; @@ -1190,9 +1191,9 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, continue; node = zone_to_nid(zone); - page = dequeue_huge_page_node_exact(h, node); - if (page) - return page; + folio = dequeue_hugetlb_folio_node_exact(h, node); + if (folio) + return folio; } if (unlikely(read_mems_allowed_retry(cpuset_mems_cookie))) goto retry_cpuset; @@ -1210,7 +1211,7 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, unsigned long address, int avoid_reserve, long chg) { - struct page *page = NULL; + struct folio *folio = NULL; struct mempolicy *mpol; gfp_t gfp_mask; nodemask_t *nodemask; @@ -1232,22 +1233,24 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, nid = huge_node(vma, address, gfp_mask, &mpol, &nodemask); if (mpol_is_preferred_many(mpol)) { - page = dequeue_huge_page_nodemask(h, gfp_mask, nid, nodemask); + folio = dequeue_hugetlb_folio_nodemask(h, gfp_mask, + nid, nodemask); /* Fallback to all nodes if page==NULL */ nodemask = NULL; } - if (!page) - page = dequeue_huge_page_nodemask(h, gfp_mask, nid, nodemask); + if (!folio) + folio = dequeue_hugetlb_folio_nodemask(h, gfp_mask, + nid, nodemask); - if (page && !avoid_reserve && vma_has_reserves(vma, chg)) { - SetHPageRestoreReserve(page); + if (folio && !avoid_reserve && vma_has_reserves(vma, chg)) { + folio_set_hugetlb_restore_reserve(folio); h->resv_huge_pages--; } mpol_cond_put(mpol); - return page; + return &folio->page; err: return NULL; @@ -2331,12 +2334,13 @@ struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, { spin_lock_irq(&hugetlb_lock); if (available_huge_pages(h)) { - struct page *page; + struct folio *folio; - page = dequeue_huge_page_nodemask(h, gfp_mask, preferred_nid, nmask); - if (page) { + folio = dequeue_hugetlb_folio_nodemask(h, gfp_mask, + preferred_nid, nmask); + if (folio) { spin_unlock_irq(&hugetlb_lock); - return page; + return &folio->page; } } spin_unlock_irq(&hugetlb_lock); From patchwork Fri Jan 13 22:30:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13101712 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 03345C3DA78 for ; Fri, 13 Jan 2023 22:46:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75A7E8E0002; Fri, 13 Jan 2023 17:46:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 70AA38E0001; Fri, 13 Jan 2023 17:46:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 535EE8E0002; Fri, 13 Jan 2023 17:46:49 -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 415FB8E0001 for ; Fri, 13 Jan 2023 17:46:49 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 10F3EA0A0A for ; Fri, 13 Jan 2023 22:46:49 +0000 (UTC) X-FDA: 80351262138.05.466881B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf07.hostedemail.com (Postfix) with ESMTP id BE1024000C for ; Fri, 13 Jan 2023 22:46:45 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=cymAnCJ0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=uqKY72Dz; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf07.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=1673650006; 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=8LXZYJ3IF5YwIJs7/2QVzJbgQ0tay2z86vhYBUXlFls=; b=E6drzL7peaAWzpApx+Ke8NBhkT/k/1xCQkKEff5A1Fy2jgqtQkciRgrcMCk8qnPPCmulQn 8qbHphbRC5wQuECjWAOzK3r7qv3dEoEXG5k3cdsBt4ubadnnBOWRJREA+FDwSBIn3uN1bd hh6u+PF8TO4k1SdOCzcMjj84g340jeo= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=cymAnCJ0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=uqKY72Dz; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf07.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=1673650006; a=rsa-sha256; cv=pass; b=JDfnjW5hIzYRsGm4GvPJ75cUqWQE8HeBP6D11hD2+mgz58b8N+MGYSt4NRpEGpzPStOOQ2 yUxdofWApvVoF653Wj4rz0htz/sA/woIPqzaLIh1ydGVkmrklcz/z2qnYrArAOkvrq4Blq 31yWvEpTjDhQKh8owZ5tf7hfdY2Hh/4= 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 30DK47gf017334; Fri, 13 Jan 2023 22:46: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=8LXZYJ3IF5YwIJs7/2QVzJbgQ0tay2z86vhYBUXlFls=; b=cymAnCJ0l5okh3YPHT1RkPIRHOwWDAIU8AjWERzlrPJSsu3HjQ3CthmR0hF1mQiKpTJo ztP1wxs+iB8u2/S5RvchhWC43tbW0gBzuxnyh+3MhnzjMWlqIeuBcV/tdOwNJvHM11mN ER7lkIvfQR+AGUJgi7ys/pa6DtHFHM02oUc4Y9JMeYJGA+tLGsag4ZvNiWPxzNYpOj/4 TXYR9IMPW2pQaLafS67S/dsLjwSgF+FDbqik6uHSWtAjgpJYR0LP3pDmi5zOj0UHhgKz Eg3pcmXrIvkiMqNgE3AhmsO8CENs+OQ9AvxGp2wIANNT+rZ3x7YYGVKxH6CkNMFz01L0 5w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3dxhrakw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:46:26 +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 30DLRUnj004403; Fri, 13 Jan 2023 22:31:11 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n3f7usqt7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R3uCTLA4abyH2sk9K35xHo9IIcjUCK9YRr7TzgpZMGnoiATaZ/+FNVJlASE4rssoojkR0ut+fBlkLEatY4+ihehwnLkKow4xfidbR7hZhWnwUQ584Zz9AvXxKbACJpicrNRampd9viQ6Pwxx41ETzpRXjP+pStyS8oe+lB4Ow9hxElksXI5XYJBxVMfhQO+LeG0mb2wGkz5hzhZS5yvr2v0NAvJXP3npzfJ671+ZNrt/0lU1KRNUzRhvXJefPSwNApARdvtgKlxgLWw8pH5trnDomS9rZPRPySdzjzghNIFjVe3XrLSc9gRLZFPs5R9zBXT26+4D21xcYVi1j9gMDg== 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=8LXZYJ3IF5YwIJs7/2QVzJbgQ0tay2z86vhYBUXlFls=; b=OC8mLe8og8X7fRU9TQYzwyTOMW3oosey0g9PL/2LXeUaHODsM9h4oZcBkBKBgM0/btxiSZ77uAPLGgdP02QZsWEEJp/cMCcGxpySLLYn7j9ouEsBcCOWkIBqPitvJ1G/gFqaLj7/BdOaSDr6AO9Tq+CQjmMrrjOaOotVgdqJNEFlUcY28kebUttxV9cJ4mpMH8Yza67aPPGIY2IUaTZIJ/p/DqmgkCclBkIFDciYwibogkQvtr1/D5StZlGzTgYKLNgQzh25yzQWLtgb/B1txJb5uZAzXgF8zXiliOi1xmJgknRO2nqb+A1EziQs75SCZPaQTSAblg2mmQrF1Gyimw== 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=8LXZYJ3IF5YwIJs7/2QVzJbgQ0tay2z86vhYBUXlFls=; b=uqKY72DzuOKJ1JkbcI+Z2oowO4Qbj1kY18tGHmJaMWdXJnFHYBkYf8etKoJtVFz1NTr+J55b2z9/39kvZxEHJ8zsw+IcC4ML6iFLbJYIad6FcqJ2VjL9URxGEnRj7r1TR38Fgh8aXIYukTWe2f9oOc4zeAChK8k0v8SbZFgIfgo= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by IA0PR10MB7326.namprd10.prod.outlook.com (2603:10b6:208:40d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 22:31:09 +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; Fri, 13 Jan 2023 22:31:09 +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 mm-unstable v3 4/8] mm/hugetlb: convert alloc_surplus_huge_page() to folios Date: Fri, 13 Jan 2023 16:30:53 -0600 Message-Id: <20230113223057.173292-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113223057.173292-1-sidhartha.kumar@oracle.com> References: <20230113223057.173292-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH2PR20CA0008.namprd20.prod.outlook.com (2603:10b6:610:58::18) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|IA0PR10MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: e58823e5-24f7-4fce-f206-08daf5b5de11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gTvO80LArocnoz29rMdmL3a/tMD4DPxDHUI1vZkk+vJNVTARnnjHBoLVNtqatFjL8FanrL7niPfdgeSQjr33asiGecWfNmmrRsp8ZozmoEa5LKEoUcfVwKnIh8izeLLNH81NzXXSyJ3Kg0hUk8PWw7hrUtMsdINoRyTo2U/C+vwOHEUsRikW9rjCxmwUD3dgdcN77lBmflu75N4O9EFpGeJZTCnPIbSPwvVSteb1gpXzitBC5iIV4eJ2Y5VviuqyUV0WThgeK5+SGZ70KZ2UPOPmJsMkohI/lj/YFX75rSlb/n8HpJzGMqiJXn6CMEvMMah52adtF0PgVKACaFbbZ6vFKSk0Fz8jP/NmXm8ZcbLi9sSnYJXHAxydnpiWizzul8jgre5DSSNvrR5ov8YGyozhEflpYfO9Hhav948I/o+3otH5/QXgRw2Jsdp8FKx3aSr7+cwZoIgmXmriJF6zM/g3CZ/k4gjNMpcCsdl0Qq+el4eiTF+I+RSiaVxxuWrriuS3kRMYcSwbRKR+9Hf7Knl4Ftvk/HnZdNAdDcgcfK+P0Uzxo84RiEelUwh0ii5YvnBtMtMETMd3ufFvVX/dSiLmsSQS5VGkyAQ7HMqrY8sjRl6AuxQTYG3HjjM3igK3UfxuhBzkq4can/bqziGr+1mQqNdlBUlL3Ue0KCP0FWP0APR/4AKskiOtwLxAtPff 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(83380400001)(44832011)(38100700002)(86362001)(2906002)(41300700001)(8936002)(5660300002)(6666004)(107886003)(478600001)(6506007)(1076003)(2616005)(26005)(186003)(6512007)(8676002)(66556008)(316002)(4326008)(66946007)(6486002)(66476007)(36756003)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cg6t8hDArrPyPIYL1FbJc0yc8hMbE8cTOxJQRVjPDQdMBo8COQKP6WXH+vn2FZwN2BkQXdxLQ9oHhbov/eU50uGkpkVTLakZ1mhyEdEqA7rF6EgW22VvXmoyhErsQVMPMh2UM/lUJNWsDQObSpsVF4l2C1qJf7x1fesVLn3RXFt1omfMcX/bnLDLfp7zAisCJFRTx5hTW3U9CLb92NVsrOa7lqx1q6mUAloQvOXtV+nyuwR/Y7BRjrDSPNb6abQe5HuL7Y1Iz6qqcd4DIGxB4PsQXd1cBLBCxv0RZJZWDX31oiNMgQKOCqGgVzFTaYLHyajahKRbHY+VBtWAp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F/HXRkEznw3Qq7zH1bQhFZtacQkV6OnbcjSyiMK7ogsIvtPco77ULQOwSIYO57dtF4d1P1Qq4TunzNk4O8I0ibgsoN6K98Qt7si9qlBVJrp+KHigc11HghvWTaOdOAnuZURJsPF7iKCHT9BEtfVTkrAIkP8fMeI8OHGEv3UO X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e58823e5-24f7-4fce-f206-08daf5b5de11 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 22:31:09.1043 (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: zBOg0Ugfg73IHrAXgbeVylyIuV9UJFDx6J+LHP4FJ8XKqFqk9GTj2A4lzLzsCsI+OOvLxaXwXXw1E2/kr5lKvqdoHErElBAno63Rm9Cl/aE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7326 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_10,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130154 X-Proofpoint-GUID: NdggC7Npj6So1PRF5CqSQuW-W_2iMWe7 X-Proofpoint-ORIG-GUID: NdggC7Npj6So1PRF5CqSQuW-W_2iMWe7 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: BE1024000C X-Rspam-User: X-Stat-Sign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W3zoUEk/MRXuj6qBovad679rLVnCGxCkqu/7yAsM2iMQrg+TiKPuzIQpuQDm0siTRvXL8VgmkQVEQBPGd26x3vhDIQ76DSTtJBPWlPMIe6vW/8dCAsrSXI= 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 alloc_surplus_huge_page() to alloc_surplus_hugetlb_folio() and update its callers. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c206a8c1ddb6..62552172683a 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2234,8 +2234,8 @@ int dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn) /* * Allocates a fresh surplus page from the page allocator. */ -static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, - int nid, nodemask_t *nmask) +static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h, + gfp_t gfp_mask, int nid, nodemask_t *nmask) { struct folio *folio = NULL; @@ -2272,7 +2272,7 @@ static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, out_unlock: spin_unlock_irq(&hugetlb_lock); - return &folio->page; + return folio; } static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, @@ -2305,7 +2305,7 @@ static struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, struct vm_area_struct *vma, unsigned long addr) { - struct page *page = NULL; + struct folio *folio = NULL; struct mempolicy *mpol; gfp_t gfp_mask = htlb_alloc_mask(h); int nid; @@ -2316,16 +2316,16 @@ struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, gfp_t gfp = gfp_mask | __GFP_NOWARN; gfp &= ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL); - page = alloc_surplus_huge_page(h, gfp, nid, nodemask); + folio = alloc_surplus_hugetlb_folio(h, gfp, nid, nodemask); /* Fallback to all nodes if page==NULL */ nodemask = NULL; } - if (!page) - page = alloc_surplus_huge_page(h, gfp_mask, nid, nodemask); + if (!folio) + folio = alloc_surplus_hugetlb_folio(h, gfp_mask, nid, nodemask); mpol_cond_put(mpol); - return page; + return &folio->page; } /* page migration callback function */ @@ -2374,6 +2374,7 @@ static int gather_surplus_pages(struct hstate *h, long delta) __must_hold(&hugetlb_lock) { LIST_HEAD(surplus_list); + struct folio *folio; struct page *page, *tmp; int ret; long i; @@ -2393,13 +2394,13 @@ static int gather_surplus_pages(struct hstate *h, long delta) retry: spin_unlock_irq(&hugetlb_lock); for (i = 0; i < needed; i++) { - page = alloc_surplus_huge_page(h, htlb_alloc_mask(h), + folio = alloc_surplus_hugetlb_folio(h, htlb_alloc_mask(h), NUMA_NO_NODE, NULL); - if (!page) { + if (!folio) { alloc_ok = false; break; } - list_add(&page->lru, &surplus_list); + list_add(&folio->lru, &surplus_list); cond_resched(); } allocated += i; @@ -3352,7 +3353,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, * First take pages out of surplus state. Then make up the * remaining difference by allocating fresh huge pages. * - * We might race with alloc_surplus_huge_page() here and be unable + * We might race with alloc_surplus_hugetlb_folio() here and be unable * to convert a surplus huge page to a normal huge page. That is * not critical, though, it just means the overall size of the * pool might be one hugepage larger than it needs to be, but @@ -3395,7 +3396,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, * By placing pages into the surplus state independent of the * overcommit value, we are allowing the surplus pool size to * exceed overcommit. There are few sane options here. Since - * alloc_surplus_huge_page() is checking the global counter, + * alloc_surplus_hugetlb_folio() is checking the global counter, * though, we'll note that we're not allowed to exceed surplus * and won't grow the pool anywhere else. Not until one of the * sysctls are changed, or the surplus pages go out of use. From patchwork Fri Jan 13 22:30:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13101714 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 665EEC3DA78 for ; Fri, 13 Jan 2023 23:01:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C591D8E0003; Fri, 13 Jan 2023 18:01:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BE29D8E0001; Fri, 13 Jan 2023 18:01:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E5CB8E0003; Fri, 13 Jan 2023 18:01:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 87D488E0001 for ; Fri, 13 Jan 2023 18:01:51 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 56D831204AA for ; Fri, 13 Jan 2023 23:01:51 +0000 (UTC) X-FDA: 80351300022.13.759950F Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf20.hostedemail.com (Postfix) with ESMTP id 16D291C001C for ; Fri, 13 Jan 2023 23:01:47 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=anG2gdXM; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jPCUEOWx; spf=pass (imf20.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=1673650908; 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=ON8r4iAi/C54BL7LxCnv7ms9x+EBmJEmmOUIFctdR/Y=; b=xzyt/lYAX2rhdoz+PeJ03f/SxEi+dceKw+2HJSmg0ane9IhgDSYIXN1oydrZ9sHQxFVBdx DLInDLfpnRaToqaosKGC4BPX6XCqpSx5xzbacFB9QucbOi72+v6TZ8thMNe1PIwXDStxPP GUXopQTUPtzI/5aVju8cXEGI+7wLq/s= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=anG2gdXM; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jPCUEOWx; spf=pass (imf20.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=1673650908; a=rsa-sha256; cv=pass; b=EB7Vb202CpapOnciqxPAoHK2bILP8x91iKO1lF1A9Fyc7VEYDPc0a0TJm1CTF7gbSmfBlV shXGeCAdiZMmPQgvg/bJ/xWvscnbAo6nSKOKcRwOa/8Vn6GTgDFDfX6CrY9VEb4jnD5qJe I/c33xK8k0j7hLhpwo4AhFvxSOyetYA= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30DMpBYp008226; Fri, 13 Jan 2023 23:01:34 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=ON8r4iAi/C54BL7LxCnv7ms9x+EBmJEmmOUIFctdR/Y=; b=anG2gdXMW7cw6oPWnrP9UoMR4ncSrGYHV9H7CsvfqQHKVZbDPLWLfiOER/CT2oHvC3Ns cokkWacXbDtBUCg2zW3urVbppuzyFObyY8yUOIw6M1MfXQEAr+0OKM5ZgMYCsNkzIubN eilZvYafHxklzpvism0fJCxpnFQDxoCJAwrzA9ev/zmaNY4tyU33l/sb3rYV2+RHkTC/ 6dSK/XyNxWeRTKe5Pn5yyWcFSAoemVTrE0FhuAziAcL2DMMfOmHOKyhnuUBFGYEUqyse QJ1cRyX0DrTIkOMMqDpFNS8e0gSHzSwlEkJ2cc4U/LF+EL+4/7GPAE8GeOhUd7kQOy7P qA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3e0w0adh-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 23:01:33 +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 30DLRUnl004403; Fri, 13 Jan 2023 22:31:12 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n3f7usqt7-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jA7hJmk3W/fHax6ZoaehiIWRKW+1y1x48Eavc1xaC0Xaa9fAQ18IpUF7EWL+cQsMsws7Jp4uhofqb7JKLd4uI4XQeL0bpKTWfGRRm5+sIoIDxj+PXJ2ZLt8Xnaz74t5eHu4j0kYg0aRDWCQfzWSqjP6tRWiPx/mBeFphe3wBXXwHAEKzv5mqnL77q0SShj9MurfmwDZnF5tmXmnnabApYE4dijTUvlpD1yGqwnXZKkeJOswXNBL0+v4RMLuVtFNBdQgS0UohdkCOjatCyUyJ5F5Kzyc5xwI0+qPRPCgWQ7UJmXcmfYxd0H63MtbuHdZyVREagRhkn70pJpxZILjQfA== 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=ON8r4iAi/C54BL7LxCnv7ms9x+EBmJEmmOUIFctdR/Y=; b=kMcqHD2RDXSG84haPC/CevD3AgAfup5DTcvznQEMBlmMA8wmhfiizuCeW2E/MMkKN4rBWE7jLPyJfSR0G7RVndLxV/jQOeV8Rxx3zgUaVIXY3IetPTLb/kevGJueSByaPqUUN4wBaF3MCgCwLeE2CITcYljPLST5WCj6qx58uXyzhW7fWrT57D44OHByJY5Aaxmp9aShLKScKNxISg9T0NUN/X1T23xajnF+8qWAhhDlNTUKZvhuHRLyATO6Neu/v5YCDZNTx+sY02GHm937GK2Ow/EzOUViqjyR889pXt7piPdsWr9UZ/ah3zmPYa7j9kTAIx6iBkUIUq+WQLKi4Q== 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=ON8r4iAi/C54BL7LxCnv7ms9x+EBmJEmmOUIFctdR/Y=; b=jPCUEOWx3QM/CeQAUyg5Cwk926fAKdqFSUI3woPtJfJJswW8XN+2dBil/GA62OLLem2AmfFMoKm683AUBHNlMiM/mIizpnFdcp7mDwB+mBhcp9aahYq6Ix1KqNlECg2hc7SUzsMGHg1ZtFtcgaBoK1ZTQF8nKircj/3WBPR/SMs= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by IA0PR10MB7326.namprd10.prod.outlook.com (2603:10b6:208:40d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 22:31: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; Fri, 13 Jan 2023 22:31: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 mm-unstable v3 5/8] mm/hugetlb: increase use of folios in alloc_huge_page() Date: Fri, 13 Jan 2023 16:30:54 -0600 Message-Id: <20230113223057.173292-6-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113223057.173292-1-sidhartha.kumar@oracle.com> References: <20230113223057.173292-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH2PR17CA0029.namprd17.prod.outlook.com (2603:10b6:610:53::39) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|IA0PR10MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 3429cd2d-e3ec-4886-bf0d-08daf5b5df09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZLRF5rQAm9caLRK+zOZHkn+oiyr9zLq/BkMigmq2dNjNPOBW6x4+rofg3s5yDIgO8pK48OeoTgKxRfZIRrNE+8CQY/BgsVrSmUnf/wML4R3t8CLFomWqQopPHSsl8rowieO6LO9F7O3Rs5OZGfLJPRmtOBVTzJY0j/f28GfH2mLfVMzImqoa/lDQnG6BdY2GxAga2uiv2rCsLhANTupUY4r0n1veIQeK9jPrfXVoBRIKxl1Z0ckX7M0HUq8U0/XEghv/tQZ5Jr+O3qHoQQ5EVz4fS+q9eqgzJVOk2cxfLDEeXg/rAXthc+Vkr5lgOHpRAlEqssCt+PxogqZy4tZfGWDAU7Rq2pcHxnMiic830ZEyCoSNSLy90uezlI4S+6fMnz4JkctltwJp7sYpWklMkdDrKJi7vodO3uqKVcYKuPyojWoj/4FFnNrVYD/pKz2vHQUiaqq+MdJeib++kJunKryYjBAXjEGFcLRjiDMyb5T2tWB/cgFbL2Uda6CMUSLWPWD1o9HRGfYvWHGdsRxWHyK3ub3PQ6ssBEt4HmkDWg5cRvM7SgOBqt0zR1CHiAGhGp/E4fcQhnSOt1RRTm4j4oIRNEVda6bG0iR9ojA2uso7g5DhxOTzxqqF8XDeduMS80/gMyrwDpjtRbOUhwJp60GvHLvDCHQoxoUbQ8YG0UiMMrtB0KwfvHLRXuzF3oWa 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(83380400001)(44832011)(38100700002)(86362001)(2906002)(41300700001)(8936002)(5660300002)(6666004)(107886003)(478600001)(6506007)(1076003)(2616005)(26005)(186003)(6512007)(8676002)(66556008)(316002)(4326008)(66946007)(6486002)(66476007)(36756003)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I7Zu4/edujXnc2bEX1bfYKj7hfVaHMNFpqpVbw3mGOT3d8KXalFeW+vsFFDOGc69zxT6Z5JaMqU18kjDSCK1aXJZTHfehq9lopNIDSg0iCI2lLSL5LBSYnqAqsbizzM47rJ6+NofNIGnoLUIl7F+fR7A/fZY+wkb2wps4A7qYNpAEBYesBMXjxwWF0u71Fiv49vKh2BHYTnR6d/UK5tngirkx5eigz0ap6hT4ABgSDrlDC8Sa37V8BGpv/FfHbyj2xLNej95JmS7YQW1SU0ViVKzZZW2JNwJL1nqhzWNXOwYj9rC2qaVPUmgg1nYYQxMii8eblCeSQAKotsFZt+X9km7Dzinzf2Me+qJBMtuajb5CSI0HF9bMzGmi1U47YQJBwrUxZ1zc/jb4jWQHHvdX+9FM0t5xID00M6YY4ytdvRpbS/EdlYwm3Qa86UIJGnv0QzW5uDwdCXkiWdZlz6ZKhHkucU5344k/TlKn8IVWuGbdPM+IyKopuS5/PXWbRgMkG6/QcguBmJm4IsTAms6nvoZSxgmKKOfbHsU92UK6KbWMSX6YCfyyqnvpbssLQpjc8z1P3e9DuCgKzJdSUb7atQDclSxAisnoZKStdG4K3V5yNOgFaJ1dr/UHIph03A5jgu1rAS2EPmzXahG4KEPKwgnC4XW/88q2lFI96L9n2RngNzoXC7BzZrVK9YFo8I2MLgUJKVCiQErw2w5U1V+9JmwHC2PkBDrDoiLFtlX84RNhdIsArL09KUaImx/R0m3DHhEzEGmBCGtuSYDDY2ak03t9zVbCIEBiOzpiwHL8b8JZgHxBp039Rtyu53yEPraWODkBxAiFjt+m+81L7XjPETGNBzbfimWr/mgIes5SKBhVnhTxSv/pdcu+mkWcBPk+lYZPuXhFBbM3yFjOx13Zy8UjCxbBc6u1xtSZwaGovXbNzemalSDxgR/xuyG+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TTvRWvJYO6lL+GAfO+G9fSd2zH3cBE78C9RFGFNRUnlBFOSHuFt7sy5OO6BnlN+1iopPTN5tFx2jrvCirnyAWRwVNRgZeA0ISzBDXumgZn03Z5rlXDRSDNNM6w31oMuHVV8/xPcXqWMlnzMUfYLuzgP4/8e5it90IicIDUTSW2snd1ydaHbiWmBMAd8uK/X+2yoIe/Axw9QXv0t02OZ9g+UPkM2CEkLQGMwaAo9o5mBQ9HYkyvKXEktPU40/IbBP1Mre4s1jTX8FgAoGvf6CugRazKnHP5drXoXtD9rtgkW9gK8Bsi1FzgH/bFBg+W6BXXy7H8zjF6Kl0llnnUCxPzSGDtiG9/+BJKCqPMXTyYhQ9a1CGQgefZXJw+CD3c5HE40beFWMN3cjFwKl+/uyX6mRaTX2NNImUILv5Vr4UiLF0VweGGDnpq5+ZZJ8kMFtUbGZ0omyFy8k/j+CNlpqfa4ekFC9UMeeHRcd917y/HCnfuzp+3KfS2zR+JX3mGrykW7/AgXR7p3pyKB1PfEkRPuJL5NepmyC1CtWrs5a9oUQAJxbgUIozjM9HIkx6w9IDJXsmdtM1Hz7SOO4veO1MkwSoSKnAzaD4OoFION1wODhxMlLBx X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3429cd2d-e3ec-4886-bf0d-08daf5b5df09 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 22:31:10.9002 (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: hMue7lt5AlYJL4l/w8TZm1nBMO657m+94J/gx51D74k0d0MVD5IJlzRYEbROXjh923EHPPzV5hag2CwArAjBT+NJkZSlitnZ7yijwuHtpuA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7326 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_10,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130154 X-Proofpoint-ORIG-GUID: 9jFQFCRsq-ngaknBfjWp_a2Dhaz2fNDD X-Proofpoint-GUID: 9jFQFCRsq-ngaknBfjWp_a2Dhaz2fNDD X-Rspamd-Queue-Id: 16D291C001C X-Stat-Signature: 7eh91b875aj63fo5rdkk7bmfmxkf5g59 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1673650907-147153 X-HE-Meta: U2FsdGVkX1+OJhSfaFfojSwBnQgwX4GlQQ8A0E+yWqWivxwt7W4xpZHTBxLyPLgZ+Rtfdy8hJoEbSz/HcQ8AFGYVfNlV2ucNfb3IGviy20m+HkZAlQF5rh/S+tHiLJENM30Q8yyNNw/ZcVF/AzR+a62izIjrARgqpuSIKdg9nFpTsId/Il//1q6J6oxrYg6cZGbskn9laT3TM7mYlrYQg55+iP/wyDAw9fbWcce34TCGE/glyFsFF29gWo2o7W1TecqPUg9L3wGIBgl3QcGnDdh2whnTaQ4ty/yiTWs67u/6+xIWONyYdHiPCndvF1T5mcTeuRuwLDr4Ol5MhdSsvr/P4VbX+RDKLY1C15zptyPNm0cIBqNtx/li/KZKUy71GlwWVvdMXIklfXVE7CWPWFj8XL8U+nvhY+6GuRVQH/mzKCXjvgFljcflQyVLNQD8lVH2xi2xpNd341b7woiGMUZYtgnaCRzYZZPMq6Ntv56vU2VywDwFPFnpwXieouo96MqMF8ev4zDv0a+Y+AcBiw5AVwqwUCJzTNJQEfYj8F5de/QpDWdXbeCFZQ0roi/2UCx4UNKiwkweXbcEWH0yUo2to4zThdUh/+2pf1qp4n2SjM5XcpE37cWovWs6mE9Hx2r1awxCMs3G3t4Xlkz7X3dOfc3USc3+V/q0HO0YrkIkfD6nAE9v0qcHadRtStQYvuaqt1nXvdPuNo0OxB2gryDjNpLVlUNQ+5Bh9ejDM4BLfIkFpfbsPRECSUS/6h5nvc06cGusYR6INDAWuILS2BA/DvF6HdGqn2PPJBLBLWJwRHM/OUcG+oKdqFkopc3q17/6G4cFkhDFV0LLlkI7sopE4484kuHAXu2FRM+xk5KziiKfAa8MGEVR3hvkJKcYPSUXm0Bc11+gQFdN6vjCXOk3kSxQyFhyqD1y1Vb9m3y9Qtuf2zJKAyVd7fMZwSlrpH3IqgHWb5Xv3N5hZRo m4OR2wJn dnEch8+z66zKvOuw4JztCd6wMdxWf884ACdPggA2F6zEOHhXiIcmg0ef80d/0JAA2xY5vX4YJbSAC09+fhJkGc9dexcj9fomjHzWtBA0RGtjYQyvtYHuiAYoOKP4nrzY8Fjzbsn3FtKRdw5xthbVEyeGwgQ== 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_cgroup_commit_charge{,_rsvd}(), dequeue_huge_page_vma() and alloc_buddy_huge_page_with_mpol() to use folios so alloc_huge_page() is cleaned by operating on folios until its return. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- include/linux/hugetlb_cgroup.h | 8 ++++---- mm/hugetlb.c | 33 ++++++++++++++++----------------- mm/hugetlb_cgroup.c | 8 ++------ 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h index f706626a8063..3d82d91f49ac 100644 --- a/include/linux/hugetlb_cgroup.h +++ b/include/linux/hugetlb_cgroup.h @@ -141,10 +141,10 @@ extern int hugetlb_cgroup_charge_cgroup_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup **ptr); extern void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page); + struct folio *folio); extern void hugetlb_cgroup_commit_charge_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page); + struct folio *folio); extern void hugetlb_cgroup_uncharge_folio(int idx, unsigned long nr_pages, struct folio *folio); extern void hugetlb_cgroup_uncharge_folio_rsvd(int idx, unsigned long nr_pages, @@ -230,14 +230,14 @@ static inline int hugetlb_cgroup_charge_cgroup_rsvd(int idx, static inline void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page) + struct folio *folio) { } static inline void hugetlb_cgroup_commit_charge_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page) + struct folio *folio) { } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 62552172683a..f3e1d052b40c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1206,7 +1206,7 @@ static unsigned long available_huge_pages(struct hstate *h) return h->free_huge_pages - h->resv_huge_pages; } -static struct page *dequeue_huge_page_vma(struct hstate *h, +static struct folio *dequeue_hugetlb_folio_vma(struct hstate *h, struct vm_area_struct *vma, unsigned long address, int avoid_reserve, long chg) @@ -1250,7 +1250,7 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, } mpol_cond_put(mpol); - return &folio->page; + return folio; err: return NULL; @@ -2302,7 +2302,7 @@ static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, * Use the VMA's mpolicy to allocate a huge page from the buddy. */ static -struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, +struct folio *alloc_buddy_hugetlb_folio_with_mpol(struct hstate *h, struct vm_area_struct *vma, unsigned long addr) { struct folio *folio = NULL; @@ -2325,7 +2325,7 @@ struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, if (!folio) folio = alloc_surplus_hugetlb_folio(h, gfp_mask, nid, nodemask); mpol_cond_put(mpol); - return &folio->page; + return folio; } /* page migration callback function */ @@ -2874,7 +2874,6 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, { struct hugepage_subpool *spool = subpool_vma(vma); struct hstate *h = hstate_vma(vma); - struct page *page; struct folio *folio; long map_chg, map_commit; long gbl_chg; @@ -2938,34 +2937,34 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, * from the global free pool (global change). gbl_chg == 0 indicates * a reservation exists for the allocation. */ - page = dequeue_huge_page_vma(h, vma, addr, avoid_reserve, gbl_chg); - if (!page) { + folio = dequeue_hugetlb_folio_vma(h, vma, addr, avoid_reserve, gbl_chg); + if (!folio) { spin_unlock_irq(&hugetlb_lock); - page = alloc_buddy_huge_page_with_mpol(h, vma, addr); - if (!page) + folio = alloc_buddy_hugetlb_folio_with_mpol(h, vma, addr); + if (!folio) goto out_uncharge_cgroup; spin_lock_irq(&hugetlb_lock); if (!avoid_reserve && vma_has_reserves(vma, gbl_chg)) { - SetHPageRestoreReserve(page); + folio_set_hugetlb_restore_reserve(folio); h->resv_huge_pages--; } - list_add(&page->lru, &h->hugepage_activelist); - set_page_refcounted(page); + list_add(&folio->lru, &h->hugepage_activelist); + folio_ref_unfreeze(folio, 1); /* Fall through */ } - folio = page_folio(page); - hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), h_cg, page); + + hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), h_cg, folio); /* If allocation is not consuming a reservation, also store the * hugetlb_cgroup pointer on the page. */ if (deferred_reserve) { hugetlb_cgroup_commit_charge_rsvd(idx, pages_per_huge_page(h), - h_cg, page); + h_cg, folio); } spin_unlock_irq(&hugetlb_lock); - hugetlb_set_page_subpool(page, spool); + hugetlb_set_folio_subpool(folio, spool); map_commit = vma_commit_reservation(h, vma, addr); if (unlikely(map_chg > map_commit)) { @@ -2986,7 +2985,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 page; + return &folio->page; out_uncharge_cgroup: hugetlb_cgroup_uncharge_cgroup(idx, pages_per_huge_page(h), h_cg); diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index d9e4425d81ac..dedd2edb076e 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -331,19 +331,15 @@ static void __hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page) + struct folio *folio) { - struct folio *folio = page_folio(page); - __hugetlb_cgroup_commit_charge(idx, nr_pages, h_cg, folio, false); } void hugetlb_cgroup_commit_charge_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page) + struct folio *folio) { - struct folio *folio = page_folio(page); - __hugetlb_cgroup_commit_charge(idx, nr_pages, h_cg, folio, true); } From patchwork Fri Jan 13 22:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13101706 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 437E5C6379F for ; Fri, 13 Jan 2023 22:31:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32CD38E0005; Fri, 13 Jan 2023 17:31:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2AB8F8E0008; Fri, 13 Jan 2023 17:31:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6AB98E0007; Fri, 13 Jan 2023 17:31:42 -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 BE04B8E0005 for ; Fri, 13 Jan 2023 17:31:42 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8DC7380AAE for ; Fri, 13 Jan 2023 22:31:42 +0000 (UTC) X-FDA: 80351224044.01.30ACBCB Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id 4FEBDC0015 for ; Fri, 13 Jan 2023 22:31:39 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=iLFI+vkU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kW246ouD; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.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=1673649099; 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=/QULkUox5rmihInJovSFDI1yjAOFhDzEXSOdbMBjXi8=; b=UHdR1aRFGxM/IveU+LhwFkceWGtfZHl5GomVLytse+nJ4RxrqkroJYu5kwlzYULhggACe1 RcfBZqnPRxCveY7/wNn5ZKZNgtkFtJI6yTZ3BXvdiPZwMsXwaY1Vlr6zL4y1xAoeE7IQqn wmc56NbxVG1XaGOoCIo1OYV+QWDH0lw= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=iLFI+vkU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kW246ouD; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.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=1673649099; a=rsa-sha256; cv=pass; b=CloD0wAW+st/NoYPHVEHSszIJaRP6MQDSYeqjH5+nhr3pJoq903bO1CJHmncE7wwcQVJhE 8tTvjMMkA+EmSYDMqh3liUaoCPC3UlYGeSb7FoyNm0WhMUVEbd81jn3iH0O6AQxIdc95Ym eLTlWB6bR7hiyU/fwo8GZMc6LduPnjw= 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 30DK47Qt017331; Fri, 13 Jan 2023 22:31:15 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=/QULkUox5rmihInJovSFDI1yjAOFhDzEXSOdbMBjXi8=; b=iLFI+vkUqFXATgbCM7wRE78BgT6H49s2Q/Uti8bH6Q1Ha8G3PrKC/h2TfPC/xrMDQtzh YohNFKVaYkbheuc1vhvdaogbwkxXsNfIdOWfygmuHN0i+y8tIXJ/uM33hJ7ecbxP17zd d04l70T/phwWDYYqgNwR+rZNw44c0w9JpkzimNHJlr9/MN3+YXDZzGbHuw0ldWJvq1tn 0hnWA7e+fDdFAbYB3yccnsnRGZSjf9mypZBC4uqf/FmBm4QzwVoUhLj7jbr74toMFBQa B4VzKHKshdMvFdoKGSGgC2n/cht901omCyX4iPhsP5LRnT9HUUTicvn3Vb9GCjG4yPcn 5A== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3dxhr9xh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:15 +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 30DKwdPU006693; Fri, 13 Jan 2023 22:31:15 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n3etdjktp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VpwIQYacfImDES80svwpo4TGMzmcKnZHIDH15IxyUjbz6Q0GbV0bU6vO0w0yrmVlaUC/rQ9jW+6MnXFuWDM85Hjj7rCq0nBQJ0KERBiBFXbjhm2VBn3xbF8Z04mP2YdBIv1TqLwbwXhfSEa9TOj8Sk9LC6J97TOLh8AWhnJzj+D05dbS6h+H36mSiDMZ1N2W0D+m2DhLeWeBJL1ndb/En1+SEMStjHJaHmRIcaQv9I7+aS/wPiLF8VQp/uMprZhxEy3e09hCD7Pfnup2LSRTqQzOdTljuEj+hyAUVVeyDv9tNQqs+8XIb5hU9X4idMNVUVbG4FlT9+i9fUQYSIPGuQ== 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=/QULkUox5rmihInJovSFDI1yjAOFhDzEXSOdbMBjXi8=; b=cfRk4baA57e5YfF/Oho5BfKvg3oAYi9ffgq/ItHGAzM7dF88X/N6e4ZW/Sh6QU2JVnPxwHlDz1I+uvUmhxx4FyPKBlURje3nE0NUhqdqaVS+OPbWigfUnycKydiBzIm4BPyCSwSBLQ7+UIeg2BKOczBHCGGXg63lyc4Q2dlnqf++I/SooLJuRhGnqTVOYEJ+P2R055aGbShAIzhUxse8u0oAExfukh98z5gMMwe0+BExZs4TAuepbEllJn4KyK/QF4HvGzuzlmHTjlt0agd2Bydm3j2TDgZwxQwlwxKnfJZt2BLys+IpkNgVdAexBmSoXXBo0TfTBJwX4i9m3iGQmg== 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=/QULkUox5rmihInJovSFDI1yjAOFhDzEXSOdbMBjXi8=; b=kW246ouD5xIROEDXsbwVEafuJ8oL8MQAZpbmfW8tlomQbUnZa+a3OsGa8YjzQzaRej1KpSUvBE4OoqNp76NxdA0NZOuTNKQqpXloaoPxy84bfdW/J+M+fzIaLPU0Kg1kSuTaPgIKi+kuoebDWXcye5s2esvCZWZo2+Q/KrRnEH4= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by IA0PR10MB7326.namprd10.prod.outlook.com (2603:10b6:208:40d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 22:31:12 +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; Fri, 13 Jan 2023 22:31:12 +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 mm-unstable v3 6/8] mm/hugetlb: convert alloc_migrate_huge_page to folios Date: Fri, 13 Jan 2023 16:30:55 -0600 Message-Id: <20230113223057.173292-7-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113223057.173292-1-sidhartha.kumar@oracle.com> References: <20230113223057.173292-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH0PR03CA0199.namprd03.prod.outlook.com (2603:10b6:610:e4::24) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|IA0PR10MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 03c70bdf-fb1f-4636-60ee-08daf5b5e00b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s5idka6sIibe0a8L2kII7BC/x1/ueSCov7s8o7QoIf7nArJZMJRdoOCYn14OEamjoPihBdH05tgFKjCtTDnoqyH/jXGYMN7FKlPPpjcqN6IvGUO5C7aB4KHVcBDaOvGJFGJRN7qHTNN8RNc3r5w1WMq92ovQk/VUQ/BRYZiEKk7VG5lnFCWafdtVUQWYyvYUy2jYZuSYd1JMEBxfIgo9xLwvCDrgvOlvfw6e2Wujii3wh/UcJ5cfmYHhpHd7pRgxlEWSdyfg9qqAl9WamLdzX35dBot/IuUVVrLWvFuoDPnpzhmpOlPgX29bLNH9iraTLSrYYv1G36DZBIFmREvGHdKOQnFwegKhOZRmXZcEkPDmE4PxryRIDHxUCvLO5aTfy1NFag9A0O+yGmcF0I84qzM63R8/XocJ7qNW4XnROlkN+GTVyLBPmm5qAVAMQ3lWBehcA6fkiCA+18klLYLGsBJEzXQPMc791xGcgbcIF8CrhppomSbncHZ5EoVY/Tle612ZhrbR1/loItIG1UBp7SwaJFYu0OV7SJYS0rL24nQFP1udXOv64A/k+EVHapxNwjTw0tU6VmCsJOgIjZKGSX5mfpjn/thKJoPfzqIiainwDKXe7bOcBmlKRQ/mNvN5uvHuN9+1lL9Fc4ANCatmxb+61wK4IutZ5K8kEEyHTwBp0o4O5TgKRwaHEVEG/6e2 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(83380400001)(44832011)(38100700002)(86362001)(2906002)(41300700001)(8936002)(5660300002)(6666004)(107886003)(478600001)(6506007)(1076003)(2616005)(26005)(186003)(6512007)(8676002)(66556008)(316002)(4326008)(66946007)(6486002)(66476007)(36756003)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: On0CBKCY/2wAeT1JLFLoF5AqaNEE4qvbwY/eos4Jt214WjxIkiJi7fFA4CYMFOiMmSqoM83tI7v/wazLwFvXQWOMe3gX4sU4bxq5Yu9zPPGFKtErPAqNWHKCtvesZkdCbjL4v4Lz/dKKGxQiLcG9rYVMamIeutmFOfJxmAttfBGT5DZO445ZlOBeAAMNBYGycE9MMjFPhkmyWmlXry+gxRo6kX+O/cOXK3Vr+nc+puyvW05+6dVSjsuLtKr3RpHBe9EY9QRAOoExQg88dZ9J0YNyjf4hjHQqIY3tunQwmMJWaD9b7zYZiuApPgCn4WaRRjUuP1L9ywnIg1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NWgZQ/48K2hoRcCOJQSw1/TiCt9YYW/uSLUYbhBbyxv6Nc38RMrD7KXEGl30C5tPNh3qBTSnKQPPHEskXy2EeFlPYDsstSGaoSoyjJDcan5jrPvUTY+6G8lOlvos7VuU4sUmvZCmFOggeQE1PwHkYhgbjfhXPpoIhgSOzl X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03c70bdf-fb1f-4636-60ee-08daf5b5e00b X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 22:31:12.4480 (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: yGlEtD9Ku/4TAo6IYCBlqMraL8XB1bkn/4b59Wtt6QT0DyrqRedyWjbJBjaYKQH9qsWfthMMaVL1qBRGspkMi6S/TYjTGa24KplPs+/jh/4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7326 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_10,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130154 X-Proofpoint-GUID: ncM5SHMg8SEG6cti6XMu2woIi0VAkiXF X-Proofpoint-ORIG-GUID: ncM5SHMg8SEG6cti6XMu2woIi0VAkiXF X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4FEBDC0015 X-Stat-Signature: r1upt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zb0gAHL67V9YHeshOuFowp/x5YES27oYevyL/bCIQLSvVmEd4JC86ziwhPfrPB+SxhNn3ZvX0WwZ+yoW1602hVNNnelfXGyG2J8lICah574Y/jBCDvGFN7LakXEg3rDnQ== 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 alloc_huge_page_nodemask() to alloc_hugetlb_folio_nodemask() and alloc_migrate_huge_page() to alloc_migrate_hugetlb_folio(). Both functions now return a folio rather than a page. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- include/linux/hugetlb.h | 6 +++--- mm/hugetlb.c | 18 +++++++++--------- mm/migrate.c | 5 ++++- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 482929b2d044..a853c13d8308 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -680,7 +680,7 @@ 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, unsigned long addr, int avoid_reserve); -struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +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, unsigned long address); @@ -1001,8 +1001,8 @@ static inline struct page *alloc_huge_page(struct vm_area_struct *vma, return NULL; } -static inline struct page * -alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +static inline struct folio * +alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask) { return NULL; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f3e1d052b40c..c0cfb075cd58 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2275,7 +2275,7 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h, return folio; } -static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, +static struct folio *alloc_migrate_hugetlb_folio(struct hstate *h, gfp_t gfp_mask, int nid, nodemask_t *nmask) { struct folio *folio; @@ -2295,7 +2295,7 @@ static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, */ folio_set_hugetlb_temporary(folio); - return &folio->page; + return folio; } /* @@ -2328,8 +2328,8 @@ struct folio *alloc_buddy_hugetlb_folio_with_mpol(struct hstate *h, return folio; } -/* page migration callback function */ -struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +/* folio migration callback function */ +struct folio *alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask) { spin_lock_irq(&hugetlb_lock); @@ -2340,12 +2340,12 @@ struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, preferred_nid, nmask); if (folio) { spin_unlock_irq(&hugetlb_lock); - return &folio->page; + return folio; } } spin_unlock_irq(&hugetlb_lock); - return alloc_migrate_huge_page(h, gfp_mask, preferred_nid, nmask); + return alloc_migrate_hugetlb_folio(h, gfp_mask, preferred_nid, nmask); } /* mempolicy aware migration callback */ @@ -2354,16 +2354,16 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, { struct mempolicy *mpol; nodemask_t *nodemask; - struct page *page; + struct folio *folio; gfp_t gfp_mask; int node; gfp_mask = htlb_alloc_mask(h); node = huge_node(vma, address, gfp_mask, &mpol, &nodemask); - page = alloc_huge_page_nodemask(h, node, nodemask, gfp_mask); + folio = alloc_hugetlb_folio_nodemask(h, node, nodemask, gfp_mask); mpol_cond_put(mpol); - return page; + return &folio->page; } /* diff --git a/mm/migrate.c b/mm/migrate.c index 6932b3d5a9dd..fab706b78be1 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1622,6 +1622,7 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) struct migration_target_control *mtc; gfp_t gfp_mask; unsigned int order = 0; + struct folio *hugetlb_folio = NULL; struct folio *new_folio = NULL; int nid; int zidx; @@ -1636,7 +1637,9 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) struct hstate *h = folio_hstate(folio); gfp_mask = htlb_modify_alloc_mask(h, gfp_mask); - return alloc_huge_page_nodemask(h, nid, mtc->nmask, gfp_mask); + hugetlb_folio = alloc_hugetlb_folio_nodemask(h, nid, + mtc->nmask, gfp_mask); + return &hugetlb_folio->page; } if (folio_test_large(folio)) { From patchwork Fri Jan 13 22:30:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13101707 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 B8146C3DA78 for ; Fri, 13 Jan 2023 22:31:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6554E8E0006; Fri, 13 Jan 2023 17:31:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E1858E0007; Fri, 13 Jan 2023 17:31:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03DBA8E0006; Fri, 13 Jan 2023 17:31:42 -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 DC4218E0001 for ; Fri, 13 Jan 2023 17:31:42 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 94AE6140A84 for ; Fri, 13 Jan 2023 22:31:42 +0000 (UTC) X-FDA: 80351224044.02.50B234C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 4E82B40017 for ; Fri, 13 Jan 2023 22:31:39 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=k9zcBAHm; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tq6pBPjh; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.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=1673649099; 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=JSuCthEGD9mFVQwtGBQpQYgIPpxHUVzJky4kAU11Yd8=; b=wRSBmKQoj8igKVLaBQgNu3w1excMrOQWRRPXqoZnTUh1ZS2KWIgor6dMeLQ81L+l2gzzEx OOagE3dtYoadYV3jevJW9m/U4I97pQRAV8dd0L6FSYXotDxADRe6coKMCy7yEXeB3JAnl4 7LbUne5oU+KUeqlBr+L3lLtsLl4UzMk= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=k9zcBAHm; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tq6pBPjh; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.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=1673649099; a=rsa-sha256; cv=pass; b=pKu+JokM8vKqGTif892K2t6JAiMLFBU7Ea8aigwIzEUoS7ISoVeyqWp7C92+laffWaqsGf OxCPzlFW0mL3GvPJVrlet3tKNHpwe3TRmF7jZI/Mvo5PD0iKkyshA9Dau0fB4SOsirnyu2 Cp1Du+zNCUXiIqwmmRsX3B6lBgVOCjA= 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 30DLYhPP015861; Fri, 13 Jan 2023 22:31: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=JSuCthEGD9mFVQwtGBQpQYgIPpxHUVzJky4kAU11Yd8=; b=k9zcBAHm7ighNBzTNll3x70ykerRhWlMQIObu67JpHW6szowhyfO2t3vctzZiZYlZq50 5ygl5YDFo4oURmK86asQTki6aLhoBVBicPa2LZXu5cKgObGT/qWXBoB2jfQvR34gyeOE qInbcnH+g7h1XLg3jETw8xLF2j01tM7IKs+eD0rf11Qj1WkIh1vxnhzRFL1r0vExEQSD iT4tLr4w1ivB+1hmdi5k40sW1s7vCK9nP/ujExmhIiaH0sl48pNDsp7ar2e39OBk6Abv qiE4goS6Px1rBTdtRhk6BVXfnjFvyeEAKhVIDnMzUFypYMbBqBmDRGP4biAKQSqjoJBy pQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3av80phf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:16 +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 30DKwdPV006693; Fri, 13 Jan 2023 22:31:15 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n3etdjktp-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R3qwwdmQIIr41OyH3VJcEb98gJatl6EX+A6HDELIudBUTWyBZxLB3wUEeLQF8/q7dYaqnqec/w7lWVI00lXF6ghmgwsLvCMJWhbfSsMZjYKCL2wCkW1FUiW9A8b22s0IulPMKCois86lUdVJyOvfr64AmFnFfh588cGS9wWgW5fGoj9UsTHHXMyNcv5+7uQZ0FjxjIbwcXX9wG3twjQvMHju8hQlj68HSTd2UXYEfnp0AGvoXxoyaudAZYzgAx7p6CwJeEPBhnlsMUXucKe6kqZ7E64+kw/oeTP1RKDGm1v7GmxIIhFpSR6HrMwWSUoYGiFwfspTOrht4G0rrXvhaQ== 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=JSuCthEGD9mFVQwtGBQpQYgIPpxHUVzJky4kAU11Yd8=; b=h6i6Q8R/nKcqJFpiPcfsf+npzun/SH6g54hhpnPunS5ZKogdVamfzJfIH6ZPE6PcKgYCwZAWsX626gsEKDmcD4eQcN/GY+QIydrtY/yjBNs86d9oTEs1YTuGEJU0C0s0+wUEBIFYKXiMFWUwuo6vU94Hv2EzZnywcu+nxTrBx/FExq6vGgtvo5KcWaDtGJ0mm6hajjAebALSdcWR19TOLo+jt+O/KXx8AM4ZXWioDT4LQReWLW3272eFbskm83LJaiTfINsj2zNTcAPUu9uv/O9IGjgJd9qIdnsx5uLiNFIGe5rCOW2OH+ix4r3nh2DWdU5sdW9zheNYGp5HMgwUig== 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=JSuCthEGD9mFVQwtGBQpQYgIPpxHUVzJky4kAU11Yd8=; b=tq6pBPjhzrADvnJ48bgAgb7cdylmkPLp7Bqh/y/6KsoEIF5uhWbY0Lk63mYm7P/BFCVuAymVCQ025spURcMDr+QU8YJ4tHQYlQPWWlOUdi6Y7aoQ7wv2Xee0c/hJNd/NWOMcNkdzZPzzO/ti+OJGRuZx8C3krqd5soo0sMnFhUE= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by IA0PR10MB7326.namprd10.prod.outlook.com (2603:10b6:208:40d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 22:31:13 +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; Fri, 13 Jan 2023 22:31:13 +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 mm-unstable v3 7/8] mm/hugetlb: convert restore_reserve_on_error() to folios Date: Fri, 13 Jan 2023 16:30:56 -0600 Message-Id: <20230113223057.173292-8-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113223057.173292-1-sidhartha.kumar@oracle.com> References: <20230113223057.173292-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH0PR07CA0021.namprd07.prod.outlook.com (2603:10b6:610:32::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_|IA0PR10MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 15eb3f18-121f-442b-b1e5-08daf5b5e0c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +h0wskAd24U8NZcCTltxm//scDJMWT4Rnqp9OM6OAp56uZD7YzzhRGHPvCDLNhuqdF6/NdFM21Knoemo0IJ8GWO25WGoMl03m5SNdo+2kyWebC5xeLlYo11rwF7fKtrbB+uT7GSlwlUNDi7qrf9xafrHh7cbId1unGvXtp4Eu+z1BVqN0Vyym7I03LEZGyjmb30Wbv4HgCK6aiZsst+44t0VfwcdhGhPubBnR9wUDgB/1ZECgGhNdY7SkEl2mxWrk3LlDTtDWfLYmN06VSoDTIKZR6JlB0kj8TrBvXsMPdZrDJryZTqPN0OMZmPiCjavOYIWaLCJMWgcoAOnbzI+mQbhX2/Xs5U7blDuXEuWxVSqEG/jqGscV95EZTkqpzr6e8cPs4/Ckll6oZYf2Uceb3RoL7eiQzeewZGhbtAEF4/iFwC14NMy2jJS5xorrxCd8nWtNj8Pw4BmSre0/XJugDIynhqiLBDOi5MfZgGndxU235XL7ptWaMlOkq3SOyaZlvkq3JfuHqJdWLugclYiOBMurrMoJgk/Vjy2I0GaVHoSgqO9005A/vs1JFff0g9MfUbQwY49/5HhvzGo3fI/bIyu1JreLzaDq0tAWcAu5C3rjGNVahA0JgOjoFs+ve865oT9fR7GeToxADjlb6JRnA== 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(83380400001)(44832011)(38100700002)(86362001)(2906002)(41300700001)(8936002)(5660300002)(6666004)(107886003)(478600001)(6506007)(1076003)(2616005)(26005)(186003)(6512007)(8676002)(66556008)(316002)(4326008)(66946007)(6486002)(66476007)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QxvetK3TwS2Mh+SE+KgToFOY5HxuN7OZGD9RGLpkDnc7d8kTLjCqs9v8LR1SEhw7CUsT7VndLQVXrWTxpoZ+6sU3dmJhEiteMYvV+f6CeAHzDecSNEqDkWXrejTcYg+A4MjHb+Bgc/cEvK8mya++sP9xR7AfCeQIATxyFwblMQT4BYd5Xx9V5Zmy3YVaG4B0NHgkJNW5Avds9wfLE2okTxzTGgt998zShGPqps7OHzSr+iGglbla/eBkvHiUBOZGPZNmlqaU2+mYqB3FU4oaY9QCB9yIvzInXTnG4fZk3U4jrexU2VdtrIKWPQ+aaSJ/9+bYDe2+ZQypFgkiI4cnj2+UD9Rfze3qB3bM0oZXzkAlgBvno2tDZVWWtzwLC0Ow2Lql1o4kmLNaQnIfr6hU+FsGcktu8dYVWCv8xa6vzwIHZQclurrUZt0JOOYZpEPtyZGuPBPSwWgPG5nukg8Ig0oPRqVGOTgH+ifXULk7wJ1+XvPYtquHCtO/cb0H916DppSQ7zCmpAdL+JUR4rnJBKj1Lb6+0Skb4NSxqY47UEoM9e1perLd12JY1p4j1f9t4QtIoZdpjVSq4KSyjUpTgJerKblSBnPe3/gfyQ9noZuzuf+KYSUTKtx4DVgB+5V6Yqt17LSUyDm5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qQEmwAxE8k3Bd7hy2dH3fxWmK2w+m4dV46lona9FlWJA5+TK0NZGVJwDQhdlXho+zM5myNvsV3DNlhQVqxFW97yKe4/OfUmJjNWAplgBxQbdWYHR+fSP1b8TbwjIQ7YDS8MlnVWw9MJEK0JC6+2+srpbfIUneGscsXI87HeTo/UtXFHBXYxgE6qyltLoKZJ2QzHFd/mVUnpEWvcVsRJSbn89QUeRPKRxjPC8efZLmhOdLQPPf24fou2CP2/1vSdBamQ8YS9eYOtsdtcCAXZ3RntlBJIYmk9MCzwRGdOJjmvtpJKA+ll7lpKmUbwY1R2JA+kfIim24Mql8NtWgSnXFWK+eqv7ClvEpdomzvml49gip7VHV1eEY0SHzcrEd/M8m2MhwyLjIDsDAdUXAxwKFbgE0qdJiQNO65Qx/H70fHgq6ms+yNBAVyFGMzBz3V7fDlkNt3ehyMEg9ih+uForfEOqRAItp2I/fC0r7sq0P0x2jJJQ/awv+7ava64UKy1aMVNgFexU+6z4GNPzORqkvVU3KHkyG6yi0+ch6rdMPkQ1tHIOh7f0afIsJmnJJTSmOt5oid8rzg5kZvXiZEROzUzHja2vo5mFun0iqGC9zSGUrnRm4lNfyIHBSJlHCVPzoOcySlXLVPFvOXTzIPJVdlPAbzLZjjQAwlv3KTGWgK8jM5dODKYaIHcm0HxJP5a9Zv/T60JrksZYbDxNGRutbyv5i2Ij8i8RqudhVu0nwRgKmGROVxOVDCsM43Bm0R9x/bLjsAAE0xg8lGFVUdc2vlmNnd0Pu2b7rMNNl3E8wyCOPk4McqSXRviM4RPIBD0CotTm2uWkTisrQjNP1q9ZUeOeix7fQ8h/ZUFOaboHQvJxxq8lBmVbJtLXSG2RPbqAbaroCz/t2n3IDYBm++PDuvEKD6XUXBZ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15eb3f18-121f-442b-b1e5-08daf5b5e0c7 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 22:31:13.6509 (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: GKoedDfAvgXV6n76aOwJ7bYcqGLQfzNLRg6mL/PecsetJQS8RTyFM5Iq+LiFKNIRsWHt7JrjV5YN+BlrK2YTO5zPAFG6ZKAgsvyoeFfX1w8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7326 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_10,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130154 X-Proofpoint-ORIG-GUID: pv1G2gLvH0lszx2CIc6ZUUJVxyxK0i7M X-Proofpoint-GUID: pv1G2gLvH0lszx2CIc6ZUUJVxyxK0i7M X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: zzbft9og757dbo95ui6ikq5eckpw9fr1 X-Rspamd-Queue-Id: 4E82B40017 X-HE-Tag: 1673649099-29228 X-HE-Meta: U2FsdGVkX1/OtYSW+FvbElDprGuwptUnQplvihYZLK/4g7g+1fmD8cyCU4xCW8JVt3mOJ0ne8PH8Vvkpbsk2jfS0YPmfAdYesSXdSlA78B8WHLqTv7RVNiYn9Q8zlKrf/uNBIQLPw/E28vNlJx1qQAHPXLN3qzqYyrhV2Jg14aFIyUwDr9RB6wcA86EmVTJt6CbXkHFYkeRjsrurPb/6CWVx1mKZIWgbqF1yfoFP0unt2cDN1VcnuSQzcHbBJXN9uUvtqo+780jtvqv0AiQ8wgOtfA1xUNeCCmQl9Y39WHXp2Y0qyn+AjNNyR+cOEw060cFdqxMnmwir/CoQYykag/NLL/3DcFaRGDuOGxEhLF72Z/65ic0Pmnc3gHazBXiV8SDiQ0tZwWmdTavVPURkhKuuoAmWtCAw2C8z7UU9mEhPvd/rKFXsuS5mIhMNAqVINw5hEn0E0l0KWVu1G41z9qkid7LW2FP04awTmQ+giwK9H6Xezpj415xStrQmT8nuk0+/8s4f+XFo7ro/zri4gD+NDLpPufx2ExFDxr/F+nqfcmzig0pFhNFHyga4/uf/tglNrIrVB7yyTq1fMrWWPtUk2u0ex1nf7xWYOXJGwt2NorXC47u4dat7tcu8VzZyeP8XkMUj1BmAQXiuJO5DA8yqhQ0MeT5PYW30pRQQuBFIJgM4d3LyF1nc+U+v/+SsYg1ah2ZjJEGHJPXbkSdDM67aREYkyFR5UPxNPkZaE7vdFqxokeFyHOpSGBO03ak+1Pciuhsj6gTDDaGPWrUx9Bp7NXie4rugOo3+94JSN+e4hniqvDwm3ukXa326lujOT6ALwJnP/1dN2k+beytPAb9626sYNvmgp46kK7CF0IA0m5Gb/KqQ5pHgMdkEznjBnACuH3wO+ZspM0G3IzgkmFq+l3x04Ohbd5kNfyFQ8xxuoQ8pPqxtmQLqQS5cHs9GGpCqZnLY+UvzxldAN+C YUYaimYm uW6REto2ity/pjRC6aVIyXmgCwAYnKfv1o+Tsn1oOCJMloqCaOXYWsy8uX3CFnwpArntFnwahNLubaw0hBZGxNLeqFYeqv4B6rrh6JV3IK+cO+zumyS+ODZO4ZMqEGmNvusBTsJXpi2M5wJPVhPcqKYD8tA== 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: Use the hugetlb folio flag macros inside restore_reserve_on_error() and update the comments to reflect the use of folios. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c0cfb075cd58..f8cd0c694fe9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2675,22 +2675,23 @@ static long vma_del_reservation(struct hstate *h, void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, unsigned long address, struct page *page) { + struct folio *folio = page_folio(page); long rc = vma_needs_reservation(h, vma, address); - if (HPageRestoreReserve(page)) { + if (folio_test_hugetlb_restore_reserve(folio)) { if (unlikely(rc < 0)) /* * Rare out of memory condition in reserve map - * manipulation. Clear HPageRestoreReserve so that - * global reserve count will not be incremented + * manipulation. Clear hugetlb_restore_reserve so + * that global reserve count will not be incremented * by free_huge_page. This will make it appear - * as though the reservation for this page was + * as though the reservation for this folio was * consumed. This may prevent the task from - * faulting in the page at a later time. This + * faulting in the folio at a later time. This * is better than inconsistent global huge page * accounting of reserve counts. */ - ClearHPageRestoreReserve(page); + folio_clear_hugetlb_restore_reserve(folio); else if (rc) (void)vma_add_reservation(h, vma, address); else @@ -2701,7 +2702,7 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, * 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 - * HPageRestoreReserve would be set on the page. + * hugetlb_restore_reserve would be set on the folio. * Remove the entry so that a subsequent allocation * does not consume a reservation. */ @@ -2710,12 +2711,12 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, /* * VERY rare out of memory condition. Since * we can not delete the entry, set - * HPageRestoreReserve so that the reserve - * count will be incremented when the page + * hugetlb_restore_reserve so that the reserve + * count will be incremented when the folio * is freed. This reserve will be consumed * on a subsequent allocation. */ - SetHPageRestoreReserve(page); + folio_set_hugetlb_restore_reserve(folio); } else if (rc < 0) { /* * Rare out of memory condition from @@ -2731,12 +2732,12 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, /* * For private mappings, no entry indicates * a reservation is present. Since we can - * not add an entry, set SetHPageRestoreReserve - * on the page so reserve count will be + * not add an entry, set hugetlb_restore_reserve + * on the folio so reserve count will be * incremented when freed. This reserve will * be consumed on a subsequent allocation. */ - SetHPageRestoreReserve(page); + folio_set_hugetlb_restore_reserve(folio); } else /* * No reservation present, do nothing From patchwork Fri Jan 13 22:30:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13101713 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 12FD3C3DA78 for ; Fri, 13 Jan 2023 22:46:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1B4F8E0001; Fri, 13 Jan 2023 17:46:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A341900002; Fri, 13 Jan 2023 17:46:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F67B8E0005; Fri, 13 Jan 2023 17:46:53 -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 7223D8E0001 for ; Fri, 13 Jan 2023 17:46:53 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 3503D1C5DD3 for ; Fri, 13 Jan 2023 22:46:53 +0000 (UTC) X-FDA: 80351262306.17.3E8FF4C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id E4773140015 for ; Fri, 13 Jan 2023 22:46:49 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="HWc/4KxE"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=A8vppx84; spf=pass (imf09.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"); 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=1673650010; 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=pGdWAeKShSEOdUatZSw1ccDvyeotIBxn/OWkxHEn6r8=; b=GjZjyXlvK1MGxWhSrl1mUR4akpfAmkr8qOTaNQlpc0yVCOz89mCb2jYBy8DgaLyj9sstcb EB5DOp4tHwnCOddhMBFfLYp0ZHbsuLBgo9JZN7FJCYyCn5KzTKFZvBPqTXuZl4MJ9k4ZpH +3T1xmbtXauCDgeI0IWRS0f8bX7aRHk= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="HWc/4KxE"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=A8vppx84; spf=pass (imf09.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"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673650010; a=rsa-sha256; cv=pass; b=xhCwaFAmysfTyDYM/JZzSg4f1rhar3LjgR0WwOBx5onSdDG47aDJ06nfDwNMMn1BjOYmF4 jPPZjcvmEAFW3Y1HzdG6xzvWjcmDeCN32wxCjVryarnaClbDyYhMKcHJJiqVlFCFkw0Jrf q0CLm0vzck7WIa4kbDKR8wYS6JJI7NU= 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 30DLYq29016127; Fri, 13 Jan 2023 22:46:32 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=pGdWAeKShSEOdUatZSw1ccDvyeotIBxn/OWkxHEn6r8=; b=HWc/4KxEASMVsKQtqPzseaDHeehFDQ4MH5dTBEAAUZLDuv4RoZFPW/+yyrmRV29ouwqt mNkHmr12Lq1+2Jyi5NAd2aRwkA3wgOxpyEIk4NeyslEWR4N8rVFTh4xyTU56/wEjVvgc /xWCa0C32Qh9CRW9yzHbHSa4RcqJ+fYhTL1jWr75NTmYV17yGbbd4dg22uS3wGoidSaL 6eKRM18T4zlLFcrO26wHazT6ppHkF8flAASIKwD3n3Nn4VmXUs6vSuy7jynw8gobz/rC EqZw3lS5IfvIXtQ2cla+NIx/jkPpni77sZbjBEOyE7TBhQ6yk9VHda1vFasE5ggo3hMg Wg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3av80q6n-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:46:32 +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 30DLRNoQ004334; Fri, 13 Jan 2023 22:31:17 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n3f7usqxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 22:31:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=djJmpcTYxSAfPfqtoLwFbcZkvvs0VkIYS2PViOMp6uHgM+odQMlSAdY/DAZOh+VBCWHYocu+MPt4106Q3M3hGETfBILJmnwePcEGjbhHwFMEeSRyhkWHXUNcQ1vR4kZ6fnDMNAvRtS1P3F2EVnWL1Wr9l2EPMGNgEdpovVabx3Hnr04KS5UY287BoAjCb5HRS6JV3JmvJOeLEaIkCn5QeSW1jb0OsbG4ZasBadU98/gsLVtIt0QFgy1CBr7xT99aCs6ILZwabdUaT8BWWAtlLkayqM9dF0I8MgZybcwC2LTtEO6XSWmykFk4YbUydsnQp8e99wD6wtpReLY2tRlH6g== 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=pGdWAeKShSEOdUatZSw1ccDvyeotIBxn/OWkxHEn6r8=; b=m9uO+8Sr5gS0sixHPnpx6r4oWpGCUpF17yzVSz2kTWg5LYkaO2utiYDs1jnSFWG+V6doULaCkQSU+3FXRCPs4KEr32s7gvlliiNUQLhuzrrDVIUNuEcwxMLyrrrzBLAS8yk1Dfs4TvnjQtjgPhKnB2aZ/Pfw5Zia/fDLwiWMX8vvOvJeACvcuTCsBHIT/myToGlJO1WcW1se/WmejwzRqk8L995aGNpfhjb+hS9znL76dEcP9R5P9aUGo1k5hDXBRCU89gAL+9NhiGBL+gTv/USb2jeZ/6SfCxIYRReXjRDeMPmijWC0OL/jJiaXGnExVFzrVPBNC0Fsa9Q7y4fCBQ== 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=pGdWAeKShSEOdUatZSw1ccDvyeotIBxn/OWkxHEn6r8=; b=A8vppx84Ce+UeRY3C3nbeLaV46E8+5FvyQcz8PSwFmsxyCVBUulEKrsBQ4IxdrMi9ttcch2LCkeYtxZO4EyOL+hIZUzFScqIfhAm6QN931yo0NSZgVtkD/xZyWUxMtxij0Y/joiCW+RHIg0IuoQ3BnsLXqqnDijfNOABl9AF7OM= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by IA0PR10MB7326.namprd10.prod.outlook.com (2603:10b6:208:40d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 22:31:15 +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; Fri, 13 Jan 2023 22:31:15 +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 mm-unstable v3 8/8] mm/hugetlb: convert demote_free_huge_page to folios Date: Fri, 13 Jan 2023 16:30:57 -0600 Message-Id: <20230113223057.173292-9-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113223057.173292-1-sidhartha.kumar@oracle.com> References: <20230113223057.173292-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH0PR07CA0026.namprd07.prod.outlook.com (2603:10b6:610:32::31) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|IA0PR10MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: ea4b6c58-5c09-4e00-682f-08daf5b5e1b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LzbgcC0mDEsozysUs5PUawbs1BgWmy/bgLXBGV+sZx0tMrtN4/PGiYXhiWZHWOprygBbSSUbpc8NfsTLI6ahNkTCIrzpWUcb4v+J6E0hATekRXwypqzAgh/hbra37Y+hfQl01DaTLp2M2NBzgKMLT9Jyxzs4/vwuYUPQetQwjwx+hweGJHcSg0Vo7nV1uU0Os1+5iMgu8IsP5DsbCje9SVarfBZ1RuIMQ8bqMBI7lCI9W4ydjV1tuEUvjW3hBVzo/s5QcGA5U7jJMZZDgZ21ujH3Kq+4cWhUiApej4fSmsJy2MwBgC9h6qlzbrI/rPayX6oi7poQMivMZ8NaVMjZvtBOl5wqrfVvIdgAFpTL9QVL3lBgwIDXaDSCng0Ktah7K6Ws4cX4hkXvz3wfdBxajb2We72Uq9sa3gnQDejYYcsXK/rsO64OijVGJkjoe1R3yYOqZHykE11Iuf4aSBX6IQOZM2ME40tahZt21fM8MBFaGRUHLdfltvV3w/+/xxWWN40dPV82vEBjmi++MSWN+UWu/NQfsjdpck2N265xEnvDyi1lD7hBzdRfgJclmq3mfJl5tzknXKJYsGzCYxe66NkFhPhjbbAYL3Vqd4775vHaRVLqlauoic8lpKoKZDeEg2G/kf5TPKorBhAdhkAIiBmoTUJAhXyA//nJu2XXfD2sXdOTMAXPsUVWzAYoCj+M 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(83380400001)(44832011)(38100700002)(86362001)(2906002)(41300700001)(8936002)(5660300002)(6666004)(107886003)(478600001)(6506007)(1076003)(2616005)(26005)(186003)(6512007)(8676002)(66556008)(316002)(4326008)(66946007)(6486002)(66476007)(36756003)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CmZgAVOiRNVb9Un7kP9dXsFEsPXfeS5pU3gD6kM/l09cKcF/5k7p58VV2lUBmj9/6MYpLvJ29es1JBWDCoCoh1NWHJdsZ6qYS0/m8KPeKlNapCELT9wS6u3DxpjSXyBr59Yr479kLjKSfLljuYa8JDPXqKqZjDxdopWiHnjzn1cWeWpByImF3Povo7PGHh1y5Ybn5HfcZDl91HqLv88qmcSk6xVe+yw6oa2mrxoi9Ua4x6Xf3Ye0RmlpR7wUAc+XNAY8/u8NEnZemsPFFJ6fQfP6TOr2j+Vr/FZwgLk1e4Af7EAD/ICT+QDiwJtheBdEkHWQGiiw01lWConxCk+YMvcxn0jU+gbGmQJSY9PjD28uIQyo4b6VlotvFrQ2Bg3m6+7Aj9vhSTmzsrSYwe11xBwN3bJ4zlionbSWdP8X8uRVuWHQHef+Ue414JBGz5tXXF9Ru8gc6MaVJdf4B+72rU/RQm2OCm5homTKcD8lmVqkUZL703SZfflWRyVWxhtVCeSoZSLUtfgTZ5ksDVsZkrW7Rts7htIpOabrw8odM2w1H3R9LM9Vwz/a3GsnE/BLm3/6jdYZ872cWMIVXVd1S60ziYsnrRPJnzn/cR3tUOvcrP9Jbwf1b5pLP77jEVt4STDN14SBCMcLiPEpswKodbb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ULrqr5bvfJER6eR0d8vzBmBngUf/JY5W/xbyw8NiuTbQVsWjgGlGz5SRwrgLnrrg0DcY4LBti2HLS5TTO2BlmmBgyHG/kIGt2BKDbJbUjxcsqk6jd0/PRpbENmxzq6LRhqkXtCLA4PtWVfhGZ/+8yNW4WkZtPIYO1NijDaSlm2X+RfZ/XdHm3NfPLlLFfyCU/LY9LAegFNrQSxjnCGsE5vjKuKuRBvet85MdzHSbQ4IJS6dBlcIuqMk97L1G0H5BDp4Wr6BCYeP8fNdnUM/W41qqm5a40OETPykTSQDl3/b4gbo/NJnktCW0yhep+JZQy98jMb1YtV17bKusC9tcKR9u4NaigqbKJE7pHSqTHQ49lfmcjj/Lws7ZP9R3TaDPIGaX/igtujHNWzv9kB3MI1f3AFXxIGp6IL34fbyDzTdoqha48TiQaLqP7AWWKjZAeAcZpBYfL6rHc585mw3VO0jLP0zhKl1PatQ5x0wUaSgVcsWelJQ3uzfOZ/TJm0AXEs/Ykr7W/ANggYaIPfDV3Jh6kogr2dHvQyiOrz/2phMFtC74PDRCJLcDVX5c/peQBG57mWa+S66dObB5J+YxH9c1QoTBI/p0gVVfKtyxLunfNiApBIdnbdYaH+ekyoCH/yvlI/l49QgZJemT8vBqNvn2vWgObTeB05W5KGqKdvaJkU+/7ELkaSyv24fTCQIJEBweVPS1pShRhEJisBOu8hpLABFnEcP16wgLX0AHQnlJaYqivjuLTfc+NHyckWrrVJquFXibd2L8O26wa+gTz+j2n3oMLZb4lDgNMybJsgqRyr+c0XcODkLiA21DygK69oHb6pV0Yo3MuqLEaRKPMQ+Glfw+bJviD2CQIl+dyo1E0lH+k0xdDXA/Bc8LNUddf+t9sMVzHlivi0+oGMZ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea4b6c58-5c09-4e00-682f-08daf5b5e1b1 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 22:31:15.1669 (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: 2ISje+F35HFhK7AdM/Gtac3yShcL0Uek6xHFGyr8gLwuB9IX3zX8I04rf5hdinl4E1kVsD/SYcZQZfQe+kvKOmGIA0dY2as9woq2M7BHS5o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7326 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_10,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130154 X-Proofpoint-ORIG-GUID: x-LEmfQAOwQW5G69KFaqw44tesdE_SO6 X-Proofpoint-GUID: x-LEmfQAOwQW5G69KFaqw44tesdE_SO6 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E4773140015 X-Stat-Signature: hjpchn9q6pygn5sa8zww1xt9wbbbzeti X-HE-Tag: 1673650009-280160 X-HE-Meta: U2FsdGVkX18wb2obCfVVXE84mcYExyXqV13inC6lq7Mbsckz8DJrbM4TjxOf0aQrI5UjTumGsjz8HQuUcnEG7v7vRRzLSBcjlHpT1Aj+fzcGe+XO1YpZO14YrGECNgTI9FHgLYCo/teFOl/1Z1hjIckHt95QDv5yE7I6ahx1jkx6hXpZlBKx0efXS9Y5Xmhn/M/OUHa1KvIdpF89bJ+okuDT/C5ebjqmli2lbFIQj2EH3WDL+Pr0THcU1wtZKPMCDOa+oIMP6uDWvznqLNUH9F+0UL+gOuELmW8Vw3gkOC0ynnt/Hj7JYGCaFRtSvhqbqcKV35SuvGzwMId9S95oUv8mVBEWOqgGlRZzx0YJcWfSmtdwvWGJc5mPm7ug9ZSQ7HP9aer+K+8zUkKWKf5LvRKlcmzy9pPvnXUeASaPLZOEpu9D82Rt21ZrrUo10eIZjt+IgcLYL7wXSIsf03nNgbCSlLpUUZBuHnSOwklrF7+KuWq9JR8H8LK/e5T3FY5dnm4VyHvMSPwLNVnYLSNcJhMb3TXw7vNwW5VJoPbA6jqF+V2JSfGyi3lPmuehUYJbhB0tNZm6rUe/SGng0fX/22XKiTvjCygOAHL0GXYX4FmJ3Yn4vfS9vnXBs4bMJK6P4Ehe/qo46DHHLH93sjMfyT1BnYpskxoiTSiUAGZ4wmZ3rgY9Wa3W3jF/iWEWG2Z+SWeyO86Szh/HaxSYdj7ZwJEVVxwYurerilYXjMMb2cuHYN6GgIsRR6G2oRvRzsYv+6gTTh1N/xjWHZjPv0YZ5nryjDHR3DdqHlvIc8mpvsMN40WEs8j7s0bRgVqHqChIPqfq8SrOMAaCZWi7PLNXXP955vX79AcdIUUIw45hlOIUPUkB+eMw+tJ5iHSyZIya2ASjFALehpwAPwMpbqWvkuEacI0BePBAiRrutEkO3ekU3pFen5IQ6t/8VeTvBjaeIm9CuuhLpiUqQCW4fcD O9fEBteU Dq1qEeGnSvp/hD2jjzdB5zrdHXzDfhfJCATOYNK6SM3u61jUeFfrU/bbspOiUqM/x/1e1wAU2diewyrA459n2pDxKqtlH+TERHO4DDw2mE1lH5S7kJJC2Dot6b4QaLcKG22cvO3EX02XMA+vJMG6qkJP5tg== 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 demote_free_huge_page to demote_free_hugetlb_folio() and change demote_pool_huge_page() pass in a folio. Signed-off-by: Sidhartha Kumar --- mm/hugetlb.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f8cd0c694fe9..46c5daacc5bd 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3435,12 +3435,12 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, return 0; } -static int demote_free_huge_page(struct hstate *h, struct page *page) +static int demote_free_hugetlb_folio(struct hstate *h, struct folio *folio) { - int i, nid = page_to_nid(page); + int i, nid = folio_nid(folio); struct hstate *target_hstate; - struct folio *folio = page_folio(page); struct page *subpage; + struct folio *inner_folio; int rc = 0; target_hstate = size_to_hstate(PAGE_SIZE << h->demote_order); @@ -3448,18 +3448,18 @@ static int demote_free_huge_page(struct hstate *h, struct page *page) remove_hugetlb_folio_for_demote(h, folio, false); spin_unlock_irq(&hugetlb_lock); - rc = hugetlb_vmemmap_restore(h, page); + rc = hugetlb_vmemmap_restore(h, &folio->page); if (rc) { - /* Allocation of vmemmmap failed, we can not demote page */ + /* Allocation of vmemmmap failed, we can not demote folio */ spin_lock_irq(&hugetlb_lock); - set_page_refcounted(page); - add_hugetlb_folio(h, page_folio(page), false); + folio_ref_unfreeze(folio, 1); + add_hugetlb_folio(h, folio, false); return rc; } /* * Use destroy_compound_hugetlb_folio_for_demote for all huge page - * sizes as it will not ref count pages. + * sizes as it will not ref count folios. */ destroy_compound_hugetlb_folio_for_demote(folio, huge_page_order(h)); @@ -3474,15 +3474,15 @@ static int demote_free_huge_page(struct hstate *h, struct page *page) mutex_lock(&target_hstate->resize_lock); for (i = 0; i < pages_per_huge_page(h); i += pages_per_huge_page(target_hstate)) { - subpage = nth_page(page, i); - folio = page_folio(subpage); + subpage = folio_page(folio, i); + inner_folio = page_folio(subpage); if (hstate_is_gigantic(target_hstate)) - prep_compound_gigantic_folio_for_demote(folio, + prep_compound_gigantic_folio_for_demote(inner_folio, target_hstate->order); else prep_compound_page(subpage, target_hstate->order); - set_page_private(subpage, 0); - prep_new_hugetlb_folio(target_hstate, folio, nid); + folio_change_private(inner_folio, NULL); + prep_new_hugetlb_folio(target_hstate, inner_folio, nid); free_huge_page(subpage); } mutex_unlock(&target_hstate->resize_lock); @@ -3504,7 +3504,7 @@ static int demote_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed) __must_hold(&hugetlb_lock) { int nr_nodes, node; - struct page *page; + struct folio *folio; lockdep_assert_held(&hugetlb_lock); @@ -3515,11 +3515,10 @@ static int demote_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed) } for_each_node_mask_to_free(h, nr_nodes, node, nodes_allowed) { - list_for_each_entry(page, &h->hugepage_freelists[node], lru) { - if (PageHWPoison(page)) + list_for_each_entry(folio, &h->hugepage_freelists[node], lru) { + if (folio_test_hwpoison(folio)) continue; - - return demote_free_huge_page(h, page); + return demote_free_hugetlb_folio(h, folio); } }