From patchwork Tue Jan 17 18:29:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13104976 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 6DC22C54E76 for ; Tue, 17 Jan 2023 18:29:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14B8E6B0074; Tue, 17 Jan 2023 13:29:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D4EF6B0075; Tue, 17 Jan 2023 13:29:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1C6F6B0078; Tue, 17 Jan 2023 13:29:50 -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 C8BCF6B0074 for ; Tue, 17 Jan 2023 13:29:50 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A8A6940B9E for ; Tue, 17 Jan 2023 18:29:50 +0000 (UTC) X-FDA: 80365129740.16.846F6F0 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf21.hostedemail.com (Postfix) with ESMTP id 8B20E1C0003 for ; Tue, 17 Jan 2023 18:29:47 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=eB8gVcxX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ApU3DH03; spf=pass (imf21.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673980187; a=rsa-sha256; cv=pass; b=1tv8d2I6oco6T2MWmhx73jgryRBt6KUcigVNOVMwLO7GLkcmF04f89laf0ML15HR8C/w+A QuhDdzqiBEcE7HCowxNV4xwYU6xPpM1R2Noye89kPs2f0XsaI52sj8OkyJg1/omW4CE4U1 WXD1JI3c4Ko1o7Bp/4BNnzlzjGmdJTA= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=eB8gVcxX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ApU3DH03; spf=pass (imf21.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=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=1673980187; 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: references:dkim-signature; bh=Oh8j5JfAQkUPI8oYF+iUmi7/QCok3tXE7mRi6Smqwf8=; b=yseKKzHoNdbHI3uGJrJE7Bojb6pWukqP1s33LZJALZ3xH6XUC1z3Abs45NB7CWnXJeRa0m 2HRDIgwJYD1F9svEKpETTSRZvZQQOHMnhYMdek6LIHwh+/YDlTIUPP2dujylRCy+Jf9fz1 bSKVMO2tbi9ZtMd65pKR+fbhxCzDhSA= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30HGSYkA020285; Tue, 17 Jan 2023 18:29:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=Oh8j5JfAQkUPI8oYF+iUmi7/QCok3tXE7mRi6Smqwf8=; b=eB8gVcxXjGhHjIYF/fmbKrlYRjJp8nBpR2ttqkOHTQfUXoPKjGi9qumZ3s2GfagiK5Sj jDpLw+2xjkb0bGNCgBGBhfcQLT0KzteQpgDGnzL0lKsvlsCgraYo51k7nENTTzg1kqLL Y60EKHdtUx/GS1z8irqi1WqS0b12Ru0lppPBTl0NuUXyXjc9jA+Z8m/jvXKCdgZ0xPXV lfWDu9XsrWxFM+5abEefaeQku0Ot5+ndITzHCjazxx9BGQcV5cH+yY20ay00IPm780t9 qnj/CtdDWk3fp3f1/oIGswoAn7aRjqPsC57zzCBtxT9u5eo/5OfTC97h6VewalY67Cr2 bw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3jtunjk5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Jan 2023 18:29:25 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30HI4t5E015217; Tue, 17 Jan 2023 18:29:24 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n4rq4preh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Jan 2023 18:29:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HPYsWBhKRBI7+TZ8aTsRAdNdTIj99SivgVo0JQiibyW/7X8N/CAKrcpN9Fg9APE+k86YX2U2iAeywbZ8QTbFFH6oBV3sbhAyM9GJYo3sApa9ozS1dxQtncZve4GM6bmFbt2ftwIwJoUj03irNW/8gaJRBJUKMvO7uD2mCD24b6PFdeg9Y5JEUP30hhrBLoNsEADeCWVZ6wk5OEaEBjjNu5ffn3Pdg3986XRcxOu3CRa/WbAv6K/9OSWAcf80bLE24TJNzxD0s69wtA8B5D8C5DcNA0gBrUkUBjSK051x0UJVi+2ZEqQPDTOOPzm54bP3pehUpZK3fM8CvRLK8NGFaQ== 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=Oh8j5JfAQkUPI8oYF+iUmi7/QCok3tXE7mRi6Smqwf8=; b=hcX1ce0cTsUpa5+bdYZ6uwY9YeT56vST7A6MfR+aPQga+bNn98ZtmExNGqkt0iQT4HS/35ojVqWrrIlllmiFxKkXaN4pfjxUEQNjLtt/Co5BR3AL4UJD8x26V/IR1GBz3uoyBvla+cUCGC5wwY3E0/kUaeEquIfTJF8lIfvapiTVf/mfBBB7/6ajM6iSeBK/XpClt/KJ6wQi2l19hBECepQnpCWNn8Mu9GAUZdCQwYL+bZKkjdARGVaEsmuhNhFzoRtFDIDFDuz3MYHBnBxRdP4DMdsWUeUWBTU7ypxJozLsodbxYT2Bbg2wiIzb5femCNN7aosi1CsU+Zi/Goe1lg== 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=Oh8j5JfAQkUPI8oYF+iUmi7/QCok3tXE7mRi6Smqwf8=; b=ApU3DH030b6rm9cj3saNJ9xNKqQdqedLl4zpAduX+Qk1caDu7kE7u+Y1CZWZQSrYWJ3ZhCrjOclfuU5Ut2w+qt1G85uXxTyt033513V6MOvOh2zKUMhUeCx//UZc5SV4BJwBbN7vh8diyRhQmPnN8sBDsr+jMku7BjPUM6dEszI= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by SJ0PR10MB4639.namprd10.prod.outlook.com (2603:10b6:a03:2db::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Tue, 17 Jan 2023 18:29:22 +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; Tue, 17 Jan 2023 18:29:22 +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, naoya.horiguchi@nec.com, Sidhartha Kumar Subject: [PATCH] mm/hugetlb: convert get_hwpoison_huge_page() to folios Date: Tue, 17 Jan 2023 10:29:17 -0800 Message-Id: <20230117182917.73729-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SJ0PR13CA0188.namprd13.prod.outlook.com (2603:10b6:a03:2c3::13) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|SJ0PR10MB4639:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bac1b41-f737-486d-cb1e-08daf8b8c0cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ilEnUfKNzbwR04Q1QMI57w0VL3Rl1CHnLPmZkpgRWrsfgsSrg7c8KnfEj4o/aZgqv2EdGd4z+YP/wUaiHidCmZiL9JL8qd5qWcyZ0BmeP9jdSwYo6SdfCb0+1GuJJMoqlWJdUs66a9yioc22sXJlMSPpUG73twHL+ZgiIkas6fobG3yFf9KfJoRhlAPK+kgPwelOcMXQDuMtRulapJgYXssjq3KRwNQEIDCpo28aehGW2Se3AThyOkTUe3Sr9LVXU/7JtABGmB+kfjdEnpKSeUKKdP2j2BB217sG2bJa0OUpGvPapZ9Eivmdb/BvZGgJPqfySNRnueBVMCYJXJQX/THL41Uu0VwvdExtVJTfuAJVVR/EBInQYBvO4szdUmWhPYWInA6+kmrBFjpKiyMVznodApNsj9hwYHIKJdMhZzgjbFrW9aOe5qGNjUuuxwcsxL56Nlh4paOTI+r6yoHJ+ckKXPdUpKLnCP5EHQLoTkpUSx9mUd+dQ6s5TwEm3EIlF0iBYdamz2sV3h0bK+dp0K7X8qZISLzU6sX3ygV+UIFZ2hHAQGFFAgwx9eVuVIV7mdKbQJ6nViy64Dt9OUz2kGV6kKUj4iWG6JH/aYWITxfMXbnxklmeYvHYEo1ZGPq8IawtHDB/tiCzbgxEnoeYZnqKcdXeAuAOMdL1lS1geBt4a+7F0fpp0wLfMAaT5x3B 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)(376002)(396003)(346002)(136003)(39860400002)(451199015)(38100700002)(86362001)(8936002)(44832011)(5660300002)(41300700001)(36756003)(6666004)(66946007)(66476007)(4326008)(8676002)(66556008)(2906002)(1076003)(83380400001)(2616005)(26005)(478600001)(6486002)(186003)(107886003)(6512007)(6506007)(316002)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8+VAxGnwfpeUxiM2LMYWKDGEkrcq5AMjE1AukGOh5FXLRmLP3ga77qI1sfk7laJ1hVbuN40zHY6jpQqWpyG9MKqp19GLAPEcTHoev9Pg/1xVElsCa6IAX26b4gryAitidfoxAIHumkBOg2/t8PqFfi1+i5gAr/Y3VjDSiNwHynLoL5rMWJLkdSsc5hrqMCEJB7mdy/EjBrlBlRuSgY8e4/vSM+syzuWqsaKb+IzRL/+4+m1IePZI/Ioqhyi25nESNOhk56bTbzLwT1A2Q+P4bMJoj9aIl11DLnV5d6VoFJllFGiq6jtQnk2VIPCWiV06pGR4OeFqNzKFePKVNFMO5eNFH+/TXPzawVqIG+OFHUKKqP2L26yiYA6tYDDl+VzUnIB74uwXtEpC0OCzw1Ers7zVj45D+f3mVJZRSyPrECv/dMmjXPXEOMRdkb3qI0U7LnyERsaCVpVyG1WhhrxVFwIUa/iHo65zL4FLxFO1Lrkl7lT6guwb2QaM6ZEsaRiZKYA/TzpOeF7WCy1H/+k5mHZXjvRoZPY+2LRQ/jVleAAiBXha1qgnXLspL9fcXlMkXTVDtzsdKD4iuW3zzDKfEyYa7U92dAZYJy5yaKC92GZV84wcgGKtG+1qml9VFDg00/Dj8s/TTpwtTvp2POm1uP6vppz2Znnp2xe+B3yzZLlPKVKyKw5tHkyrCaTx9jnYBAJkvEsFEyV8+3tvP6V+FUGkMKwlOK/TT0x0qWpra2EJKCtFPsEsttWv50iW/tosskf5LCbV9togSyMLg8MnnlG39Ml4ZX4+afiO/iaXc2WtFpGKR0u/mHt6VRFuOFMvCe2cTQAvn99a8R4hCxym2MzgsUzIGq1Zc+02WpQC60hw7bqcIBWWVd68SrszC7brO+caqQG3+5VI4vMUe4IjWNi4YI6yju6ZiXE+xACcHAcT7ISZqkI0yQ3NQbsD9fTEHonKaD5ffjO7X5t1vkODZ4V+WrO7raHxo/Q5tmNkVq25nNL2VX01eSClTEmPMhP6TMRiqJfdZzAIYbFZq3w87YD/sjsb8QOy8n43gwxPvd7YhQFq9XS7DOMf2XWpJsz1ENsitA6o6fQ/V4/QUbd5wd3N+fgW5qbiLU4xUGZZ1gZPsl8l8GWKolHIx/0G/OeC4FFqTCJFOfkEX/D2n+7MLy8yRpyfvAiIjpqCVg242u6HyowRYSjS1AEPTU/YaOnwZcCMrcsizJodtbDyQh3e/D9p4XUg7VDUpjipQJH968y5++aDi2p7lSyuBoepGx6PUlFVXibYCgE2GgBJAWYFOFTl+xaR1mjk0XUkrfUv6y0JssYQq5vK81jaodRNBr1FE9pG1BSZtBevTrg5OqK/nRRz6qAiVm80oOmZReIgzs/rDjm372Fh/JSsFCpyzhEAybrrcco6fU/PKS4+YpS6OoPTMBmMOvt+U9lUqIghVakzwTmJHH5F7Wi1X/zSEKUVLW8uxDPcG8Qz9qCCOYK8lwuyOz7GqLw4rJnjUoDhdK4irXxpG1jPVGsAhmxcmumxHdDLvkAkxZ/jMZ9XwB7pNNq2XseEkb1G4xP0bC4K63gkrCZyPzsDnHXh3bA/0SSIRYRR8HNw7cuGQJ94KGR/Ig== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: JtJ3ZoHGoREZIVT7YU8hQbmefmPr9WPrOCxDLp27Dy9VMVr4CYjVDbtRZHvsR+jCFL1mj2DRWagVLP4LPLuqzh0Ri8ywZ5et6ziMS1yUWtRfW9jNY0R64KeViFX4RZS4XjfU624pXPUrg8q9yPumXTMZnDdUM/EoLjFuF0slmCwKMI/v3ldJmXHKHZw27Bqp6okpCKM5CSTVwKv3oRQKQzS2vki3IuK+SOBFHRzx09GzM7Dp5tMKTNiG3AqIubrdqe+8UIRHqzJ2WF1ClOsdKnKVYRSCP4veK0X0pK0Bb0g6jDldHmytVFM6uYjMldSeGiZdTjhBMsR1p9QsZ79O6twgXZdEv8mLNxyCE5f3hqIm61t6gecvaDzCZYZevxItQm9QKbCuH7/3pSUl4LHldRfoF2SqiDjmSaR0hu/8d1SF9w8CMqbTQ/1u+TtEaHQ0UM8ZNrfbXrpNZkAknLqPRN72KaGUeaSGa1cPiqjJchzEmpWAjKR1MssLBZYBDY+B3JiGciAqwU3tLLny4O/Smj381lfKAW7sxh6UISSTaOkQ2Y2AFKmEoIxbJIjG9RVbuzHo4NZeJFnWVdaOTP4RNlKy2cU5RFmQHLjPJOQld0XS9FcsgzxWEqJBR8pn/3s0qr3nCIOn/QJ/h8e/hECdK6jFiebCNIAZd9BsjqRej7DSBa7w+alH3Sa1g3k+p3zx5CacqvP0WAMfs2Z3xglXhMJKlTnNIgksHM8fkmBNLEoCrDZhVVx35WVcsahOpSJpimLBQ2JhBulJsevOq0t4RK4vYWyOpVAwZOYHOeVAF6zA9TyCm6eUlu/tf9nmqcuomkXoehtVw94ui2C/jXAmgN/U3uOT9KDrRidVMO+aTXiYNE16hyRO2F+QM44JZJm5Mx3dlLA05HE8ZegUVne2HET7RwLHsHZ6K0JCx3f1CgfhYmqcQ2+Z5rnlHu2VdvG5 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bac1b41-f737-486d-cb1e-08daf8b8c0cd X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 18:29:22.0929 (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: x+BHIM08+V3G/mOCaCZ9TWEEaJbZFshJ20skCuTUbkoQKvBM8JUx9jjbBNh8sGTetk5RyGM8QTKz2y+evQUZYU/AR+sp+IcRpE854ZjDNGk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4639 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-17_10,2023-01-17_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301170147 X-Proofpoint-GUID: 8pqPNnBuN-3T6ifhF-0wjLJ0AFASGF2k X-Proofpoint-ORIG-GUID: 8pqPNnBuN-3T6ifhF-0wjLJ0AFASGF2k X-Rspam-User: X-Rspamd-Queue-Id: 8B20E1C0003 X-Rspamd-Server: rspam01 X-Stat-Signature: pdeffwwmkwmi6jtwtw1iwmkbi7xcx4nj X-HE-Tag: 1673980187-995346 X-HE-Meta: U2FsdGVkX1/cc4OSTD7JfvvQ3Nm3ToUPQe3cJDrtOR6J1nnIRhkW4iS2v7X0AfaQoBgfACjo80XJxnxHwsGbcekVroWbnc6x24XiGdhLvTC0M7uYquGlmHidxY3/w+rb02PMM+0opqsJfXI/Ym2TAiTDyOoh/zGJ7CYFTFtijP+STq5ecq9RH+APTG6Lnf4+N+2YexrohSTMPEyppI9w9TpomC8ga2ejtbkOkW9kaBM6zIiaxP6hayYrg4Qk+giUmOX/S3PlyJ/tcsdQKZ/pMJA8DZy2Ua8nTjPY/wzO4ecN1xWyfez5jan+Gq6qm2nL3eYWzCLd1RdFXgN7xZRaV4EDy7fx7wwgj27Kf6YKd9gKo9aBcUMEWscOeKHY2Ns9WOg/oiiU5Cc7fbuV7cCvwjs/FzJSdrUHovmlM1/VfAeDk7ZcG1diVbvttqkv4A/vixJ0K4h5eMSzR1NCLS30+C9xtiVqTwA2tiG3eT8AgdCbIYyvUJauqCz+Y3njEWgF9IeA21x29RpClNxnTBtkraxC/7TYWhJLq2Muep+bHyN9f3M2+UhUY7DoJxk3g3zm35UbvpSP71gcQl+XSQCDNotQgkp/joHKlvMl2Sbu3rNVX047ohOC0ENwbcCMxOW40hP3kcBDGqZ65m2YCluiTKiHudioEuiRLXczaXARPA+Molg2N6TdMAawBd0HBkXpvlmPhYqMAvoi1c9chhecI1JUJ9gXux+v+u4Up1Xu/psYJV1UF4RkfOZilLfUEN1GE4NXuiJrSDxdcbZhVt0sgUhp3OT0PDfZ3PjzYCRy2PNvUBnWGWx4enxVyKAwhgLHzg70Vcf0XQmz7pclopfBV1nDgbBWalXPCpuCo/Oy8Xw5BXAQ6aj1a8gyUJT3MrIfW9K3FM5U6h/Eimuk6bYI4XWhGnrP3gFH5YvBORBSZM+JjARfAsmWLIRR5wr5xpSszg1Na669A2y2+Pm5Q05 HwLhra78 h3meAfgXKHaQKPMmhh55sZoM75QFsX3Nw1A+kWHPgZyTPVBTGwwUfNtp/RqCcBpgW6eBLByVSleefo+RwXoYfj814tOgVZRYLyfEtL7aTJZ3HwRRevdA3FlSvCRRf16XOaUbPATXDOcBS6KgNwdgcPm53EQ== 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: Straightforward conversion of get_hwpoison_huge_page() to get_hwpoison_hugetlb_folio(). Reduces two references to a head page in memory-failure.c Signed-off-by: Sidhartha Kumar Acked-by: Naoya Horiguchi --- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 10 +++++----- mm/memory-failure.c | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index eed1beed23b6..076bb8c037af 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -171,7 +171,7 @@ bool hugetlb_reserve_pages(struct inode *inode, long from, long to, long hugetlb_unreserve_pages(struct inode *inode, long start, long end, long freed); int isolate_hugetlb(struct folio *folio, struct list_head *list); -int get_hwpoison_huge_page(struct page *page, bool *hugetlb, bool unpoison); +int get_hwpoison_hugetlb_folio(struct folio *folio, bool *hugetlb, bool unpoison); int get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared); void putback_active_hugepage(struct page *page); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index a5340a807874..7a7422a43538 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -7284,18 +7284,18 @@ int isolate_hugetlb(struct folio *folio, struct list_head *list) return ret; } -int get_hwpoison_huge_page(struct page *page, bool *hugetlb, bool unpoison) +int get_hwpoison_hugetlb_folio(struct folio *folio, bool *hugetlb, bool unpoison) { int ret = 0; *hugetlb = false; spin_lock_irq(&hugetlb_lock); - if (PageHeadHuge(page)) { + if (folio_test_hugetlb(folio)) { *hugetlb = true; - if (HPageFreed(page)) + if (folio_test_hugetlb_freed(folio)) ret = 0; - else if (HPageMigratable(page) || unpoison) - ret = get_page_unless_zero(page); + else if (folio_test_hugetlb_migratable(folio) || unpoison) + ret = folio_try_get(folio); else ret = -EBUSY; } diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ee8548a8b049..7b53fe287ea7 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1257,28 +1257,28 @@ static inline bool HWPoisonHandlable(struct page *page, unsigned long flags) static int __get_hwpoison_page(struct page *page, unsigned long flags) { - struct page *head = compound_head(page); + struct folio *folio = page_folio(page); int ret = 0; bool hugetlb = false; - ret = get_hwpoison_huge_page(head, &hugetlb, false); + ret = get_hwpoison_hugetlb_folio(folio, &hugetlb, false); if (hugetlb) return ret; /* - * This check prevents from calling get_page_unless_zero() for any - * unsupported type of page in order to reduce the risk of unexpected - * races caused by taking a page refcount. + * This check prevents from calling folio_try_get() for any + * unsupported type of folio in order to reduce the risk of unexpected + * races caused by taking a folio refcount. */ - if (!HWPoisonHandlable(head, flags)) + if (!HWPoisonHandlable(&folio->page, flags)) return -EBUSY; - if (get_page_unless_zero(head)) { - if (head == compound_head(page)) + if (folio_try_get(folio)) { + if (&folio->page == compound_head(page)) return 1; pr_info("%#lx cannot catch tail\n", page_to_pfn(page)); - put_page(head); + folio_put(folio); } return 0; @@ -1347,11 +1347,11 @@ static int get_any_page(struct page *p, unsigned long flags) static int __get_unpoison_page(struct page *page) { - struct page *head = compound_head(page); + struct folio *folio = page_folio(page); int ret = 0; bool hugetlb = false; - ret = get_hwpoison_huge_page(head, &hugetlb, true); + ret = get_hwpoison_hugetlb_folio(folio, &hugetlb, true); if (hugetlb) return ret;