From patchwork Thu Jan 12 20:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13099378 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 EF854C61DB3 for ; Thu, 12 Jan 2023 20:46:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 471C38E0003; Thu, 12 Jan 2023 15:46:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4217A8E0001; Thu, 12 Jan 2023 15:46:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2264B8E0003; Thu, 12 Jan 2023 15:46:36 -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 1273A8E0001 for ; Thu, 12 Jan 2023 15:46:36 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E6A80A0C51 for ; Thu, 12 Jan 2023 20:46:35 +0000 (UTC) X-FDA: 80347330350.19.DAEB14E Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf20.hostedemail.com (Postfix) with ESMTP id 4C6A21C001E for ; Thu, 12 Jan 2023 20:46:32 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=i6I00Ckq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HDVzf3WN; 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=1673556392; 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=5ZhXU0K0obhHWYBra0myTmvhNZYLEHNRBdlUL+JmMXM=; b=SGMqNQbpvHgAh1/PFYQv88lSR/8qsdhAxstOb09/I2H/UcQZM9Uesx5zFGVILNIMA+mszp z6YR0dVPKm/gxn0nN0nfaWqfEwhBTuYbNWrtQzRbtfY8g4mFxYdIj/JScTqWyNLrWXRLrS D+Rwt3TuECxTu25tqZflM+Vf+ExrL/g= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=i6I00Ckq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HDVzf3WN; 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=1673556392; a=rsa-sha256; cv=pass; b=iSx/BfU6B0YR+nugXfaihZ53aB8wKOvQJeGYXcjus2Kspg1S0o0OBlo1tn0hFm7/3FLyvx TcqYlygMdgjWaSPa5ozODKGvQQYS7Npy0JYqWIUqBP4Ul98pKTiyuGRQofOjr6e+6Ljn45 IMG8nVmvqRe1hqg1qTq8KC++7MHx9o8= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30CJXrdB031605; Thu, 12 Jan 2023 20:46:19 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=5ZhXU0K0obhHWYBra0myTmvhNZYLEHNRBdlUL+JmMXM=; b=i6I00Ckq8ZfzjacFEutouPA/2JpJJhMqzZgmaCLWi8oqyH2Y2qlWQ+PWIOR9RV8Pgfi/ ++b7G/7kd3bZ9AcGRlaW+9lPmjNpLBa72/W4VOwaMH45wVJCbLsz5z8uilPJma946n/g AUbZDQCzS6iycUNINtq25ZrNh8mEIWuvvQ1msSMY/10LTDfkGYr/3SnPr2vOmsSvsmYl 47s9HWaxsKGN7bA2rtcGQsn761FoQmmSiHX955UgnzctPkWQd0wynhMxnBDNo87p7XXN pdwcr8exSizMOAhlU35n3iae2le/gvQf0JUGoqCoWULcQLPhzmgeuuzZBtEL+BOE6/Dp Jg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0sckagc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:18 +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 30CJPD3j016114; Thu, 12 Jan 2023 20:46:18 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n1k4ra2u2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fl+C0nC1xy9RiPk9zX+8eYuF2Yh3zZ1/AbPWPIIwmdWtmXsHi3FGv8HhU0ms5bf/8uEs/vtxM7n+6SEQXZ+vEVLXPTYlxNnUiuE1E0LlGIvo8IcaM9qxtdD5S+zIqpQjTEZWJ/WhIXf09outscZauj2iHLsdIxFlbOnEYOpt+oZc5djJ1YeAAaR0hSL+eKVy3ZvmYDMqikEVv/7fbl0biQW/Uha7npnzg+A8kOXzuSGZ8E17TsjdowZXS37LN2PbV7LOumEdxeXlYTC5s+A+mSn9Xtrt8nsAtkR5/V71d8JWLkWgQ4uJMqRs2/9bIxBEVr4ACqZrvvkFVWnqL6aQMw== 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=5ZhXU0K0obhHWYBra0myTmvhNZYLEHNRBdlUL+JmMXM=; b=bSPgkKJxX5liciQCVs3xvSCJmMgV1A7v9VRuY6Tv9y2bQSGjQ0mRv8qmRkn6Pie50urkALZAEfcXzeiegkg0YqEz11RAb2gEJ0Vr/8ZDPAGteC3leRw28G3sAd581+zO+V8C66gAIZzVyxK9hmv0THm7RPDWVDIqvq55hpbpTMKnb2Cafz7jv0NvPJQSxDJZE3nyRmEqXc3yUFI8hl3Z1VV3OLq9vNPlXTtKbyqRxJCUc5oEFD8uriylz5ecnScGExxR0H4gylf1HLmwAamgj7w50rN1/2+MH4OYr+Ra+/WzPSy/KLWAbOP2eosBAgqEvYBufqgLhk9pf97F6TFSjA== 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=5ZhXU0K0obhHWYBra0myTmvhNZYLEHNRBdlUL+JmMXM=; b=HDVzf3WNCheg83ULGX8x9+2g1twIw4c8/VzORFhQyV9f2zxVSo0W1yBI+YhLlwxKxYaK3/SsSjv97U/l5hIi4xFymMG9c4zZ194XwvZLJ8TIRRKW05jUyFdRSbuG8dn6CORNPhup/8nUKJj5+KAwBOJR+StzUomcdEMaU4Oprv4= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CY8PR10MB6804.namprd10.prod.outlook.com (2603:10b6:930:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Thu, 12 Jan 2023 20:46:16 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6002.011; Thu, 12 Jan 2023 20:46:16 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH mm-unstable 1/8] mm/memory-failure: convert __get_huge_page_for_hwpoison() to folios Date: Thu, 12 Jan 2023 14:46:01 -0600 Message-Id: <20230112204608.80136-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112204608.80136-1-sidhartha.kumar@oracle.com> References: <20230112204608.80136-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0P220CA0017.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::27) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|CY8PR10MB6804:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fa91f0d-7195-46de-53b7-08daf4de0c97 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bl10q9Kh8LdqVHnL6rBVtH1DLNY+KyEl+GkkkIMWx214WZLKvUIh/HqHTI9nrmBTHpKYH8MAq1eiHyXNS+Kh1UKmGuIRiH/bib/xy+3ko/R7r2v3QPeB2Y85zf9YJ0LlIOz9t2CfG5LW12pbdrAoqsZuJQ8nrsk5rxkFtXlrPdtXAF7XTyjmNJTWX6SLMfy2vluB3i3gbt+c+euC9ogLIIvduFlIQnmz0tbbv7Vo6PwuiLrnfRpNpKojfGWrXH7LBNWhtGm0ViIvizksaAxEeupmds3XeNLthdWjiNjBct/eV6Ukl0okgg6ecbKXQBW8DnP9C8k82m2wpMlJIidQkmTqtI90VW0PtFaCGfYIFOmX+DvBbFKyhqdodEAgpelox1bRbDrNyrPXxoAkKbsDFnklvLZ3HNx0PSGUKrjywL0ZZDGMvMh4kjnKhKd5JQ8UUdeDvFtaX/7Q4WmW3puGsuhYxznuzu7utv9enjKhN6KbG3vOArMnZUzvAsaO5Nd8VFyaxiQIZWlRWwSSvpxkeQx88wzb3eytcjv1y/A8pI19THSigiEG5ihYXu0NPfhGw1G8h/XfbtB+c/ePDJWoKjfelanq4MQ2t+phKBZrYQYCj8CFW1OKKRX2MMGC55Bz65qIvd47urZPPYki0pflk1hLXgQaQk6coLNyOHEz7McwmBGPcJk9GmEnwpiWbzV0 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199015)(44832011)(186003)(2616005)(6512007)(478600001)(316002)(5660300002)(107886003)(6486002)(1076003)(66946007)(8676002)(66476007)(66556008)(4326008)(83380400001)(8936002)(86362001)(41300700001)(36756003)(38100700002)(6666004)(6506007)(2906002)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5b50hv3DxMIRBWxPjkS3JvgIpHg5eLjCJRNW2vJLfq6SPJRGnGYj+Mb8MTDuyRiz5UdjIYbn/s0uwMcaIVcQPwKc9xRyA5tfMGakv7MQ2QuoZ2EoWS80G3MB8a2n+QXzmYbVI8wqaAyxxOsnBn7tV95gVwjloc64dHAnaNfCfI4vewv1FYOrykTa1MJ1ltWdYLFwr1nVTD9uIWezAdYoYy3llZQBIuD0+O5JXTzW7kTYtY7vkkIHR3b9mor6GrwzLmw4OXe0jlEiZkFSQTknI1LU5uYUzF9SrS7X6TXufD2SOPnGYmRyhd+2XjsQmS+hDCLoMPGqqpk46HgTzcfubDKzZJWeoCoCFGPvboXXbQa7Vwz0CNEQekclL3g0A5bfh2aCqLklaQfl1muUG6CL9Dc7I1Kr7geo+qhxdynzlimdpR/mgLuJ3vAPo5uxFeCbXi3wZgEF6IqP85EF9Y+X20okGvD1FdrfKQph+FWP5Rwn/mXUmZRXlI0lVcb536k9iWmL3YN/vtsrCjAhtEP3/Q0s4YPwaBljogQWzd5hvoNYKsEqpQT7Ev+/3d6HU50uz7ALzVoPQdLVCFdvUpIWvOWmutdKqi+YLwEUO1E6E7xPrnZgdn6LH1qBFVMux8pTpD20SoKr11s9UXgw20nMiQh8Cbsac1IA3bNUdwDPr+V9QxKwLuYxyynqYpvncrFtSxq3xwCXxClvNGQZA0LpwtpNJ5BG06HD2fHO2YP/3908QR6mLPmq7srEl2hDyrRC6W7c+te5eK/cQ2CgX4T/i2tIudTtWsbT/5Cnzq9CKEEahHRGZZyBQyiILYCV7WND0h+g0XpjrWe9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VarZXPv9kXSJxVPRTUFppuPWuMoWDft38KovZOG7k5KXlJ64D3/CXisefdOMiFY+Q2viTRupCJ+Vwf0tMfvUo+c6M5zu5gynP9qBUolfZcNZHVzYybHE53qiPo/i9G0z0ajhHVmRouTMeziGTYlPHBAc9fVatqLm+2bBS15hVMMM8NlAQo465+4zijFo/ADzIa+vX6kYHFqvrSMVCYw2E0a1YghheC6+86TYsI7ViAoFJMFZwZOmaX5MGyT8WY5MT8o0R2ymdF5NJXxaRjbvwsPPqq4UaCVoWg4MnJbh+nj1nDCjvYOrgQscj3ITw87esdUSoOrWJkRKCvxbGXxYA8h86d1kMKGJ/bNTYNRtKSb5S9KFIH8XVuaVouLZOdK7KOWm5H7fKvdePOk5RzGbUPkxyFcI32pDdOe7mEl8ClRtFSR0ooQKLlUHfsc+gHFqnffZJ3yNtpfgHFV68XOnTC2MM/Gsvao6++HJZcxxxa/ByKsG2hfKi4Ji/2RsFT4xsWZWW5zNF/4dEKmJYb7XAuHmCDu97sjjCcQrfISKtkzt+abNmdMPQ5nlzR5b5S9XyF85nrUXvNW/E/8UlAho2Pi4+3dXGL8yPSA5CnERa15aAwYUCe4rHYsbCvjYYhfzONLqjlOvS0BfuN6eNuYubZa45j4VkWw4j52UinPFx2+twewMnlrHihkuuSy2N8n/0lB4Wv2GCkc/WaHKb5FX8HtqNvjWfQX/DOnmIIOrXMdvoRe5aWtetyBVxqJ7/hBqHb13N+ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fa91f0d-7195-46de-53b7-08daf4de0c97 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 20:46:16.0163 (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: 9VIg8pzaEerT2Hp3nZ5zPwGiyFb5zUer03l54ysKg9ZEwcw13/kjHOm4jKFw9PPBayf3i1SjM4EG/AhfC3qe9w+um6dsxsFW7bLv03ySdvI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6804 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_12,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120148 X-Proofpoint-GUID: k5s4JmT990fZcuDW8dfB8ipmGYdokatp X-Proofpoint-ORIG-GUID: k5s4JmT990fZcuDW8dfB8ipmGYdokatp X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4C6A21C001E X-Stat-Signature: 4t6dmq75ui5ms11y5rusc6ffttf4bzhq X-HE-Tag: 1673556392-725540 X-HE-Meta: U2FsdGVkX183WvyN4tmTyewy/SWAzabN/5PpH36OFz2FNSb9qiEXYKyZDIlYUYMPh0kzjBYjece1kxp9DeaoU9jvp/46wxnW4BZ+CjN7fJpql8YRJ1FDTT02Y/yQzkzPHPLkWExMx2DQlsGOMK2DJt9x4ApBmITlc19QzhN9A7FK4iaXhiFq+9BQB0HGxxL2qc76tdf/w3hBr7XaRaQNlzOR/y3zk+TztyukejtvK8AwaBYrafqBzSR+9aW1Ohe7PbCj0Gv10YYWA00uEzlTboC5Dq3brJLmyHEI8QXtmcYdCl2SLP94EMHEyB6GHc6qqnIxmUWB0YgsfBX8peUvnvmsXr9KxTBXgFONFNTcgQwMiEF+MVUZd/QS4bm5YMcf+w1s49TjAp53HbcdQOJuJSW9IY4ed0Id0L3/4v8btsGKBZEW1Y76CPiar9BzoCNv4sxa4wfH9QAL3FwiIHAGs9WSmJelIvCpPKADdsto+FbN/cad+fC8vnLaNrnjuTfp/JOYgGCfBIS+0uI4Ey6f+/d0DRNCLB8Oe47ZxS0aKAThXmwrkK2vWYdlM09GYtlqvusMEHxD8xN4o/vxEIjXGxLdrBkyDazUPMRqvRdHwlUj9wW4SZlRHtv/5uB0QV9bZ8QRxTcWVPcQPf35p7WJUyCI2cALxPeULxUioCAUSEm8wqviwHQa55p0+I9HBsYnn3yeRHWfid44OZoAqvjRkPIY8bY7c/LyuPIU3KiPEbJTYMYis+kzaKZX9LirhBxvnXtD1N1e9J5bkruIb8h+49PDgvvz3mKJfIJzqbkjgmWDy4UjiY3VHruoA0tSWSlNcw4xs2bAqz7opKAQmfqaw+gaPNNFvbthvvFN1MyVZyogf57jloXLDV9XaMjN4HRcN3Y2o7wcffkRZ7U/RTzUNu9XXHgDBryHM3rspZrDy5KtAUGOX/l3NH2V3JuIPAOO3P26TOKxTnZCFbSh+EA 6Ci5nm9m zxVvsTQJOU1W33Qo9k/Q+tLXIy/g3xSBjOyb4L9kpIdCJif09l67ykPE4djDl4ygnAZLUN12gWzuI2Pfmko9xSuEf/sPsIPLZyL1tAJ56CaFsrM8JVo2HQY/ZGutVlpfGYrVYOZfP6SOT++aitiHkWIzNrQ== 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 a folio throughout the function rather than using a head page. This also reduces the users of the page version of hugetlb specific page flags. Signed-off-by: Sidhartha Kumar --- mm/memory-failure.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 9a80d7830b40..ee7e79ec6eaf 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1807,20 +1807,20 @@ int __get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared) { struct page *page = pfn_to_page(pfn); - struct page *head = compound_head(page); + struct folio *folio = page_folio(page); int ret = 2; /* fallback to normal page handling */ bool count_increased = false; - if (!PageHeadHuge(head)) + if (!folio_test_hugetlb(folio)) goto out; if (flags & MF_COUNT_INCREASED) { ret = 1; count_increased = true; - } else if (HPageFreed(head)) { + } else if (folio_test_hugetlb_freed(folio)) { ret = 0; - } else if (HPageMigratable(head)) { - ret = get_page_unless_zero(head); + } else if (folio_test_hugetlb_migratable(folio)) { + ret = folio_try_get(folio); if (ret) count_increased = true; } else { @@ -1829,24 +1829,24 @@ int __get_huge_page_for_hwpoison(unsigned long pfn, int flags, goto out; } - if (hugetlb_set_page_hwpoison(head, page)) { + if (hugetlb_set_page_hwpoison(&folio->page, page)) { ret = -EHWPOISON; goto out; } /* - * Clearing HPageMigratable for hwpoisoned hugepages to prevent them + * Clearing hugetlb_migratable for hwpoisoned hugepages to prevent them * from being migrated by memory hotremove. */ - if (count_increased && HPageMigratable(head)) { - ClearHPageMigratable(head); + if (count_increased && folio_test_hugetlb_migratable(folio)) { + folio_clear_hugetlb_migratable(folio); *migratable_cleared = true; } return ret; out: if (count_increased) - put_page(head); + folio_put(folio); return ret; } From patchwork Thu Jan 12 20:46:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13099379 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 4E144C63797 for ; Thu, 12 Jan 2023 20:46:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC2448E0006; Thu, 12 Jan 2023 15:46:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3D878E0001; Thu, 12 Jan 2023 15:46:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 81A918E0005; Thu, 12 Jan 2023 15:46:37 -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 6E3D08E0001 for ; Thu, 12 Jan 2023 15:46:37 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 31C9C1C3CAC for ; Thu, 12 Jan 2023 20:46:37 +0000 (UTC) X-FDA: 80347330434.04.4C13FEB Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 59C0718000C for ; Thu, 12 Jan 2023 20:46:33 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=mjWcQvaA; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hLvw8vyB; spf=pass (imf24.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=1673556393; 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=2lZcX7VrbQTi1+7mVOVczMeZDYnWD5m9QVBm9IatMv0=; b=uQrw/gJpGYELDu/99ge/pT/F5TgnC2WkeeUOzYHFeE2CXVANU0NewsHWgcAkbHkHOS9QIC 58mQr2xAz8fLW/dUq8nvMBCU6OyG0xIXj2flzI10WqNtnb9at6QB2WL98fpr10qMzM+rqx WIXOCG1SLcCWolDc76opgdfzm11EnBc= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=mjWcQvaA; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hLvw8vyB; spf=pass (imf24.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=1673556393; a=rsa-sha256; cv=pass; b=FIuNWUazj1IIxS4tkPE1HMnuLRMe9MhS9EAujVP4EKF3CwrV7DSxjTtnt7WDGvRd+T8oYI Jy8Llt6kcVB7E0Qmo2TEso0N+syt7xSiKoFK+OaBQ+FfA0S/qsvtSC+C0df0tD1nzCs1wj d6nX0CgDEg6ioUHwDf8Im3wFIW6eFVE= 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 30CJuNAZ006047; Thu, 12 Jan 2023 20:46:22 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=2lZcX7VrbQTi1+7mVOVczMeZDYnWD5m9QVBm9IatMv0=; b=mjWcQvaAIZbg33ZgLysJKp99qQywSZXJ3sQdBWR6c67Y3w1FdabqHBZCuK+w5UKk12+j +8CrO09stYoFihwEKVzGocrGyYEq8oUqpkWouegcDaW4V+qybfyqpFeqUkvao89470Ul qgKYrtRtVRu5w2On99IHXkcvz/tnyLMxCb7WjmG/05vW0QRfXJr3ZYUNKtaJR7LEbefX PcyZTiUfGEvKNlJvNVMzHzDMdFGkw3uzn7x/njFilgB1OIFUfUyIGpw64YT9DZLGrv5K F1zVu+rMZEo3g81LCeLNPmGPeu+GvDmCYXxJtVFevTVkgasI6Uji2kAzg1SeD4XcSyY9 Bg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0btud0r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:22 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30CK1TT0034162; Thu, 12 Jan 2023 20:46:21 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n1k4h0wcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CDuHZPpjvfXZljw8Ku/kMNAAK4Ed3+Y/M0R2yt2fNApqIRzhMbfUgl5ijKnRzowN/ANTQf6WRol5ojeisWwV70shUo1NVjmJqEddREoisWKSGshhYklJOsBauXb8Y1F00Xo0s+Ia3j9/Xhbcf07YbCtxVk+wnZF/rdYwEbDnXA+t4QpKnlm5eyAgV8phxf23FFfOLEcZZEFl20Y9KPiUekJDEW7JplaXUsVgYEFDRjamkdegq7K4DV0cAA5eHAHOqG2fZq0TqlHiXbOpQcchHbbTAvJJLIYcYpjY26mQtiEbScGXFHL0CzD+KUZ6F/XXJru278Ktcjs+z81WBNwMmw== 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=2lZcX7VrbQTi1+7mVOVczMeZDYnWD5m9QVBm9IatMv0=; b=eAr/ANfKk2OznBhysKBie3i2eBA1QpPGC0RjoihcUVounNo+40T78txbt6o3rLntuU3I5z+yw2IQnJ1J0sx4+OLkykv8xmx1AJcStNFVozOQtksfQtOqeu/9S2EY0KGfsiv3OzgJqy8xjcm5fC7ZPM99mr/23BeALoGHF5X283+DXUFEGN8rOu7KKM9CwPM1ez5j8kG6d8GoEZJEYCkF6TR+cSG51ejxfcJpiGiDJ1sOJj524mMic2/h1Ek57u4pRCFr3AmmDWXzMzF8v+2/O3Uk9lzPlvuQIYDMjARA0FB5AXNhUo3H0IJmhMVt5S4iN+IO4f0EwuKnfi2KRkLthg== 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=2lZcX7VrbQTi1+7mVOVczMeZDYnWD5m9QVBm9IatMv0=; b=hLvw8vyBn0tqe2SXQAPeUpf4iuDjOXxRMUcS5aYkuy9yF+UyMgRkPk8xGFpdqVGSJ1POe0YLILvmNUyBXZZ94RDX9s2wmviVszzNJFwf25IRei+ovDwrvoz7KpV/Rwxn/79DnmxnuDcQ8EEoD/skRdDmU++TnLoiTDtx0I8KErY= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CY8PR10MB6804.namprd10.prod.outlook.com (2603:10b6:930:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Thu, 12 Jan 2023 20:46:19 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6002.011; Thu, 12 Jan 2023 20:46:19 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH mm-unstable 2/8] mm/memory-failure: convert try_memory_failure_hugetlb() to folios Date: Thu, 12 Jan 2023 14:46:02 -0600 Message-Id: <20230112204608.80136-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112204608.80136-1-sidhartha.kumar@oracle.com> References: <20230112204608.80136-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY3PR04CA0007.namprd04.prod.outlook.com (2603:10b6:a03:217::12) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|CY8PR10MB6804:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ddfb8c1-2c13-47e1-8e62-08daf4de0e8e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qBb5htytBcNDKQVVIOoJoCRbMuCgsvf3jJJj7YCCClAUPRozCgdgoCJR9izN1dlYEWq2MuT94ihvRdO9SLoT5A5eHoC/UHXPnS3i8eydRZ33N+XossSEv5M1IMJ6azsybywNvaPEmhzHwdpb9RyoaSICBZ6sZaRNJY2qtj1JHA+3Ucexwu/jdu0bPtdcIx1jcb0C+6stO7la320iBTA/Wm9wnmsR5MY8o7MSpXGEfaTcSokRay7N5gFx45RCKI1El8Z0vz6EYZ0/mxvuUc5s1W3kurVVCe5VbfnMo3pDAewd29Vh3qP/LcA/8/qwza70z8uoLSROZtPh4qGtZtwqUi4bpQoNFAS+4Y0BOBiS4txApNUW+gBmAILvwwq9YdgwjSruEfvQ9mydXRqzlf/GdJEFeuBl6fo+9760xm/maMFPAp7hBNlV0J+Wp/aPVsuViex0cHT2JMdKWp2lVH8sb1JwaQsiyAGorwbOcza227czEa/8JAM4qze5nA/GVMWPZNqnhrU5TGPpgIJJM6o7z0UmsiMdfxFcgy2zucp2BXT5KqajgI2WCDGQ3OTnmL960qTeEBCTF547nau5dbKmjitvwiBTP/f07nsSrYeUepXxiDN0lXCQBUW73/w8T9eO9jKoauQpPSK5VA7bY04lmg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199015)(44832011)(186003)(2616005)(6512007)(478600001)(316002)(5660300002)(107886003)(6486002)(1076003)(66946007)(8676002)(66476007)(66556008)(4326008)(83380400001)(8936002)(86362001)(41300700001)(36756003)(38100700002)(6666004)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pbZl9pvNcv1gDF0a8YzTTFH2NxboImcrg4WDzUOwNAi+bR81iuxzFhn9MImlQ7EYTbJejEK37nkBkIL2HhAMkhYnbUxmOx6IFHvH/6Q6Uih8t66PSCPYFLLt6T6dECMpp8AsPsdSx3gnFdyWQMZcGuNA2zDKGRFAD788/iXc/YfcAO+0Fm/AJXNAI+x2b0/vhxojUheTooQmTIAdDurdD+I5p8DY4Ss4j7wpt5EKZ1ne9xi8z0nG0jYCVoPiwrRdkYud0/0xHhC92G1+YQu9ZObbM+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ZIFRUf5gcJktB6KJohtYkPUvIzGO+OzONbUGmHenNjuBQqQQNJSUcdy9iKlZMva4Ip8P4LqgD9lvvYW8iJRysSJdGt77eDX+PyB8fE3xVx/u4HBnqE7/vI36I8RtbKniUFrVsjUWMSAOgDrF/0LBDmhWhG+y7jAxdyeLi37Ct/N1YKCYD1RidTMxkWzj/HwZAoGHoD90MeOCmxpqoe1YaOnmdFktHmUifo+pMeVjGeb5kY6Ytt7 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ddfb8c1-2c13-47e1-8e62-08daf4de0e8e X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 20:46:19.3142 (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: h7Gg7g0v84Y9+StJMX1xrVPhxlI93qC5kJWjWTTkBBXd7pXP9zLfl4cTdqMzUadjkSldRLQDyWgpICuBY7Dc/AzdcinR0o0ViajzIouDaiY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6804 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_12,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120148 X-Proofpoint-GUID: bGjhiaQ2vQNaNY4PQdbSIzzKpyryC1aa X-Proofpoint-ORIG-GUID: bGjhiaQ2vQNaNY4PQdbSIzzKpyryC1aa X-Rspamd-Queue-Id: 59C0718000C X-Stat-Signature: 9kytptk3xzhhbdf6ede1mw7ydqxrtrds X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1673556393-15474 X-HE-Meta: U2FsdGVkX1/QjOF7k7GCFcepXNkUTbgeSv5FsM4vO74hCYKDfXoaeWL+oKZbEJ3j+MjelNLhzcNb03u+dCmErCeNuaotrhkunsrhIR1fPAz0n+MQQhcG2GN1NC5Lw3XiMEtqFnlABf62fEF3jUHqeXsft21Iv+EMTE8i96X9DUnJv53HufKW6cDiwxwvBVGPbStE1PivPauQrPc0270oaEMp1pEFGfAIuCH49cBA/CF50/oIsHu9A+NRC0uS7JQwD2tkEMyfGkVXCTMb+6PVKmvGDBHpyhw/LP7zu8jdhTSjeBV64/PmDzAv+aAkbKjLdoVSx7Hv+Np8PUrD+tbhRUriTdxLC/VNG42zVJGzUUuT7qmbZ84uenVjZ1ZENhverQjbpsiX4qSGRypErg8KSowKY4KMqC08xvaBsztcwroBtmZ/JhJJjb8grzqHcI9v5MeraJyT2eyiVuMtH10KTC+lmYG29EkRUCFFm/WcdTVCrGqzaaHJaDwAG007Yp8hn5bIQd31DOldBTik+ScpyYMZFq9lzADR0L8jSjob0ZKihR616kMK5ZzAPBRorodycPOljuqs1xLBnBQu8DXkJPo4ec6ikFAR6vkjsh/Y927QcLQU3o9bvPMrJZNeg3m7wh3XkSet01xVwuoA+3zHwG8NaYHvsAOOcNJuvrC3Vu9V86t0gYP5jScdRQXxiGJyYOI32Wz3EeizA556QO/lqIoi9lXYGTZ3+BCexM9/R/VUvmuUB0STfrrly+S45VE5W0hanW3ijPFtR4sCQxPICfyudDO4lDV4NVa0flUCG2SwwtGnW13k41YcxZFyn9ZpdyoArw0kZdveQTzcP+1BHXBFqkbgJyKYBMmnVh9eUhhHrnDf8th5ZJdHKxfvEu2juxbarNaLHY8GJf1HqM3MZJktpn6stGhYasdGDwP4voTmynovaQStv09WOzMkCLPYOjjQzwTt29uu+eCH7+n wlcSeMJx p8OeR6VU9X9AB60w17KRnmY/Uc2mSTFIEQ+/ydchn4zwrbIuWUWbq9q5M9VAFH36OotqmJOacsflUdZ5rdkYn65EIYprnWauGIa2vN/TZQoElsnzaoVfY1+Db3/mNwo+UjKvjr1K4xnRANbuzQJOdHeCzhQ== 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 a struct folio rather than a head page in try_memory_failure_hugetlb. This converts one user of SetHPageMigratable to the folio equivalent. Signed-off-by: Sidhartha Kumar --- mm/memory-failure.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ee7e79ec6eaf..ca84b27489d0 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1860,7 +1860,7 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb { int res; struct page *p = pfn_to_page(pfn); - struct page *head; + struct folio *folio; unsigned long page_flags; bool migratable_cleared = false; @@ -1873,8 +1873,8 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb } else if (res == -EHWPOISON) { pr_err("%#lx: already hardware poisoned\n", pfn); if (flags & MF_ACTION_REQUIRED) { - head = compound_head(p); - res = kill_accessing_process(current, page_to_pfn(head), flags); + folio = page_folio(p); + res = kill_accessing_process(current, folio_pfn(folio), flags); } return res; } else if (res == -EBUSY) { @@ -1885,16 +1885,16 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb return action_result(pfn, MF_MSG_UNKNOWN, MF_IGNORED); } - head = compound_head(p); - lock_page(head); + folio = page_folio(p); + folio_lock(folio); if (hwpoison_filter(p)) { - hugetlb_clear_page_hwpoison(head); + hugetlb_clear_page_hwpoison(&folio->page); if (migratable_cleared) - SetHPageMigratable(head); - unlock_page(head); + folio_set_hugetlb_migratable(folio); + folio_unlock(folio); if (res == 1) - put_page(head); + folio_put(folio); return -EOPNOTSUPP; } @@ -1903,7 +1903,7 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb * or demotion can be prevented by PageHWPoison flag. */ if (res == 0) { - unlock_page(head); + folio_unlock(folio); if (__page_handle_poison(p) >= 0) { page_ref_inc(p); res = MF_RECOVERED; @@ -1913,10 +1913,10 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb return action_result(pfn, MF_MSG_FREE_HUGE, res); } - page_flags = head->flags; + page_flags = folio->flags; - if (!hwpoison_user_mappings(p, pfn, flags, head)) { - unlock_page(head); + if (!hwpoison_user_mappings(p, pfn, flags, &folio->page)) { + folio_unlock(folio); return action_result(pfn, MF_MSG_UNMAP_FAILED, MF_IGNORED); } From patchwork Thu Jan 12 20:46:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13099380 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 E3372C677F1 for ; Thu, 12 Jan 2023 20:46:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 005E5900002; Thu, 12 Jan 2023 15:46:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EF6918E0001; Thu, 12 Jan 2023 15:46:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5F548E0007; Thu, 12 Jan 2023 15:46:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id AB3128E0005 for ; Thu, 12 Jan 2023 15:46:37 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8F33540E47 for ; Thu, 12 Jan 2023 20:46:37 +0000 (UTC) X-FDA: 80347330434.02.760E36E Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id A33AA1A0003 for ; Thu, 12 Jan 2023 20:46:33 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=0K8avunK; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=K7IzCtTk; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673556394; 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=pX5Ehn0FhmHlD7jbJcixLeN9Bde5WmQy5YXsDNwQ/bE=; b=MMPolIW6Ve5docVGW7h9jBrwi8csqwjdyBdXiGfM/K/2LPMNNy7WXICZkW7nV9VWKy9R+L DdUAGf2gc6B5fyl6/lzH/iyjpsXdypL/lRxisNdqLzmb0PNZUzHwchikFO14f+RkhH2kdI Ipyn9BGRlQeIQ4Od0zr9k4k+HVwfiP8= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=0K8avunK; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=K7IzCtTk; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673556394; a=rsa-sha256; cv=pass; b=vufCr0ZgYMzAYUN5pqSMIL4wCUyvvcL4Q7pTTqXRHfjt8VzIJTLliYBCxBBciSZICrEPZx Q5Pqu73GAc8oxxASOPv1sPtJpCEGgjg7BP7NsTurg7ECg7TugYAgHuDFMPEOWKb4EfUEaM tONiJk8yiJfId6lHOdysx7K/Ug6zcrM= 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 30CJubak006533; Thu, 12 Jan 2023 20:46:25 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=pX5Ehn0FhmHlD7jbJcixLeN9Bde5WmQy5YXsDNwQ/bE=; b=0K8avunK91DNmIJeOeSkAoI4OOXrZOhFb8AFtiIGE8+0zeNSXbooOmS5ylersbp3fKDF ZGZPwc/bjW7vnOCDz0kUsw75Wpt9sZriFL0Zkiry767Na6ecfs0Zat029Mf2fubXg+Io /zf5qcsM5EPpFcU8CQxJuGNT/7XxY8Obvv+heh+znlLCP3QYGgK2uhTKCyDuTvDgz0HD y0zwbynhhEXnRJ+RqxeC85/742jbNXzginKRJNyPKN2YPmMaul7jTP28Suk6StJTp+hY a/+gTtRWNK3igoZvqbthdjv/gc6yyWneBoXc6uQQ5GIDsDNGu1cAs/lA1zIvEzGXvmXc qw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0btud12-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46: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 30CKHvDZ005280; Thu, 12 Jan 2023 20:46:24 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n1k4brque-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LCQtWHqwvH96ngRGVGgxymah8VQ/7bYi+XKh1e6FByZhCmKj5exTlPnQ6mxqo9h3/kj1mDfjptuwBuKGeFmzvCvwwzGsQWpqe+IDlBdQr17WtL9VOUyxFYgCRRdebdVjULFQAaMvTVbxFryCCqf2YdLn/TanUr2DxPTHAEs6ALyBAi6+EaxjSwuNmLqW+tjtekSTJNn+5SHZOIuvNWl/YBJhyr68cx5rCzHgeoJyIxg+LDTuFTqyU9o0dVtfFtY5sn1KKPLW0DcfZZBWuEp/ubnCWq/T5Dx84E4238NSqGClq5qRm/qJy73jmwrv5w3VBIjBpw6O3FyN37+TMdim6g== 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=pX5Ehn0FhmHlD7jbJcixLeN9Bde5WmQy5YXsDNwQ/bE=; b=cwOKOKFd62rPteM74d/HhVtdbcQuzf+GCzMsep4iPWWrYTPJcKi3zjnBQge/UPbGKZ790BMvbJT+4PNlsj7vRXAYGQGEn0aCLHTGa705ET8BPKXTr9FBLnC+9CPNIG9PXXcHDr9uDF7Icc6ys2+UzdMVNLrX+lx/MAz4Ip+HRsAW+SYokMRDpXZZ4SPouvcI/KjP95aW8QqA9dwS0D390fBGQ0AG6E9yIk4o7PQgDVdX32Fdw8isncI4R2okmr/7EVx2rPNufxeVU1egzJK6qFyEqmHj8Hfxe1a1vsFkb7yi4FX9zwM0xagITUOcjDBafSDBXbxb8RzSFbp3YRrNmw== 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=pX5Ehn0FhmHlD7jbJcixLeN9Bde5WmQy5YXsDNwQ/bE=; b=K7IzCtTkYSn1LvhvfIqV0jOoS8T/ncRIbfGgnZUOYHRrZ23R9V0Ajmw8LwgsHPCGBxuA5M4SFq6SNmMuwZ/aTgANguJgXPB5GJhXwtffA8Jo2X99x4d9APLMA0yepCBs9mq6gQwlVzvmx3EOvYiu8TWCvtiwA5eVzwqCuu7E7gA= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CY8PR10MB6804.namprd10.prod.outlook.com (2603:10b6:930:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Thu, 12 Jan 2023 20:46: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; Thu, 12 Jan 2023 20:46:22 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH mm-unstable 3/8] mm/memory-failure: convert hugetlb_clear_page_hwpoison to folios Date: Thu, 12 Jan 2023 14:46:03 -0600 Message-Id: <20230112204608.80136-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112204608.80136-1-sidhartha.kumar@oracle.com> References: <20230112204608.80136-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY3PR04CA0027.namprd04.prod.outlook.com (2603:10b6:a03:217::32) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|CY8PR10MB6804:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a5abec9-8b0f-46e0-31a1-08daf4de105d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4qLPcGlIcOMpwqkqxCYWGWOvpccHBrliuDGJ+5ZhioLY9vfP9idzVpqKZW25RKyRhWDVo79mCffPobiPmCII5/YggQ8AJsv5IH2+UwYey3IFUA8q6ZGlCbGyGjJebnOAanFaDbuDZuQ4s/fTrfCC10pdIuSEn+o480vsY6Q5WZZGBvMLCzy9GCbce3558LZEb8vsviLX6bzEr1vkbHe0Hd6vfUrXvQBQWi9D6yu3gNWG41ykgTxLCxl5+YyXZ7aEj5/Qbe2z7MObwEBQFbM3CalTU3xP6TDAHU/fw1c6kwl22XxVRyHFs6sZggPEeMLBnxUIUNDFc/wVUb75n295lZakEsHH4cT/u1VSVIaNcfk7qt+A/R9PbuwuQ/MEB6U1Pgu9SiKiNQ2IOJj3pDL7JVWu2b6KeYKvw58nDmaymqRir2COHhcEEpvw3Bjw1+05KnISNCIyHVADb9jAXzvPyNOYGlxlMbfRPx4zkhvk3J2VyxjhJhOxsrHLxAkPKfy4w3w+k3DAAbAnVO12TnuZVAc/MVeXD9lH8pptByBO7MNZJ/5Nh9vz+5zQTdqV/Zvbiaeqd2xgbHRd7ZQbWbefGzDeRPNvbAGy8WQa4MmnzqkIq53+5SJAT5nLgKE+lIBSBEnwEQRZXIpXAEQHw56duA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199015)(44832011)(186003)(2616005)(6512007)(478600001)(316002)(5660300002)(107886003)(6486002)(1076003)(66946007)(8676002)(66476007)(66556008)(4326008)(83380400001)(8936002)(86362001)(41300700001)(36756003)(38100700002)(6666004)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EcCFvgPpE6aHPDd5OYXiqvacEF0v4RyGbKAr/NCUMEO6fb7/Qr2/xJi5/HIqPM0CaU/a+OpVxK+zm/0/rb4N0V2ZiB/7HZK1MpJVFRmssCeJPkX8OzhigJ0FHLogN+zLO4MUHXJ629FCPbISXwsk8JHyENQzRd+fMs85BBYNsfbaTZiNpxk5ZuY25upfc0pTS9gyg6GfEfsgoQZdOVLDT22UX8K1TaK2hV1n4chX4CNOmEFnDSf6XXkiOf+yg0Y1geqr+yc8O6sU1AOU4d1+N+Kp3pT3uU8eqFBWFVbvGIksMXwDMOF1F8cWzklTDseSg9ynVYzGyDpYvcYlxmXeyEoab1DxjcjEpKtEv6jcCrQzYOh9n+8XLgjpgd7LWOMOcpPzDtcC5Jo5U7tHzO0cpKgOYFN5n/eKtwgmLcektEb3oHmvUCImN5y68cfbjIbuL5E/823vKFoUgdhRzHa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8OvJrWBrpn+gt1Vhx1PbnHAxQZlAg8FwqVkoqMEyL5Qp3vEDX8SjdlCl3YaJ3vN X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a5abec9-8b0f-46e0-31a1-08daf4de105d X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 20:46:22.2993 (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: KYiclIHPahYIRhny2vsCkp7Izr1boSK2Sg7bnmrkwncdk54gPGB1rvHqqGnE4uCc+gkkYMI+JhBWjxGnhR71O/zgXyfo1+khXNvVul00djE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6804 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_12,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120148 X-Proofpoint-GUID: 1xZiVx2AFMGGpg7qSevcJ-kVo75B9KZy X-Proofpoint-ORIG-GUID: 1xZiVx2AFMGGpg7qSevcJ-kVo75B9KZy X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A33AA1A0003 X-Stat-Signature: d84t4zxi36n4miokwnu4jwpdgmkzpskb X-Rspam-User: X-HE-Tag: 1673556393-656003 X-HE-Meta: U2FsdGVkX18s4DPQlz9VYoliBKMYr8Zq+jaDV5P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aD5USp37+BKvauLIL0JFtyNgKkkDw== 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_clear_page_hwpoison() to folio_clear_hugetlb_hwpoison() by changing the function to take in a folio. This converts one use of ClearPageHWPoison and HPageRawHwpUnreliable to their folio equivalents. Signed-off-by: Sidhartha Kumar --- include/linux/hugetlb.h | 4 ++-- mm/hugetlb.c | 2 +- mm/memory-failure.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index befe64cb40d1..c33e36f5a1dd 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -823,9 +823,9 @@ extern int dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn); #ifdef CONFIG_MEMORY_FAILURE -extern void hugetlb_clear_page_hwpoison(struct page *hpage); +extern void folio_clear_hugetlb_hwpoison(struct folio *folio); #else -static inline void hugetlb_clear_page_hwpoison(struct page *hpage) +static inline void folio_clear_hugetlb_hwpoison(struct folio *folio) { } #endif diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ae9c6ba07a8a..a5d410c16cbe 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1592,7 +1592,7 @@ static void __update_and_free_hugetlb_folio(struct hstate *h, * which makes any healthy subpages reusable. */ if (unlikely(folio_test_hwpoison(folio))) - hugetlb_clear_page_hwpoison(&folio->page); + folio_clear_hugetlb_hwpoison(folio); for (i = 0; i < pages_per_huge_page(h); i++) { subpage = folio_page(folio, i); diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ca84b27489d0..205272c64f37 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1785,12 +1785,12 @@ static unsigned long free_raw_hwp_pages(struct page *hpage, bool move_flag) return __free_raw_hwp_pages(hpage, move_flag); } -void hugetlb_clear_page_hwpoison(struct page *hpage) +void folio_clear_hugetlb_hwpoison(struct folio *folio) { - if (HPageRawHwpUnreliable(hpage)) + if (folio_test_hugetlb_raw_hwp_unreliable(folio)) return; - ClearPageHWPoison(hpage); - free_raw_hwp_pages(hpage, true); + folio_clear_hwpoison(folio); + free_raw_hwp_pages(&folio->page, true); } /* @@ -1889,7 +1889,7 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb folio_lock(folio); if (hwpoison_filter(p)) { - hugetlb_clear_page_hwpoison(&folio->page); + folio_clear_hugetlb_hwpoison(folio); if (migratable_cleared) folio_set_hugetlb_migratable(folio); folio_unlock(folio); From patchwork Thu Jan 12 20:46:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13099381 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 0BB1BC54EBE for ; Thu, 12 Jan 2023 20:46:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 92DA0900003; Thu, 12 Jan 2023 15:46:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8DE238E0001; Thu, 12 Jan 2023 15:46:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 708458E0005; Thu, 12 Jan 2023 15:46:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5EC708E0001 for ; Thu, 12 Jan 2023 15:46:41 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1BA0B40E1E for ; Thu, 12 Jan 2023 20:46:41 +0000 (UTC) X-FDA: 80347330602.18.49DAB5D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf18.hostedemail.com (Postfix) with ESMTP id A85AE1C0019 for ; Thu, 12 Jan 2023 20:46:37 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=ljq+3vLR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YtXTDONk; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf18.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673556398; 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=b/N92ggOTVESy4PAPzARUeux3nxn5O9kMIfCDwqMIIU=; b=lbym69qKNk0q90eku4UqskJMKhsbsjZQ9XRrfvlDa6RxGd3nQdeGfdjRGIQf11IfZSH37t /W8+nbbLMoDJXLct1ZkHQY0WgKLTR+0hMOApU0SBx9MR9H6ZusbNaruiurnvLDQUcV+Plx AD3movjqSYF3EbPCwtn8q8jPiwL/GCU= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=ljq+3vLR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YtXTDONk; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf18.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673556398; a=rsa-sha256; cv=pass; b=6TytL/yOGqhUaR6dtgHsxfjjiLwX/LAewliIl5rzhrktx/cbVzrD0XGC6j/vCWS8eERPFr OKUEXkp0OKP2GtYDGdhoE6YQCw83afBIDFt9TOZCuFjjdEZJdr4KbEaqwYO3etrk13vsTU +8N2nJDO5CA0mYd9tl6yYgEMnXx8OOg= 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 30CJkHMd020386; Thu, 12 Jan 2023 20:46:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=b/N92ggOTVESy4PAPzARUeux3nxn5O9kMIfCDwqMIIU=; b=ljq+3vLRXrDEojJzJyeBmYnf1zumD+7fVERIaOzLmbndUeF9raCY2ZpJO7C2YaqBBcIH s1FSMOdQLe3PIInOePtWebSGRPfaRmoVN2GbAfFrbcRlMXqarvkzzzBm0eZyqvk19yJc daia6/T34w+1nx5fJx+x5xMRH+X4qmnmrz10el/GG4hRFyVSrxn0r8N6HAGiU93oVDe5 B6wesc93b5C1A69y3h4XvZsWyumLjgBFK8v4j0tYs3pCscnzqjhRJ88B2ma3iRpN9WnL T1hk94hAbLNrvf20/+qmOXgq+4yiIQHIkv+TiE/WE9zklFWe/jg90Tc7ly3uOc6sj0Zd +w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n1y1nkhc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:28 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30CK1TT4034162; Thu, 12 Jan 2023 20:46:28 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n1k4h0whb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hk5/IN5KXqQmP9di7gZOLoEUtCtPCFgaiac4R9I5dkoEvcPwdGqmIX72W08oS+HEkSGu+YOvY+wJqEXvQGfR5t3iNyMy+so516t4uvFGVOV/wn9BFUkbmcM58yNMtJgXSuKCRa1O/c+svZadOjzRg3njs5olMVkYUos1vEm11KB+zZRZ2cKcAqmyWUuuvzlYaSAcoea/xloH1NbJ60fJe+Sm5ykDjxCofMoBQz29mQvQtCxY1uCA+plYNcA0Q5AiOXtH4Fq+uN0S4uu1QzYMViWltUrDqqLjoR2iwWpPx3crVR2uU35UwGJbBgLQZSOgnMnr/XIDB6DJC+xxBy2jUQ== 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=b/N92ggOTVESy4PAPzARUeux3nxn5O9kMIfCDwqMIIU=; b=lI8pPhXCLUyQbJ6C96MDvbPTk2Uo/sP8uPkBciY3ZxqNMgbdTHj84aalYCkvIa4hfjpyvIyL/pVRIuxp5V7Ocu8wHvgfYxqV/4ZlbccPfz2BW2xLvY6qmEKhTyfIe61Mq+GAO0E++JYPjYAmJKXIFQ8tS0YsY59Nfl/7pXzx8eM/68JEaF8bOV++qTxiHPiqIGI9mLPugZYjF8PsbF9LPoncJ5aOSGzBKxlAZBkR0u6UO7Wbbn6B0iwY+D2jq5AblqRAenA6+dqNDFr0F+MsRVS5uz7LMejVrwA5mRqgbFVgLRahkZaEaQUDTrrZcBcmGZs76I3tpf2HwamXU8OGwg== 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=b/N92ggOTVESy4PAPzARUeux3nxn5O9kMIfCDwqMIIU=; b=YtXTDONkDgcqyOjGSYZHvisAwWCEOjXLC9x56CjBAkrA7J4bfA3VHftfS0FP97ycpsej12b42Aew6DWdY9uoGjr0bwjmENT6cjNJNAeh4k7qWAy6sQWjD62L8mqNqYV7HAxwrig7S5LmqHmeHFDxFVORve4ZVhP7v3Li5r74DU8= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CY8PR10MB6804.namprd10.prod.outlook.com (2603:10b6:930:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Thu, 12 Jan 2023 20:46:26 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6002.011; Thu, 12 Jan 2023 20:46:26 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH mm-unstable 4/8] mm/memory-failure: convert free_raw_hwp_pages() to folios Date: Thu, 12 Jan 2023 14:46:04 -0600 Message-Id: <20230112204608.80136-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112204608.80136-1-sidhartha.kumar@oracle.com> References: <20230112204608.80136-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0097.namprd13.prod.outlook.com (2603:10b6:a03:2c5::12) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|CY8PR10MB6804:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f732dba-eca3-46ae-27e1-08daf4de1246 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qK3wrl6vTo4mDujOGLwyNRxaQRMuA7JFtcMccYrBYCyTY2TFB+hXrf+eNiDZ2DMk4MbnpV2+aMnoSgElLw3geEjojkysXeagiygkmI8/il6ptdGca01r/Pb/VopzKTa8B3drPYOAd+ANw6bXZhdoGn2FSYWHE+dCQW7bKDL4bucCSrt39hY8uh00tgaAvQMeTeFkC6Zq06FdgmTMVl9gZBKmrX+bpql7VkvaCX+Q+mdaOqfIfNXY0FQMYir90IGb3SQtp80CBxIwKrl/nCBeIU6b28+D1U/Vj/YfItRhrKEebYj/+/2fTv8qddTU5ivD52NthoFi/fQTuI5aDFIc5a1+/qyYncXwv4GsNmHdbNGO6ryoAWmBVfvlhTIBcsVlu+FCO0n4mnCzqBVkHeQJWJUgm7w1320Z7/l40eePCtQfnz3jxJHtsa1845kkpzZ1vOaXU1ERK7NJSbGgSB+JKS+4ikGVCqaXFo0743/66rVRvOVgLVXnlYrF0+trQb5oqJOa8WX4JOOVImbZilJRW5I9kCv5FFqkMrnT1ufHazDbUkVRrD7vEhrppwFzpRSpYewGjczqZgRbbAVQDmpJe9ZmITdzQB4ZsYTdC75Aa78eeQCU3a9KJddS+PJbF19NwoaeKJYxASzuM4v3LQ7qoQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199015)(44832011)(186003)(2616005)(6512007)(478600001)(316002)(5660300002)(107886003)(6486002)(1076003)(66946007)(8676002)(66476007)(66556008)(4326008)(83380400001)(8936002)(86362001)(41300700001)(36756003)(38100700002)(6666004)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9DKwdJ4XvFCc9ZfwwddG/ZJ077A3nrGL+lpnb5xHXE2dkeUBN7rwjYTaiittIsOwV2RFchPELPESiGsAYGyAi21ffjcNww7M0LzmV07UAIPPHlQUhYBydsWaAmb6klBII17qfenM4v0oxU+9uAH9mwryrxQyisCLpOJcHH4MoIdAmeBhLeFVCcfxIFFoTJWvPJPnw6tufqXxKFdEpLhUz8b+7Dfn9lpWEkT89zqtVwqLH27i2LEtgF1JqXtq3lBvvD0nO0rn7u2hBsZ7SAy0Wk/tEGR0Oeri9TR9gw/Vyc9J1WcRJfGErwqBrLoENkQTskX20Fpz+y4iWQKSn9kGLjKKqXzFUn3ZZsoiGh2bJeSjn7RJ/rX5nWz0ONb8zlHazRwQgBL1Z156JJ4ltVNTSd2XgU4q7yNw/dYgRUlQhXYXkATvQrC2H+Vc5oRLv9thYO1dbO7Rxvc7KaiyCfD7/70vIHa7vQcnGvKhf5zjUNS92estOoiZC+EPkQ+E14acjYJ8JhZIEvbs/SUFOcyR4YIgXcM9jhw/5kttuwXrv6Fm2r67s1MzLaxc1jDAMw4jwUxUjzPDCGU2J+Q3F1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op-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: HZku0l0JRcKKuqTEpkOMguqs8pt1zrJUumElap0G7tYXJTnM5W5cUgvLLJyrYhoVmNWj017mUfFQufPXEGNtNYPiazsU8KgEcmHajQOMY7hjB6ST6SR/8zSbDYuivxeKcJeu6hwFTIavg3M8+SiHqp9LRbOSed6bBJgPPjq86n4Bsh9QGq08uoPZc/Pq6kyZ4xcGIeGY0AKleQaB5RaEyjp0rThlJx/dCx9YG8JA4TvJG0mQ0kS+v8nVMWkiFGxgnfcCDwhVwqsiCpYu1l4V6DDPR2MPRL0SJ66dU8A/vAL9YzaRtfaCv47eyfnjwYk3lI4WGPU+k++TMShwg9OE+9XRPHS2jHUV8kaMyPtzjo7f8WmihyfmYyYeSq8bG0nWHUQm5+q6KFZ/gYw2Th+VoSdaSnAmtdt+aEyX8q23wMx0kNB5fZdxszEiSv76nxWVtcP+gdGUQH2hMnuExjwIXaKSPi6f+FXhhf56kIFT9AAptcg37tek/76fu9AjEX/hUwfRii6YZ4xwWU8skfqyR+j1XX4tSJFVHRgWP1jwkoQerNm57SLQJPeNnu6cQLSb/Q78FYatqtAlEw22D9OLyWeeMTVqJuTNMYkgq504IQohYTBu8xKY6fF7HfngbQ4MSPAlXdHyAcOQ9DcTCB5SZppHjou6ejsPeyk1Du6i7FoU7zCbcwJyLU6dI4/+Cb5z3TCSvCCdtGYUfQMC5b6yl07nXMO0uf6LZe/cRus9SDK6ntwngVApZb6mn7FjWOywNp2JsbLHfMM+w8dRjzzlqQgx0JSym/rq/rCiMCjBK980wYLrrSG92tKT1/1lMXkcoZtFa712JecLBBuY1YpV1VJhGNhZItzWPErOj9gJcUFlYUj3vNxEerPTw6g5uIR+8Rp0Qneop+7ME0yy4IDWVhCgddK4qDvgLLEJ0IXfq2Xr++qXvkI8b/VHypbWGe3H X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f732dba-eca3-46ae-27e1-08daf4de1246 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 20:46:25.9100 (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: LUF7txgrpUeYBdpNrQWBzrnp2h3BnL4tKwT1P/fxnIdDyFjz2EYAerLso+VmXG2aH5P95DLndyLloSKcxYAs1tMgeWkZ49CX2dOwkE/zogs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6804 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_12,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120148 X-Proofpoint-GUID: Sarck6fyytDvRWeuTYgSH43y6OwR2b8e X-Proofpoint-ORIG-GUID: Sarck6fyytDvRWeuTYgSH43y6OwR2b8e X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A85AE1C0019 X-Stat-Signature: 3fka57ifeg4hqdyfhrprgjc6ep36fs89 X-Rspam-User: X-HE-Tag: 1673556397-874110 X-HE-Meta: U2FsdGVkX18avi1+NVJPoPzSU5MKI0qw6ozOE4ts9l8vsV19yaI+8raVcIaYM0UAc+j/eW1Dz9rc/9XdHHWlFNljFyoqtfc2EiKl7Pno1m+ZM3bZr9jbBbCUcOJlrczUg91IGNPbpUwJ+6pMKq3cSsWGEbp7P8/sBXAZ7o9NjaQqoszMmFcAGcWHgZDSJfLUNQd5pHdU74ZyC1FFX6Uje9W/qms81eDnz6FVl3nxmiSwpd3skRfbbBddCANt/10nouom/wLuxEbWq9pi94yWG77EGmXoWCQ6z0A2epXDAx5z9lqd/pXcFXkzGy96VHIstGRrWsuZ4/xiVUFohZlmSf+aCz4SB/zThNwdzJBRa45LbiiBIilqKk0K4mE6ifFwQQi1S8FZa928m3zzSsKP/Ep64g8Qdq3eVEeHmRXAdtYrBBZttBQg4S74m0NFzTVSiC1XpfrkKV+1kpzHKqUk6AhuZ5JnlQRe9vVvMe9d3vEXytCiEQGXMx2jgtHxaD+bLV/CFXRet6/sa33HNNRQWvh6FZCwxGmijGtixNIexunuoqaw1BiBx3GDlVBH1zOJ/4iBOqfPWxy2ZvxpF1legRDoAHnnBu+QYhFgxWP5mLkmyeAZWF9+B6TIc5Er8yl9chqcVeZjPual88bOtkuuOyBnbWtFFay6YZIO/vmBCAT6TwxhcRUdDX9jWD0KmnxP+d+QqqiU1+y/iI2K4UqS2HOOEtssujEHEN/4heqbOZH4cGtKO63mwvvDR2eN4kIR7dszqBUDKx1J7nYlR4YHSPwUJSMFAlcsmy/p356lMUvbXd8hN1vuGrgFMGOU959SQQRXWxcWMwxTb3DDOaOkZ5ZxR+LlYULqfYvaScoukyFa1AMj/EFY/4vzXh1TgdEmah4I5Cfp0b4iNpHWuJYXn1RqnUZaeGgfsJBfpIIn7R+xEBISLQrA4mZomXpAVzkfLFj68QPh7PnPMrdy6V6 bVS/3+AX N5g9qy88xLDmGUKmA2CEufBs/N9oqPcAt4mMZHF1Q/vH8bGikwhgh/tTUzpS7tTJ01vBr1KNMbicMbZj9H4RPRDgKuMpmnUep9QqdB5nBCJE4RHlGs0RHzI1ur1Lppsx0GgaqVXeKLfNk/m41YDUkqPUp+g== 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 free_raw_hwp_pages() to folio_free_raw_hwp(), converts two users of hugetlb specific page macro users to their folio equivalents. Signed-off-by: Sidhartha Kumar --- mm/memory-failure.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 205272c64f37..d5c828328e32 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1766,23 +1766,23 @@ static int hugetlb_set_page_hwpoison(struct page *hpage, struct page *page) return ret; } -static unsigned long free_raw_hwp_pages(struct page *hpage, bool move_flag) +static unsigned long folio_free_raw_hwp(struct folio *folio, bool move_flag) { /* - * HPageVmemmapOptimized hugepages can't be freed because struct + * hugetlb_vmemmap_optimized hugepages can't be freed because struct * pages for tail pages are required but they don't exist. */ - if (move_flag && HPageVmemmapOptimized(hpage)) + if (move_flag && folio_test_hugetlb_vmemmap_optimized(folio)) return 0; /* - * HPageRawHwpUnreliable hugepages shouldn't be unpoisoned by + * hugetlb_raw_hwp_unreliable hugepages shouldn't be unpoisoned by * definition. */ - if (HPageRawHwpUnreliable(hpage)) + if (folio_test_hugetlb_raw_hwp_unreliable(folio)) return 0; - return __free_raw_hwp_pages(hpage, move_flag); + return __free_raw_hwp_pages(&folio->page, move_flag); } void folio_clear_hugetlb_hwpoison(struct folio *folio) @@ -1790,7 +1790,7 @@ void folio_clear_hugetlb_hwpoison(struct folio *folio) if (folio_test_hugetlb_raw_hwp_unreliable(folio)) return; folio_clear_hwpoison(folio); - free_raw_hwp_pages(&folio->page, true); + folio_free_raw_hwp(folio, true); } /* @@ -1929,7 +1929,7 @@ static inline int try_memory_failure_hugetlb(unsigned long pfn, int flags, int * return 0; } -static inline unsigned long free_raw_hwp_pages(struct page *hpage, bool flag) +static inline unsigned long folio_free_raw_hwp(struct folio *folio, bool flag) { return 0; } @@ -2336,6 +2336,7 @@ core_initcall(memory_failure_init); int unpoison_memory(unsigned long pfn) { struct page *page; + struct folio *folio; struct page *p; int ret = -EBUSY; unsigned long count = 1; @@ -2348,6 +2349,7 @@ int unpoison_memory(unsigned long pfn) p = pfn_to_page(pfn); page = compound_head(p); + folio = page_folio(p); mutex_lock(&mf_mutex); @@ -2389,7 +2391,7 @@ int unpoison_memory(unsigned long pfn) if (!ret) { if (PageHuge(p)) { huge = true; - count = free_raw_hwp_pages(page, false); + count = folio_free_raw_hwp(folio, false); if (count == 0) { ret = -EBUSY; goto unlock_mutex; @@ -2405,7 +2407,7 @@ int unpoison_memory(unsigned long pfn) } else { if (PageHuge(p)) { huge = true; - count = free_raw_hwp_pages(page, false); + count = folio_free_raw_hwp(folio, false); if (count == 0) { ret = -EBUSY; put_page(page); From patchwork Thu Jan 12 20:46:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13099383 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 4A867C63797 for ; Thu, 12 Jan 2023 20:46:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07BDB8E0005; Thu, 12 Jan 2023 15:46:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 02A828E0001; Thu, 12 Jan 2023 15:46:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D22EE900006; Thu, 12 Jan 2023 15:46:50 -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 A8B498E0001 for ; Thu, 12 Jan 2023 15:46:50 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7A1B0140E51 for ; Thu, 12 Jan 2023 20:46:50 +0000 (UTC) X-FDA: 80347330980.12.A029030 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 4EA75C0017 for ; Thu, 12 Jan 2023 20:46:47 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Sgl6AfG8; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CuOHGogx; spf=pass (imf22.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=1673556407; 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=OJ2PP8aFeoNdhHtIahoaYvPgXtAM2nrK1T2oYw7fFJw=; b=RuqwPqerVS0hKbmA1uwmtdxv6yMXvzSaZsHqbYU9QzSWpoNDvcQfz97eFsSEKm6NTEjmIg MBLXazn/IdazfCITZTjLAOFNI2PsIDf7fxNYwT3/lXyd8eQOndtKkD73aXhvMyf3c8LlqY XDqRKb5jvVb0S85Fo3xtblQO3y2fMJA= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Sgl6AfG8; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CuOHGogx; spf=pass (imf22.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=1673556407; a=rsa-sha256; cv=pass; b=zfElENQK8trbgA1IwyoSv/vRwCcTjGSTbDQq7PLZtz7EoWWC+45JJFZuLlK8qWRuqF52Nr /8WeMwadAQ8LXYiC7PLU4WGniMljIC4tFyqOhOCzd45tVYib5rAvbA6x0Vce0qEgKZTtLI F7z0EOT102FWqlKD41bm+YrBPLSl2q8= 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 30CJubal006533; Thu, 12 Jan 2023 20: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=OJ2PP8aFeoNdhHtIahoaYvPgXtAM2nrK1T2oYw7fFJw=; b=Sgl6AfG8HA7iSeUmbQ0XRsM2rnNAHxjGxnWA+1Syc+O20w4n6i5OlLyfxrtgdKVbi6JH kQKGr62qqekLyUAeX+Ugt07WBWXKGVUooCwYADCmgQ+HKu7KUcSrfNvp/ZQAE/QZyAX2 DnAeVPUilwWxFVNTnUQC4Y8XbKu7suu56HdXTWylTExmqK69+y5In54bXqzvGnO3XgrD 6kVC1oWfD6IMjDeit2jGvCNDrIfgK+ISxRzWYp4WKCcZ2y50AY25bXZ+E9H38ei43wMY ucna+L1F9F5yHmbuya6KN5bu+Rt3mOJBYEhzJuIJlpQLAWwq9L1KREhj+0pI2p7FqRvO 6g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0btud1r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:32 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30CJU1dK034131; Thu, 12 Jan 2023 20:46:31 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2049.outbound.protection.outlook.com [104.47.51.49]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n1k4h0wm9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e9M1/1htuXG75q1dVJZ4mYGhkvwKYTE7930Db51mCJMWs6A7dPLv4gkWE8BrLgQ/8tvrGcSySm3rZnhwj5ILwdAvXst+3Gu9zI6k1OdY4MkdLyBRMoxWT24S058V9BlUhNV0k111xUWC0Hi3EnKxMIEMsKzLXG5TKY8FlDLlQlWhfAnu0PvBrTHUtYCxI/ziuzyoOF9t/ZS1kt0deHkmbK9uKBKJkU6VOHhTw2lwzGOkCKkw7cJNhu6kf9OUBcVWfWN1aKryKgWBg+gcD25IAQyB9xlX29YyhS1Gu/Z6JjN5dlkHaGay3A92FSVLLX8iOsgR/PelcFmuTwhAQuqSXQ== 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=OJ2PP8aFeoNdhHtIahoaYvPgXtAM2nrK1T2oYw7fFJw=; b=DtKgQp0u+20EltOgdb1VdqnKHhKzg9BXNbTmZEWEGN7mbDOyjZKhQWnB4z4edoNJxPhgR64Z8pN823+PzNC+6Fx5JvJDTjF2RPYez2g81O4nHdZyRNzDhxrl25h+iUyh4YYOQR7l1siFRE980T8R0wEu/golhuXoT+TeDd8VIgAfBO4YkDjNvsyJQosgeijS2UFwOE1UD0PUs3WodbwktJOZGI+3z95+eVlqEjZMRwfw+DMWOc8CGqSxaLhIV06EQ0zcf1sZi19dV7se3nN0oexYkCbJMv0n/FTsMVjErxwKDK+w4BT+F5N7IB3nF0EHg3xWjswMqLhM2gd3gAd9mw== 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=OJ2PP8aFeoNdhHtIahoaYvPgXtAM2nrK1T2oYw7fFJw=; b=CuOHGogxE49xyyKXz+tac9lh6zZr5gP1ZkIGRHFNx9FPgVV58xiXznMQt6CUOLWLySOdu4qo3/4G+Cmde23Sp/CaIMDRvH6hkR755z4ua/7u+BrwX5VT9/ZvNc8Jc0r6k0bLHlXtnyKZMVcfV4hMJYLN7HvkdsWxi/u1gh5N1OM= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CY8PR10MB6804.namprd10.prod.outlook.com (2603:10b6:930:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Thu, 12 Jan 2023 20:46:29 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6002.011; Thu, 12 Jan 2023 20:46:29 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH mm-unstable 5/8] mm/memory-failure: convert raw_hwp_list_head() to folios Date: Thu, 12 Jan 2023 14:46:05 -0600 Message-Id: <20230112204608.80136-6-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112204608.80136-1-sidhartha.kumar@oracle.com> References: <20230112204608.80136-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR03CA0213.namprd03.prod.outlook.com (2603:10b6:a03:39f::8) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|CY8PR10MB6804:EE_ X-MS-Office365-Filtering-Correlation-Id: 898f0049-b0b3-4eab-6f0e-08daf4de146f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N2rnS3myjW30mxQNiY80iNHOt5tgpeoH5XUkHU3CHbtcMzkZWy4HZcaKfAXLzCYmkTr/WW3bFGkLs2kANZ1OxgJhujRzr8UeGlV1kpxow6Irz9jQbTEdg+kAIsM2GjQQAYf6PCNB1jEOyCg5C03QbLRk2xVQubCcFbl/jPifx3GHJnLROndjtYuHcF7WMqyGeZuVmYV9NBh+fhcfdyoJSb6DPza2xbV8osMj8YtSCLk+6IVYUgCv5+fxKd6Y6RTPf/OiZTP2y44DbHkUsELfs7j1B/R9geE/+hTD1OpKCimg3IDd+KI9rW1VcocWk7+hsrw0afYdnf9e5TndDVzoZSOXS2SZuC9ShtSpJo2vABMUDpa52pEj2XR6t+zKTNJOVM18SnYdyOw0OB4LHyO1NjHxFmXMeOwRmu5qnVgFIp+d8McpxPed9FJ57fSlCmKeE2vhUaNprd6J4J4NvBLLmpNMWvDfAwoblfpmxAnHrc2w0xIeHXEnis3wj7kC2faMz/byIP6UnHIG3ypkGBwf3mNYgrKMMgWrSaFXX45qspCMnrwYL1KMEJclqaHOzgkTh0Sgf9Jb8fKW+OD+npsbFaVqcfZb7asNV0HYKRjKQ9JF/CQeV+88L5CuDgilOKeZIkAr9W0hhIIdvVB+zThwtg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199015)(44832011)(186003)(2616005)(6512007)(478600001)(316002)(5660300002)(107886003)(6486002)(1076003)(66946007)(8676002)(66476007)(66556008)(4326008)(83380400001)(8936002)(86362001)(41300700001)(36756003)(38100700002)(6666004)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OfJjdrmpAvmhjbPjZayIajE69Z1PPHWKSfCwdc0A7vSbm2ruPkepcWv0X0hNQr/BetnNpjM0ZpxAjbHeZ14kM+cjq3Nmp+b5iVzZnotbDkxAEwcgO67LT102wT+dYGRYeIHdR2M3P5bmSlDIXHq68+bVypuZalhWrMcyuBWqOKOiR14b2wJwt73LAiLevNW43Fv25JYN9LBq5UPhTH93VAu8daQZhD/kHbFGcKvNwk+KJ5WrmiP/35Wk7STYnw2OtxLhn/yaQEoWDcttEStLOmlZRY1lnFwjHYwSvD5xWw5dU0ikkpoD4ot7yUZi2NWaUpKqcQpI0aTBits1RpW9b8Uw7ngEDJsGN13dqnkNY/CZ054DbKo/RPUYIij8x75E6ZIiNIoNX+0SxGnyHzzAl3CTgObHFrdrpT+1Jqp8jFgnrHFhjfeREsTQIzbbEfM+Z7hjGKXt7rnNkkqbRGrsn5Kb8uH9FLI3g45rsiV6hxXYmt/5jA7IKCOgnJrLqriZoOEX+qwau16eWZqLrHrLohUwsRkhpSuGk2iKHZhzo8yAb9DdxVr7sQUAORpLsteyWRg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-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: LJB1JvWwJCDRUhgwvb5A/+bqghDW1cYc1ZIPVFwOBvIV/SNKH1DWM4Bbw7YxY5xVlvvUeocMs4YA7qspwFNznl/XSXUQsu8mGpZBEINmK4g2ol8d3tSdgZUJoiVo4z+nfEeBJUzo+xc4KfMM8ZX6142P3gy+JGomWTdUYM4NyQ1L/AaEzTD7yBt6hzr9dhjrBbbSpqqigKriB8SDgWkugExT4bXPxYROjM7mbOYfaN2vYceZoEk8+YRxdOFLQyAOLm1AkgaEzqLDOyyi4czgfphmiuKy7H22SXIVmD8k4232PMIFahtBQKPeb7WcK0bYhlF7ke5v9xd8A24uNdzYjnHYdzau3X+oiCc7oWFpaUkoP1HwIwxaIk7sHqk4piAhYiuxmIoKYwEqDHB8STxUNm3Y2kF0skc/luOoo59oHy37xIxS3DpiXH8P5ThDJjry3tXyLTmNn/IJcTG2QIbN4XgLM0YmygA9T3zHz6tZkUAK5M0hHw/XxCMu9qVWufvD3a5Xt4pML+vDu5fCuG2wdYBCV5g2/4GNd8k8nLpLqEd6nLo1HMWDqBLm90toaBIDEadCKJhHJd9C4NOlwug3wvJ5OPHYU+E1CmSdtnn7PmeXn0+eUpE02qTFJCdPg6b53TYsh3akREs7cb35cDZsBM//cBEPyrMaJlxv15dSDbiuf34DJQm7LKPweLXbP82Jw2zhhUY2FVY1WkKiWatvLcgjueEn/XzE8ukacmWzZMqJrp9zH0q2OcVpR0icXFamfslS0hf7b0WkfWSVeU+kTjuUsiV4y2GFEESjIJb/vSAE/fm+BnGFuZ4TXNoymOTP/qYei36aSttnMkVAYr/fC94GkeblygfWhX8CiECELgAkQ5yc5gsMQgTlRJ5TMEXfabeGni0DqxBhqX6drlxL/ztNjcAZjUwj7kbluQieOwKQMZhWfpPTzLK9LCIPvsdg X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 898f0049-b0b3-4eab-6f0e-08daf4de146f X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 20:46:29.0673 (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: FnXi2Rlve3u9AR9BqtijHPbXW4qluqwCq19z9i4b+REJ/reLOyLXqQquIcPtGc0zQR7F0HJ0P/F8Ej5vPppjRwRfBZOHvGzgfVLQSxrbtPo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6804 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_12,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120148 X-Proofpoint-GUID: uPtoAD8HccRmitgp591mVbG_8w6vW4wc X-Proofpoint-ORIG-GUID: uPtoAD8HccRmitgp591mVbG_8w6vW4wc X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4EA75C0017 X-Stat-Signature: hbbmf8rgt4tniw1xkfy8hfbqac6y8wkd X-HE-Tag: 1673556407-195470 X-HE-Meta: U2FsdGVkX18A0/W06XaPBbYvR3EDSrc1ynXG6P1eHJyDhKZ74mZ1k85gHfZx+YzVN+VZJvFowMKvSwM5oSgw2rz/0mRxKIcsbtx5F2SOGqnnZB4j+oYw6LPAH+53w+epIHkDrywLhqEL8S2KKQxrrRFTnAdJ40OWL/6nCBwrVovuLzYVY0dalLX+t5yhPDCI9pwlQNv+Ou4qpl5ulNWLa+NBVoUd98Nk1mrhIrJWXq916rgjioyjwfWcUF/ysYtFb2spM4AXleFSPnBQ5tL3fuzLe8QPtqPLjih0R6homW/JWiA0v9vT+sSZPWvHvcWkfrIv6rNOlt6Y4+1rzX0Wqybnh9fYwy1U0uMeR6yYdzZHCZeQTVmejNq1aMNXx40LPOqueUJUwAl80XnV5xCN2IsIbetlDGd16RyLNdF+UdPVjzxKosJCTj6ENsN+1ndChB09SFEdmGLeMp1lQeoNacuRiikTsVFrZ3/pl8h9JNpDZSw918QeodYIOrU3RNxmF/Otvo7CIvaliKAnk/qT6sD7PPcxYA1QWrJNpdzzc3mi0XkOybAuJDBzhFHcCbtEe0Mz/DOST9A/ozzsJWWhz+RgjwToxSW+LfBAIJLClLJ5oKMxLJA5QWV7Ozou1OfVHSLZkOYFeMW/iiZyOYt+qMNAJqX9MI1figOOmfzANKNmPEJeGzU4ysBd0s49icTnGi3W3MxibmWznkY11sad20KypuRQV/zkr4vTweU9yhY4VB644bZ/L8KHzKezunehXRFK0xpzYzFKrj8Hhw8EuGkTWpBgT5n3M2EVfLv7cchpRS40Iu+NIF/X5vPV7kzYdcHABsKJGbjozhCNoc6wBVtc51cWMk671ms8Vz5wTyRx2Rif6D5qxfrVQkaUNde+IUlXi+cHGkRbnrDUnbtqhlb9Sk8VZ8JLABiYxz4BJ5AkpAKo4VLU20btlz0pn+/Yu8N3YOrH0yapxk4eE92 pPcepViT P3G/THyOZcrOQUFOOQPlMwyVt+PhQF69FAklaZvUV6WXE+cL4h51218ZTZ6itGCPlNQ09o3WW42tCbz76wWIfpVCUi18xyl/OvKf3klJcvsea3vZPZT0zmQYQU5rmhvSK6Dyo0/2pJxw64IyuPgIhbWAf+A== 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 raw_hwp_list_head() to take in a folio and modify its callers to pass in a folio. Also converts two users of hugetlb specific page macro users to their folio equivalents. Signed-off-by: Sidhartha Kumar --- mm/memory-failure.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index d5c828328e32..55f34be8ea39 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1695,9 +1695,9 @@ struct raw_hwp_page { struct page *page; }; -static inline struct llist_head *raw_hwp_list_head(struct page *hpage) +static inline struct llist_head *raw_hwp_list_head(struct folio *folio) { - return (struct llist_head *)&page_folio(hpage)->_hugetlb_hwpoison; + return (struct llist_head *)&folio->_hugetlb_hwpoison; } static unsigned long __free_raw_hwp_pages(struct page *hpage, bool move_flag) @@ -1705,8 +1705,9 @@ static unsigned long __free_raw_hwp_pages(struct page *hpage, bool move_flag) struct llist_head *head; struct llist_node *t, *tnode; unsigned long count = 0; + struct folio *folio = page_folio(hpage); - head = raw_hwp_list_head(hpage); + head = raw_hwp_list_head(folio); llist_for_each_safe(tnode, t, head->first) { struct raw_hwp_page *p = container_of(tnode, struct raw_hwp_page, node); @@ -1727,15 +1728,16 @@ static int hugetlb_set_page_hwpoison(struct page *hpage, struct page *page) struct raw_hwp_page *raw_hwp; struct llist_node *t, *tnode; int ret = TestSetPageHWPoison(hpage) ? -EHWPOISON : 0; + struct folio *folio = page_folio(hpage); /* * Once the hwpoison hugepage has lost reliable raw error info, * there is little meaning to keep additional error info precisely, * so skip to add additional raw error info. */ - if (HPageRawHwpUnreliable(hpage)) + if (folio_test_hugetlb_raw_hwp_unreliable(folio)) return -EHWPOISON; - head = raw_hwp_list_head(hpage); + head = raw_hwp_list_head(folio); llist_for_each_safe(tnode, t, head->first) { struct raw_hwp_page *p = container_of(tnode, struct raw_hwp_page, node); @@ -1756,9 +1758,9 @@ static int hugetlb_set_page_hwpoison(struct page *hpage, struct page *page) * hwpoisoned subpages, and we need refuse to free/dissolve * this hwpoisoned hugepage. */ - SetHPageRawHwpUnreliable(hpage); + folio_set_hugetlb_raw_hwp_unreliable(folio); /* - * Once HPageRawHwpUnreliable is set, raw_hwp_page is not + * Once hugetlb_raw_hwp_unreliable is set, raw_hwp_page is not * used any more, so free it. */ __free_raw_hwp_pages(hpage, false); From patchwork Thu Jan 12 20:46:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13099384 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 B7E06C54EBE for ; Thu, 12 Jan 2023 20:46:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50E2F900006; Thu, 12 Jan 2023 15:46:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BE8F900005; Thu, 12 Jan 2023 15:46:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29C30900006; Thu, 12 Jan 2023 15:46:54 -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 19F9E900005 for ; Thu, 12 Jan 2023 15:46:54 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DF49E80D56 for ; Thu, 12 Jan 2023 20:46:53 +0000 (UTC) X-FDA: 80347331106.06.995FB85 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf10.hostedemail.com (Postfix) with ESMTP id 254D7C0016 for ; Thu, 12 Jan 2023 20:46:49 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Y1zHq+uM; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Dm6copwe; spf=pass (imf10.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; 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=1673556410; a=rsa-sha256; cv=pass; b=TncPKS0qNMxFhBb3+BdPPIs7KR3w19Ee2OpCumyJdZRI7zv3AVYCm9NH1wGmBOVBbfzoSd 1+L+LhWxZ0taN3nnbVYv8JDeIkyN3goW9T1d0qWzeUMEjqMREA4iyEHdWqbCQ4iaHiIIaA 1JePb5oUQsJsD8kwwwBcFB1iqm+avHo= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Y1zHq+uM; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Dm6copwe; spf=pass (imf10.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; 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=1673556410; 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=q6+oCQXcVUPDMQ62zkDTZuFqVr20l7Tj/4Q5KsZwSwk=; b=HZ+dyJ9Xf7l3n1vhuBnA/RFz9G8ecoISjJzSUTZdB3ZFArNhl+rg3sEu61vXHkuMFMFxIt ZSK0KAqubXAgwpEjL348hwRuocYVz8bobtA0Sf7Ov/4CPo/+oKYKUrcgqs6ya/rYwpjlfE KNm/CAIVTrDI8PU1UpJFF/VBMFlsGFg= 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 30CJXo8x023270; Thu, 12 Jan 2023 20:46:35 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=q6+oCQXcVUPDMQ62zkDTZuFqVr20l7Tj/4Q5KsZwSwk=; b=Y1zHq+uMzDhfopxf7+yL6207d6diEYPBdaLBYrCTTDTRmPPPRzRMWfiM4VdY5f64wEcF kyzs2Y08U74L1+9WYzWRe336ZZP83p0M1W9UEh0X47+c54vw4vLZ3GsTLfm9kNx6Gcb2 nvChW5jkKBWFhK0PDV1h0mSGFIy1qO6TTI6RCIlJrREGxPzTFOV5qvihuOeNMZv2MLZK 4s5Md+6OLdrfy0U5bFc2FHYFz3l1pz1DGdWIcxZ3qr2So/rYKcHPibWm1EBby7r6evVp sACdHGa6xAfUwbQ2UOdM1+8Rp+mqjJl67/vwpksC9G0oMDtqku/FgMnsMLFyzhQIH1CF yg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n1y1nkhcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:35 +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 30CJ4rb4022034; Thu, 12 Jan 2023 20:46:34 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2049.outbound.protection.outlook.com [104.47.51.49]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n1k4qt2n4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GUxHhb6akqq74MTDpQzhoe368W1uU/IJaXDTQ6WKDoVAkdmh896yXz4WzvxL5MltxiIL5fEvqCV7ZNzFwLAp7VuJOxgzAHPvjG6RCqXhfvk8WkuqfZbICrlFtvcYwPmcFEba+rdIVhqTavUsHLoreSD/KuQtPtqkp/9BVRZ/vSXfTgIv9Fq/8Os+cDZKLh+h/QzunyFKGapW12gZFC+M6Dr4VqbXApHqEz5B0m0I3X3WKwFGmez1OopXYrzLk1ENe2EaJIacuIFSpQ/t4B+ikR2xgkVJpoG9UyGbMWILBuLfMnbeCOkzkIfuJPJzzgROykvpBjvxheG4B9r8KrdLcw== 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=q6+oCQXcVUPDMQ62zkDTZuFqVr20l7Tj/4Q5KsZwSwk=; b=KYiPKIOkni+vEBREpEeVTQs9E2tku8cywpdZoPTvMEDuhqsn0BRCZzu+aEc/k4c1q69N9O0t3uirZ02GClsBHuUDvHUHVNVfZG7HHsv5kzszjPphKzN4TNa3X8+V/oRZxMqLx1XxUQkY+Eh8NlgLZoJdA4lzOk02qjEAl174URZXzz4zZR/HGcNYINtsebZMzBdthBXtFqLwD8grliKxHy+edgM98GCGdHl38B/4jSK7X4r2WpimMH+J7/9P6OMqQmuWzvl27Rxgug7E9WhZAllvHBi28BSYAFHHcdy7Uyvk5rvZlLbYZ7te+GMzwONtN19sdNjKQg5T6ydc0fCIiA== 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=q6+oCQXcVUPDMQ62zkDTZuFqVr20l7Tj/4Q5KsZwSwk=; b=Dm6copwerYamrL61LSHhJ46VDovsbKDcJfDZAGKSDzrYsNonOZOgG+4hqlTcCehJqvIlN8BPtu6LZiCUqbM0ylIxnQA3QgAdKdtSPrbSo/IE5LIwSLR7+sTAkAK2zY61fpE13kspdWUfYmv1MktyxJXe25lAFKw9Rwghx/UPPhY= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CY8PR10MB6804.namprd10.prod.outlook.com (2603:10b6:930:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Thu, 12 Jan 2023 20:46:32 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6002.011; Thu, 12 Jan 2023 20:46:32 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH mm-unstable 6/8] mm/memory-failure: convert __free_raw_hwp_pages() to folios Date: Thu, 12 Jan 2023 14:46:06 -0600 Message-Id: <20230112204608.80136-7-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112204608.80136-1-sidhartha.kumar@oracle.com> References: <20230112204608.80136-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR07CA0077.namprd07.prod.outlook.com (2603:10b6:a03:12b::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_|CY8PR10MB6804:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bf4051b-b883-4b58-0a07-08daf4de16a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nMgCNDPHnMQS3NQqymiOGYSmTYk9tjI1NxlfvBAgaL+54HOArZJZbZS/SV2AYlPmmDko8bFxEprNbJzyKQ5cE21eJTVuHDr6+MkTJ3xY2resHP5aCrCuDS5qKTgdCmlM7cNboy5/MB1F6LCYNASz2dibNDXpqxWDAzsrxvXW7DwF7rex5z+Yw0jck8EMBvdkcagDG0hZNUvowdkKY06WeksCv4GHrWb0RLM6GN5HFCkt8UyqjpEYQ/QZ54AGJnQhxMBiK4UuOV/SJMBhsznZiZXmDLe5vCIPW2EA/uawe0G0c6gTipsuAH+/k5QlDhnueW9UtFziX2dLl3plTq9Hwtp0CFZX50AB3apLWgNmvVX1cBHh6upJT5skht0ssG5hcI01/Op09Qc5kG4gsdO7PjcdINnaq+5vY+5K9lCco115EVoZLZJZJuQ8pw8UxE0s1lb9Pa0NsRJf0cYU0ASuhswsGPC7fe32eC/pVAfbHssacdJHEQzwX/Fya4Oexe+u/WlvwEwxWDyfyqfoXJt2f7HyPf314vi5DOL4zowa6wLGK7cVPcKD8+88wZuHgMeXLaDkxQwNf3IWcXEB0TMbq3N6j95YNZmA1SLDM/sN+uuAStpb4qoIIOtfJUvyZCBR+Ot/Y0fwohiXnx4B0UPArA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199015)(44832011)(186003)(2616005)(6512007)(478600001)(316002)(5660300002)(107886003)(6486002)(1076003)(66946007)(8676002)(66476007)(66556008)(4326008)(83380400001)(8936002)(86362001)(41300700001)(36756003)(38100700002)(6666004)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JJOQ+8T+O2idkqrXSrP7XN+2CeWebXJjSpyK3UL4n/gdqVF2DZnGYb8OYtLMKzUzAIf8cRpb35n5BQ68fdk2utbbnbwF5qTfqv3+XKPf6wrohexl1306OjUobDTCzQLG9o6KcrMLbaM42g1OMFXlUJ1LjKwefDEKgTBR+cgzTOE5XN3NNHBPp4a45J/j3PznG/ndaLgBoGcIgbGJ/Tn/4MNlwwmiKPs6Zm/Cot4+q1t6NWjnw+VCTeRb+n4mU25uZJTKUg/0ZZD3MrqKABY1FA5GcvaU/wcHLacnapkfexCENYcSv5vLVGFLKke5IBMhp0ffL24TtA0MLYYDbV6BqBikDcbWQE0HAodIv7Q2sbsODu1i7EBnYm2e7GcxYdvFqHF8zXk3TmvxfH3oKhqVcRVCObDRfjBIvmZH2WeJsIhP+JEyugNBNE0ZIG9dDV9h9VLflQbzn9LFJBn6FDx5PETrn0OnJukB/30j22UDD0fetmkYHBLyyihxEOegFCLiFasZNR18gUFh8Scs6uazFvK2z0vxOcTH4ouLqdrVPC1DOzwIkf96ZovGZGXEMJVCbQlb4Igcupyzz11yb9TWJrNW0OA+kPjaSecZLUMTXVjVLreu2kohaGWUoYAIR870Yg/B4Iuc3k4kiArP3bm+hcIehqpebAp3SOp3gYXqbMW1AInYsNaVecboXARnwTI/QAW1SWzFsnbp6oXN0Y0Wc2HfVINiFlMD5eSDaYYgvXSqpKACxoj7yVOzj2GR5I9B1HIrpu7vMhi5eucwpO9hNBQbDqH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o0n8vh2OWEjwZVdwFgxLnKVHgmju05GTF69bWqiMyEK8VGU2RLAfLpUvZ3qd+bq0m0+36mMHmBP6q9gkMcjUL4dKct9cYH0rZu/alxHiJRjls81fShXRJeC9D+tvVRdEX/f6+ZPMjN/HWwlt/vYylTT90tyUW6zHLrMkkiFd9lkG6Y50oBoNdrfQzBJYEBKuyupRgrp/PCpp2IKtT7KsW5rS8syozMft2fsvfl3IsFXEKUr3RNj9a/eh3XQH2EFVxi1nbHs9otVK2LH8wwxkk1QX8P/MZq4TkS8eYNwurrNRQAbnxSupJPI2YPxiFmWfMjY89t9qtQ32/9FNmCZQ0iajzaHGvmEg1oBR2CKPT74OIbe0dZG5YJ9xubZZIWvgBdFcH8y2ClLKkI5DYun6F0B8KwczRNbk6/+biStsCuq9zioIsak6Okg/D/TWyGmwCnSIADw41oAVGTbC2WwkyxzcJ+We51XDlw389teSjRhTf+LYXikB7LlHpDKRsBo7LCyEGkPqUjos8PgxVnIdLJ+cJY4sWhSpJD4OW1p9TcKTNmwO41DmZ31SzEzOsKEN3bQXwWKQklDXY83epv39AfOPcKq8O2cFdFqEmnVnZJjRXliyGxUXeLbumX4b78uo1lcnoJUOeMrhP4wtUJLkVU902x0ZEAqy20eKAd9NyHQBqiTcr91jAQUAq3czErp1jO8p169wfLtyNoshtW3XXnD8g+L0qxvjyLvkadOsx/OPF0tdF9Ebi7b9D98j4qfk4VTBWS0b7Ng/VPX/6te7NNgbvorJWgp4sy4C X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bf4051b-b883-4b58-0a07-08daf4de16a0 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 20:46:32.8405 (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: 0vv4Q1Lbc5oakonAx79EWET5qpDN5rYeUd0wgEPm6HGfSo9ZEakn96LxHmATzdctrCZdwlfsjYlAYf3sx2rvbKLFqm5pN97c8IDI49yIs8s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6804 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_12,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120148 X-Proofpoint-GUID: hxfp-HrmliNkQGrR2AD7XvJStp0CMwlm X-Proofpoint-ORIG-GUID: hxfp-HrmliNkQGrR2AD7XvJStp0CMwlm X-Rspam-User: X-Rspamd-Queue-Id: 254D7C0016 X-Rspamd-Server: rspam01 X-Stat-Signature: k1gcqdtkyn6zwrojygfwrggtet3diksj X-HE-Tag: 1673556409-783581 X-HE-Meta: U2FsdGVkX1+fspf6OG6L9OEWBj0PM6zobHcN63azmZkhLNUx3K/vT7pxBI6GJvsicHIM1noTxsQ+1GHT9vTajnHqBHst8FYCY8fB/A+Szt7/hYObS22DtIAjz2DMbdeIBeBjKBfwNWl88PNxUj37qEA2QTwFCmxZZjRS+TnORuvzqYAGIkUxp1t84KE+gAjnueXtzQ1gRgi853CmZCnj8xwBwrcg0Qo0+tQigbX1387jVLORTLtvIZWDMMJeFYajz2Kzg72OQNHqPh10qT6+EWMLJD3msNMaGgxhVwcgNkmvYaYvUsKyWmlTeqt6pQMloMBbLNFbb6WxAZjt5BpqxXb2irENSf2e3pdSYlCjwIOnYaNjGHHilVUU/aRzATol7mVWLiQk1WjCcchDf/7VxfqVxgDR9v4sOpMFigtE2knQB3J6CU1LjPuil4rB/B2qDGDgI8J9ZoZj9t6XOf3Ho9tLwI3jYnlAJ+iaDCCk1siYsLk5tlNjTbQO7Cc1M7NScGSCtFICqtGnjFqvnHWf0pNXkD2mkyla79EDSfm6vN0K3P/7Q8Pwn3Jqpm++LwJbC7EINDWwoNzTAkcPrWzlFn5iMpP6bDf/2VleNvktTHIulRAjrmPdze/KmLpkrgH47FC33Cc8h+EawVHiG98rkFAGEgC8Q4PrJmRzfdKDAday5yijZGBNOEIMCG58Q0Xb14nOGqb72Xa9XsIoWRP2uvx0bIn8jvhmxuCyfOQiYLsTmXbiWvbylmty7mbWprMZZpIDWN2t4TO7tSmLz5RV6jPCMFrd5HfBkGe2Z4NLpFYKxjgLXjG/HYx7rATGPN/qYSlpke2mGUhcfDzMq2Jl4aXsqI6OmnroBVbT8JX2mO+ArYTbpwvTEKhc0teBeZg7rLDSt33WK+E2SP4NBvzPvDudR8Q1lrLunjGmqeMhMNRWMgv4Qc6TdDWDpNDkY/LQ3ZuUxvz59eY0Ax21r58 LdzVpyBn NRmoVTvH0Li4zH5t3esgQ9CF+FzIroBrkTZ3Vln+aN04ILksbRRYDoAhXHTXCnWZEU0K9UNuQaa1W5DTnAGPPJS+dNY5NmMk84zC6SBAkvwcsjExpLaAVkRMZwOvku4HB965nsm6dhVNfjenu3R1fdtLppQ== 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 __free_raw_hwp_pages() to __folio_free_raw_hwp() and modify its callers to pass in a folio. Signed-off-by: Sidhartha Kumar --- mm/memory-failure.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 55f34be8ea39..3fff073da89b 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1700,12 +1700,11 @@ static inline struct llist_head *raw_hwp_list_head(struct folio *folio) return (struct llist_head *)&folio->_hugetlb_hwpoison; } -static unsigned long __free_raw_hwp_pages(struct page *hpage, bool move_flag) +static unsigned long __folio_free_raw_hwp(struct folio *folio, bool move_flag) { struct llist_head *head; struct llist_node *t, *tnode; unsigned long count = 0; - struct folio *folio = page_folio(hpage); head = raw_hwp_list_head(folio); llist_for_each_safe(tnode, t, head->first) { @@ -1763,7 +1762,7 @@ static int hugetlb_set_page_hwpoison(struct page *hpage, struct page *page) * Once hugetlb_raw_hwp_unreliable is set, raw_hwp_page is not * used any more, so free it. */ - __free_raw_hwp_pages(hpage, false); + __folio_free_raw_hwp(folio, false); } return ret; } @@ -1784,7 +1783,7 @@ static unsigned long folio_free_raw_hwp(struct folio *folio, bool move_flag) if (folio_test_hugetlb_raw_hwp_unreliable(folio)) return 0; - return __free_raw_hwp_pages(&folio->page, move_flag); + return __folio_free_raw_hwp(folio, move_flag); } void folio_clear_hugetlb_hwpoison(struct folio *folio) From patchwork Thu Jan 12 20:46:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13099382 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 2CC61C54EBE for ; Thu, 12 Jan 2023 20:46:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B76BF900004; Thu, 12 Jan 2023 15:46:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B2711900005; Thu, 12 Jan 2023 15:46:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97895900004; Thu, 12 Jan 2023 15:46:50 -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 853198E0001 for ; Thu, 12 Jan 2023 15:46:50 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 63B0F1C5BEE for ; Thu, 12 Jan 2023 20:46:50 +0000 (UTC) X-FDA: 80347330980.11.6B40AC1 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 206B740006 for ; Thu, 12 Jan 2023 20:46:46 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=vrBS0oso; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lckCxwbR; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf01.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=1673556407; 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=Ll8zazKlpDCzUiZ/avQ+j45Xsf0kzAv847jvl6gqI3w=; b=WZjUHR1y6Bw31wlzVIvl6oXd6+LIcq/Fwt/VnEO8/ReTFIw61zXUgvJgoP7AAnEl+Gz667 NL7mxrBm7zmIAm0tviq7GnuAi1X2AOfdGi++yuhvP5F5+QWMkQ9BzQcKtPuMhcvoIuligF eQtDxdMUELELL4mCXzZrSNs4lmtsw1E= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=vrBS0oso; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lckCxwbR; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf01.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=1673556407; a=rsa-sha256; cv=pass; b=mA/LD2vMDHyI1zg3IkINflR/v3SQbtyLVDqjc781IjiqcQ9IfKbu9lZfcV3Pt4gCTvcZaF v6WHGc2o1swNBL3fSJQyOICLQgyA1d+sGZWRcfUKwkBmtKXa8P7siI3mAk+fdujiykOvBE C9tYx2jVfr0gPEUap5tTgM33xT7YlcA= 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 30CK4qTW018485; Thu, 12 Jan 2023 20:46:37 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=Ll8zazKlpDCzUiZ/avQ+j45Xsf0kzAv847jvl6gqI3w=; b=vrBS0oso/Q0T0Krtcl1QY1FPCdewyJ3TlkjPan7BeJ96/LCpe8yzt/ERalNQ2ttxrzt4 +ut+Lf4cAC+aD5cMi0OB7SihC5wghNZNBJUeSvaUrtKplbWel0bkcJBxPvGvi+nNYaRM wT6xTGZPecFAFgAiPUrnzi/h3vVOWzs/OVLjzEpZMzhVmGQxiz5YDv9OqtVvutqZ0N8I x4QpjkGyQScipPjQT8xG8n/Br9RkKV0Coq+ecqAQZ31jOFo0sS16C6alU2XYN1klYCrW pRa+VXWnEclulprU3j7OuMViLyOWTjlnMfIVn2mxG56qfEZ8HTbC4zGhA2pDN0ha2Rps 0Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n2qxy88br-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:37 +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 30CKGEL4007540; Thu, 12 Jan 2023 20:46:36 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n1k4cryxk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N5JZiobYgZTMw00vgK1gwirJ2tvHRAHAM+rVA5eLNoM5rAxQ5iFzCdTy9B4fTFKoQ/nXDnjJ9US3dh+JNDUMSeBsc736pgu2YtKN+ABmHvaSPBp8u3B+wxwrA/XGhlM5iJbFu3r/jn+CGzOqDyI4750xXXDKaplz+J2ppm4N67G8UVp/phqXCvHSf5k8CU5bS+7I2VZXQN0yrqRioSU9Mb1QrK4vuV8TktOtKLXaND9WQAtaFqBu8/YsVOw1tvUpD2P56xXrN6FBxjTYzCVfBc4429UopTE3POJL1EPQZf7EfbS6+dwWRGM2UzgIN9BFH7JEwQL1k8dph3R2iPWYtQ== 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=Ll8zazKlpDCzUiZ/avQ+j45Xsf0kzAv847jvl6gqI3w=; b=hhSGVfbS/f0BkDY6YLNyldu1o012r8i9NmbIQdzAAwDxpC0H3ImTIxebAS3hQjoeSKi/phy3X7ecLCeCQz3HwVrREHZgmc4J5AWeb6w7wR+42RQIxLe3AtrVGzxLPcWtSw4I9bjMKW5E9Y5o5ktJdyv09k4eGGFVhM6VI7N+fM4kASDpTM23IPndpsnOWgH/W/Axt6z6cXz2tpKiTeP2mtN36rPIhdp3dLb79QumKwZ+IsBtAqWMb25zbmPMYSG9u0RJIgdeZTQ/idNBJdP4cRYbpYffiqIXYYxAnI0/f6N2s/2NazEZwbQNwut/r2wsB0R0Fatrw8j701fIAneB/Q== 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=Ll8zazKlpDCzUiZ/avQ+j45Xsf0kzAv847jvl6gqI3w=; b=lckCxwbRzxRsGALeLw8w67gWq6O6FEvnyNdgWMq0EkdlZF+g6DRQayMY0Bs88zPlNgx/HSXmXmOnKKPylKnqXsMUahVVph+O7niUPkwMqwJSSCh0FTm1fHgH4JG0OIk9KE5OjR9IFE09OyxD6TVSrRO12I2Htwvrh9NYpzyIBNE= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CY8PR10MB6804.namprd10.prod.outlook.com (2603:10b6:930:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Thu, 12 Jan 2023 20:46:35 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6002.011; Thu, 12 Jan 2023 20:46:35 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH mm-unstable 7/8] mm/memory-failure: convert hugetlb_set_page_hwpoison() to folios Date: Thu, 12 Jan 2023 14:46:07 -0600 Message-Id: <20230112204608.80136-8-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112204608.80136-1-sidhartha.kumar@oracle.com> References: <20230112204608.80136-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: DM6PR02CA0045.namprd02.prod.outlook.com (2603:10b6:5:177::22) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|CY8PR10MB6804:EE_ X-MS-Office365-Filtering-Correlation-Id: 108c10f7-225a-47c3-b834-08daf4de17ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ztXmkiORlJP9zEBg8iCbmzt8kS1i8bZBN60vQeAv0Nh/uij3DoAsDbgFa1YXJ1FNzM16KY9on1wCuSEOL6w/eEf4nqvWtXFvvyWh9b/XFcApFJbGHZd5u0KY6gowyxfvXOSA308/iUmiIRNMm+/glhTmswmj00qQfx6dmURRxNJcfbY7Mrj0U/WOVstI8FPZ7CDGhNUcA9PmVh8rnOg6PSmRelMegx5UYpbdQRxJ3A7DgPILhttdvY8egKVpkS/nAZJnLv0+jsTrFouqGoiqbvxMK45nJNtLCj8649fWj75rvRiqfWhZAZGcrt1WcwOn9LAztjb79higtjCR9Pz0ed6dFCnSLSVKAOwEMUGkqN/237GEZQqxwpH2RvVULtQm4/H2lywHSAD0s4Pcbhw35TeuHyleKhpX5jvmCBx0Hccz1Ub/plDprHQGy7slRO8P3rLgBHKRYSp6Gc5zP2YIrLQPCoRtL0IoZLNjVGt15RzsaHAaFp61WtPqBL7skW1zWvaAEZBC8Jgdt78phKj6m+4stcPWA/RIVS7YpaIbRSuRKc9zBH7lShbt/8limW2oOotJN5o84QxKpblkSxGFiVqOIDYcP/4aFh/wfYiJN52DTYazRvoM/9w0O+2TJ5ZcnhmM3GUUk0T+9edEOscewQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199015)(44832011)(186003)(2616005)(6512007)(478600001)(316002)(5660300002)(107886003)(6486002)(1076003)(66946007)(8676002)(66476007)(66556008)(4326008)(83380400001)(8936002)(86362001)(41300700001)(36756003)(38100700002)(6666004)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SI3DttZOqUe+lWKQeCyc/jBlsw+qtdL2wWg6+PoZ0KMqd3ApDrbAWBAieYD3y5dSnQI5h+fx6Wqt8FwYJq3MYG6d5m9gCKsZYl1pmTICiCpNi3oGcYrzgYsYgBuwc9bcDQsOKkjoxfsaRhnVtSAo/obYHUvL+gJma02haFLms48yg1VX6tqikVZ4K7FOA0JCTf0XQ3uWM4z38XPAclfUhobwML1P5l5fuUlie19xBzNnxC/HrwKd3du/27ccoeFD0IVDbm5CeTWb98jlkf74OjpKmayR8nw1NI0H9w2qnS/CMyNY9RUUTTmSqMU0TMp9Woid7Oo/dcrWwzpW7NvGBVgoaLjxj5iJe/uoC4QjvTRtBrfRLJz9z0TSbed6QFpi6VsLu8Kd/QpmiNCS4JGO8QSPJq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3NYiL0CdZWa1H4DuAyqtELqn+Je95WYBGyXjmjfl4VM2dF2mAef72ev0dDqWjFhRFrOTeu52W08hDBtXXIUv4x0s+G3DAcX3hZEpOp/8JLW+l99m X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 108c10f7-225a-47c3-b834-08daf4de17ee X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 20:46:34.9034 (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: bm5Bh/miAjRL3Vn4C8+B+8A1am2vd5MPNCXJB9/Xi97mgikiLQxdwGf8arQPvvAJONvnWoKCFryCGgn/qLUe+e62WFEiC+KmuJ8zJyNd1xU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6804 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_12,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120148 X-Proofpoint-ORIG-GUID: t_zKu9hYNDQhq0oGFXB6i96po_kAOu73 X-Proofpoint-GUID: t_zKu9hYNDQhq0oGFXB6i96po_kAOu73 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 206B740006 X-Stat-Signature: rnf7g1qppz7h9rnrzedr9gpntttkqj55 X-Rspam-User: X-HE-Tag: 1673556406-471686 X-HE-Meta: U2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hwK7fWmau0mtqFIPQc8WOD1I9Le0hn9wZCknIuY3NlECZPstGMXv0uwXMTWQrhbaeCF8Qg== 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_set_page_hwpoison() to folio_set_hugetlb_hwpoison() and use a folio internally. Signed-off-by: Sidhartha Kumar --- mm/memory-failure.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 3fff073da89b..fb98652b211a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1721,13 +1721,12 @@ static unsigned long __folio_free_raw_hwp(struct folio *folio, bool move_flag) return count; } -static int hugetlb_set_page_hwpoison(struct page *hpage, struct page *page) +static int folio_set_hugetlb_hwpoison(struct folio *folio, struct page *page) { struct llist_head *head; struct raw_hwp_page *raw_hwp; struct llist_node *t, *tnode; - int ret = TestSetPageHWPoison(hpage) ? -EHWPOISON : 0; - struct folio *folio = page_folio(hpage); + int ret = folio_test_set_hwpoison(folio) ? -EHWPOISON : 0; /* * Once the hwpoison hugepage has lost reliable raw error info, @@ -1830,7 +1829,7 @@ int __get_huge_page_for_hwpoison(unsigned long pfn, int flags, goto out; } - if (hugetlb_set_page_hwpoison(&folio->page, page)) { + if (folio_set_hugetlb_hwpoison(folio, page)) { ret = -EHWPOISON; goto out; } From patchwork Thu Jan 12 20:46:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13099385 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 D1EA0C54EBE for ; Thu, 12 Jan 2023 20:46:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75808900007; Thu, 12 Jan 2023 15:46:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E032900005; Thu, 12 Jan 2023 15:46:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53285900007; Thu, 12 Jan 2023 15:46:58 -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 4452E900005 for ; Thu, 12 Jan 2023 15:46:58 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 11324AAFDD for ; Thu, 12 Jan 2023 20:46:58 +0000 (UTC) X-FDA: 80347331316.26.607A615 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id E7F78140014 for ; Thu, 12 Jan 2023 20:46:53 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=bFwnqI3K; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=qnjAOCIS; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf26.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673556414; 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=tCuH70LX61NaAmPZDpiFd6AZPAtH40sYk1LROkus1Zs=; b=PD8Uc3X5LGlc4ovUbO6hPszp/m6WprIWkoDVPAWT6HnyUXKnVSB0C3j4+p0KDKkrXA0pEV XJ95vrmxn+JhPiEiQcb+ZMPBSq1Cd1C5jNGd+Uxgrj7SHOxuZTHUkasg93Kg/DFJJgEKDk aKAY1giRCJbv1Xgt47ZFPgpHxd5wXoI= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=bFwnqI3K; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=qnjAOCIS; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf26.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673556414; a=rsa-sha256; cv=pass; b=JSnTpFyPcF2uakvmOp+2+zYCpT5GGbBAQRMbgr1OojOaIXuhjfDn3MUD9B4KvsA3vRiKKA 2Kqn/LV/vXyzon6AylCLfWadJ+w64mb/lS5TezwATN95+abLmRusnecQ96gMkSYX5INlIi X3/MHW1VuWbP1Eugb3cjIQT28l3MDeQ= 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 30CJXnaL023237; Thu, 12 Jan 2023 20:46:40 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=tCuH70LX61NaAmPZDpiFd6AZPAtH40sYk1LROkus1Zs=; b=bFwnqI3KaWXNtxZP2dfsh4NiIlOirHr7Lt3UEX1qi2hCJE2u+C5ownCCQ6LSAOBV084Y LGKJoO7XnZXqStLoKfw4HNGyn69w2J5DmNcBg77oTsUWqNnmTMJgxvPhY4ADZa+6ekBR ZIjOUhbz6eq3ckddhbWS1b9D6X9+/fErTbg7zXG8qtPplNK4ZB6Ds6vLWowR3ehdlE2O 0dVQOgVj3uVc3d9vTRAcoqxrvg7CMBOELmj/gdz0l9X9NMqZbAK7oLZvdt4wpPQu28e2 ufn2lXejFk+2kmo5RXuFOyWVNdodMWdvnDIA95vWrj2DZLYom15Y3rO/HL6c8gfgZc0Y GA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n1y1nkhd1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:40 +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 30CKHvDh005280; Thu, 12 Jan 2023 20:46:39 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n1k4brr7d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 20:46:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NMIKXKrZihcPHT3CmW1falupQ/SqOQNWfMZoPDraLt3H/7u0t1g7Jl8uROOrBf4DQA0ok8r/XAHe/su3Lnic+CV8YVYg2H+Mtf2RdTawxx9V8+eHvD73Sr4U9GErx5vHLnaNzV75oDlBPO+xufOijbwoBwL5a0DA13IV2Vdrw7lWvkXjEc8RjlOXfEL9Xg07rk138M08t7pIWticZNzZzJRs9JAQlMT1CV5D1pyuOXoNmDA5oCCN0HH8dZxauCLDsMan6+aNHJHlZNjqh+DrhcyfXdMTbmEzSdveTyK7Img065gWPw+N/jrC58pY2inUEJz2UU8/sD8gv4438tyXnQ== 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=tCuH70LX61NaAmPZDpiFd6AZPAtH40sYk1LROkus1Zs=; b=RCOhZQ6H6aTiRXqxwX/1j378vv0ThQBrOItXbEs8usulaoRocASDNw7kqVcWKo0P2po53l7zUCn4QyVD/22zVHFmSV2hjPh9I9BUmFSBpLWzhTmg4t9928Od4StucNcBh0CP310wFXvy35IHG3a1tIOmk5cUzfBJnyPQ+p73P5UeMwSVKIFVtVkP0fRDQ+y2MnpMLlpE+2/qIL/SH6MByU1xD8uJ7GH+/7LwACly77FsuuLrpQ5Q98jLofQMHimQXJdFOXqN1GzgInajXNcnd9LEfSVsLPwkLTSwuK/zcljadatxUT3VF0GUKE2OPCkP60gyKrSxcOuvwIdV68prGw== 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=tCuH70LX61NaAmPZDpiFd6AZPAtH40sYk1LROkus1Zs=; b=qnjAOCIS2Woot2aOMjFB8tcrUlZB0DMIVTfRR1EP9wMQeplIjU7MbjUIRsdkj2Ob4/bZuUFBpzHnxG1sGycSGGTOPWlFAFmsbc71BNK7W5cWAWpQBAszXmDrtSkO7UksFtjHKL6TPeD2sexKfj3fMjNKaT62z45+i46e0FMmHoo= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CY8PR10MB6804.namprd10.prod.outlook.com (2603:10b6:930:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Thu, 12 Jan 2023 20:46:37 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6002.011; Thu, 12 Jan 2023 20:46:37 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH mm-unstable 8/8] mm/memory-failure: convert unpoison_memory() to folios Date: Thu, 12 Jan 2023 14:46:08 -0600 Message-Id: <20230112204608.80136-9-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112204608.80136-1-sidhartha.kumar@oracle.com> References: <20230112204608.80136-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: DS7PR05CA0094.namprd05.prod.outlook.com (2603:10b6:8:56::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_|CY8PR10MB6804:EE_ X-MS-Office365-Filtering-Correlation-Id: 160283f4-a515-4a5d-8244-08daf4de1916 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ODm5ygdpxO/xlxZ7aTNSpggIaiW3/gbY9AAoXPDciEARMxNztPwDlVkPnNJZ8pRKgjzVeV6HW9RDdCpPqayWjt6sOF6JVCpr2DwwlfGpmhu8nfzmX00LJ62Q9Kgw3wMkkY57oumfK8G5IDEcvj0VY3dLy543JCCV9c6moHAx+6A7n9CTxLuarkPJ4voYHdR19ciyEzDdSZ1yHhFKvafKRvbIbS+yUCBr345V9FQP09ixUHVHIoPWUrjok3us7IZt58vL1bOJdrGEkAmTT0hwBMM2Ce1tr5SPZf5xF90/XwBJIo+KWyg8AkOqV0RFI0xoHHXS7O0f52fkcfjP67kv2Jwgvi2W8oVFoVJG8HQk6BhOeAOOZh8hKzVRYq/rJdNYK5Udbxfa7e9gdY1ARtWvFmlo+7JNMFO0HnvWh3Q9JHHQjhA/eD2iHL+C+IPsRLdZIr7RxzM0CPgmhkz+MJjubOj7DE+8vQwszgLLkqs/jQ2uqFJGYGfStlK/FA0+MWsP7YkB5OJrfsF4qB3/xQTlFJnbwAVCaKotOxcA1IlB+LX3nm4VruVYB5cUq3KdjwwTRRfdJwT81isvaOwKEdk2q/UbPHRIUfnj0o73V5GWwI+Z1cfnkmZ1MNNVPNKFk3RDNlc7i55BNvq82KxmhXGs9w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199015)(44832011)(186003)(2616005)(6512007)(478600001)(316002)(5660300002)(107886003)(6486002)(1076003)(66946007)(8676002)(66476007)(66556008)(4326008)(83380400001)(8936002)(86362001)(41300700001)(36756003)(38100700002)(6666004)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iU2jqVIU39p6E/p5/hOM/1ulHa97LScsbH08Fb6x41vr7tQtz0V4+yTrhnji9NiM6W7gyZYprNMylNrZc0Dpwriidnt1Jo9PnbxI2YDYyIoJnKcrz0rxtuTQa1UF/eX8LWP569uL/v5ka1ByvEzG0TljP7C0X5Z2GEV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3Gk9LuQE1S65ygznAzo6eGh159Raau7/nYpKoUyFDN3hKVpAdHOYPOjkHeEyFVjIOXtmZOF33IhGlouRlrxPf6jp6UGm56uvhXrniXyI5DunDaTSoLNylzHIA1XYRZzQ/8gC0+D/mNEHslM616zFSOh3Nqcl73ylIJNjJDzhUy398+q85bNwLh85dMJHnmLURtzhHWSjM2X4k4BFSwrjHnxmEv2a3Lc7Now63umV4KiDZDHxYy9w4uNdgbUJgWJ+6RKIWgwHXV71hY2VYGwHhk+ehp2HGJljAOitdGUOr2Bv+izf2KJLyjY5Sd/HIGhBnegcK1vY2WFRg6+0PK6A8VrMe1g88OhCvZxjdfCMOsQitpkCuShAMxxousZofuMmP/n0Jcrg= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ZE96NTJhkioZ1959X/s9cAgzzomvxPneCPfMhHaWpkGH+9dQq4TScO987+/p5YytVlfaOeFX0N0R8jtfsaYNwBSiQJGolLHXHPd1TS9VIkHTe5NKceH0xnO+RYkMWfVFsHU+SFvaJErFwhMLEx7Ld/BRARVrRLVp/TSg7MYn59TkU6RDrZqGaPZBj7sYOBgUzmsetsQAXyzCQgaBcWRqBOrIzdmnHGFkjlacyKN91QKJeyLuVMmykiy6TD4jzidJMwRsmGTfATOUODPBDlUbJbHASx66VvgGquBuxUojl5h/A6v16/K0kmDQRniVJBH8bsO+QZGbfPqmX8N3n3LtlG7UwNK4J09rXHZzBtPwq8xaDw3/S/M6o8qOcP5tL5n92QK5KWk/g7iIA7FUChkDdW4iCdnATGcMkMovsyYXw4Yw4NwFjA30ctjnv6k5bBNv7i85glfKuQ2Ne7SGDrGljcWoZqEKF1D+sOJs7iOx/1q7ZJxAV+b4In9SnyO4qtr1GBDD0X9ZSJiLut8W8lrK/84ydmu6kljxbaFqbriXkUiQ8nVm/wYIkiZGo8Ui+G80EGD/wuz+CCX1Rv4En/2LEdGuZJ2q8LVND1D0zS79PHK+akhQMcOu64QlYbhtzjuaTHLiPm1V9NIbJrhYO8OlyfeeSdIGGeg9VZgpzP3NaJPmEKBym5OYgV+1KgqY6eL9FziYXJ+0Z0MEfJ8vBVjJrSIPDRM3HP9UaTISDR+iMh2a4AjMFwkdKvF/1YCyEhRPcYsBQgmYGl6MT6R8cR4z1pW7+y+5uV0qq2O7F6PQ5upj0cQfwa83VcDBoeekAnvQSbvCJ0qsODitYqNKpVjbeXlScER7mB2SnPVgp0X4mVtALnndbh7DuewDOpuztqOz6J7CG1onyUp3r3IS+2e6p7Su9DVwIWjtKJKZemRBcLbyUkkx2+sAk0r1YgcLyz0Z X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 160283f4-a515-4a5d-8244-08daf4de1916 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 20:46:36.9668 (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: 1mvapwMG79qpDm7CpSON1nNIcek94aGdASGn2wrLRUvFWvudMimT9Db+/07cmMF66GbVEx6YAGMDOjSJkGR8TIhgiZHdRapFLr7eTPML3K8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6804 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_12,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120148 X-Proofpoint-GUID: Up0ZQxvXtFXJ1c_RKKsgAcBm45uK0Acv X-Proofpoint-ORIG-GUID: Up0ZQxvXtFXJ1c_RKKsgAcBm45uK0Acv X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E7F78140014 X-Stat-Signature: 8jssctqb9cnebax61d3firqmbujdz7et X-Rspam-User: X-HE-Tag: 1673556413-920383 X-HE-Meta: U2FsdGVkX1+1sA0zlsD/5PQ8rY330h8VJvCh9CK+bVKHVLOKOOfSmAFZ7dGcPJ/KbKSwCGtaHjiM+3GoKNz67tolyXN57cu1wbCW5t9MjcsSF4T2f8eSqNCNPI6hC3ArA2f1NoGWVkB1x1IHZsXnVEHdzZRCCmASVnpt0Uai9rAM/1Cm5UfFDTgUqCnlsygMdZR6T1k6rNTeSedHwd74f9JfuEdbkwI4dbDBdUxI+L8HpBqx7Dl3/CNW4rVE2GXQX/kviCFzCQnrW1Q/gB94tLAK+5J3+YqTaqFoZoyxQmiEb2KGLR1uhrT1fROr6HAXrV/iYK/JEJ2mF0JHBUL/tMzB0qPZPSW5i1TFN6fJw8O1BRe5ohCXU+9SwlAMy+SWSEe+XOpd2Yw3IelGBBVHqo0wXBgSBnizEGa8G82H5ToTDknm8sMHMFtr9LfPPOphh5Y49u9PAf3QkoNE6Z+C1K80G5VVDCsfL1SDdTnieDpetWWkGGzNzGubJ2xACS/ST6ai6K70abQaccr9xm+6Ov6X6I4iLDV21d9VaydaSZ7jQZK65/QUGc2Eu812JD7r61ywUMk7dbNcbGa1SRUgAq4Jmhh4FiafFwIxsMR30tggm1ZNp5zdiQXE3MDNTrSyMHuJk+txUbZCyi12MRzCJopZZliNL2RJoHObu9W+YJYLhoyWCrD43VC9ejp8q7/pcP1e4xY3dw55SSgem3/oIFVHFl+fFjyyA71EY35C0pwrMZ2lK7c13fNWvqT9n29hSH3yettnyZidXgoHfvT2+/lapkbv8tuyFGebpIxIeElLsKq+iu2KOOIikPWdWMlDS47ti1tBi0+e8SadoBRqUK/SYhnh8T525m/8Ycwl2NRNxGCFRcDQJwsHkP+9rwxuLOPrBAiBpU56BwA4prnGVdc+oWqAVRSsbnEd9Bd9oNZned6UxVk8sDshzzSBmMwZHdggG8Ja4Ww+EnWnXXV 2ppTWegt jNpeqRK6Ogn1FppDexG0QDxB2ftLiX5vOjRwHS1XUH5dE6uLxx4OaAWP86ZAruyWaTuhSnLKxyKzI0E8Vf9T8qcJVUEPgPjOhocMvwzYw0KpjCcVvU3Dvh/zghJEYW3cfDSiRDQZDcIj5LYY6s8CxbA6vMQ== 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 a folio inside unpoison_memory which replaces a compound_head() call with a call to page_folio(). Signed-off-by: Sidhartha Kumar --- mm/memory-failure.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index fb98652b211a..c53588ea5993 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2335,7 +2335,6 @@ core_initcall(memory_failure_init); */ int unpoison_memory(unsigned long pfn) { - struct page *page; struct folio *folio; struct page *p; int ret = -EBUSY; @@ -2348,7 +2347,6 @@ int unpoison_memory(unsigned long pfn) return -ENXIO; p = pfn_to_page(pfn); - page = compound_head(p); folio = page_folio(p); mutex_lock(&mf_mutex); @@ -2360,31 +2358,31 @@ int unpoison_memory(unsigned long pfn) goto unlock_mutex; } - if (!PageHWPoison(p)) { + if (!folio_test_hwpoison(folio)) { unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n", pfn, &unpoison_rs); goto unlock_mutex; } - if (page_count(page) > 1) { + if (folio_ref_count(folio) > 1) { unpoison_pr_info("Unpoison: Someone grabs the hwpoison page %#lx\n", pfn, &unpoison_rs); goto unlock_mutex; } - if (page_mapped(page)) { + if (folio_mapped(folio)) { unpoison_pr_info("Unpoison: Someone maps the hwpoison page %#lx\n", pfn, &unpoison_rs); goto unlock_mutex; } - if (page_mapping(page)) { + if (folio_mapping(folio)) { unpoison_pr_info("Unpoison: the hwpoison page has non-NULL mapping %#lx\n", pfn, &unpoison_rs); goto unlock_mutex; } - if (PageSlab(page) || PageTable(page) || PageReserved(page)) + if (folio_test_slab(folio) || PageTable(&folio->page) || folio_test_reserved(folio)) goto unlock_mutex; ret = get_hwpoison_page(p, MF_UNPOISON); @@ -2397,7 +2395,7 @@ int unpoison_memory(unsigned long pfn) goto unlock_mutex; } } - ret = TestClearPageHWPoison(page) ? 0 : -EBUSY; + ret = folio_test_clear_hwpoison(folio) ? 0 : -EBUSY; } else if (ret < 0) { if (ret == -EHWPOISON) { ret = put_page_back_buddy(p) ? 0 : -EBUSY; @@ -2410,14 +2408,14 @@ int unpoison_memory(unsigned long pfn) count = folio_free_raw_hwp(folio, false); if (count == 0) { ret = -EBUSY; - put_page(page); + folio_put(folio); goto unlock_mutex; } } - put_page(page); + folio_put(folio); if (TestClearPageHWPoison(p)) { - put_page(page); + folio_put(folio); ret = 0; } }