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: 42819 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4105287wrt; Thu, 12 Jan 2023 13:06:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXsS38iuR8zT/v6q10+gvwgbWaB+OEZdh9Flcb4Lvx0YTQQe/wDV2FPRBXkc9mC3k6BrI8uI X-Received: by 2002:a05:6a21:c008:b0:af:8448:5137 with SMTP id bm8-20020a056a21c00800b000af84485137mr97051453pzc.39.1673557591619; Thu, 12 Jan 2023 13:06:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673557591; cv=pass; d=google.com; s=arc-20160816; b=qg/Zw5LOeGNIuLORMe3hpPvIgLheR1ix+MmznAKfcmaQTadnqvJtxa+XFoGD7mZIb1 VYb7TUySUgPdyPWUqGQ9PcR/Xnuje7Rsv9AMCEjseeYUGm9cke2T98nJX6ui4mmNjNkU PSx9V+dRdZKUxEZAcK/QCfUK9JVGApKzAokxtzRBbCzpYKw9XmOjBqQTjpm3ELv4L2bY lOClcjHn3wAVxBJaONlp+RXxSA/G2J1tqqwxXSoDbZ15UyK4mQ96FpFo8fGKH0zgvvIg OCWyBpADr2E7qdUgK6+jHksUEGIaExVVBOqLzTiaIqmGcBJCweWOoBqmu4spLDixbHFa QAWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=5ZhXU0K0obhHWYBra0myTmvhNZYLEHNRBdlUL+JmMXM=; b=YL77M3NaoLF6A2zFIZalGabdTuQ48SjVn6MwgIFZ8jaZy3Lt+0NPS8f9wADPhKwdRx DrH7lvUNpL89QEI7eJjRkvSp/mi4oGZdmMDXxMROwDRJFnhnf3723shuPDen4q/87JB1 n6mPC0NpGdiypDPnApnt9xpJ9x/hyfnWCk7no23e2Knjsi9koYDHKvlPHhDUueDp8Non Dg2gzwuN7Fv/q97MP3T8AjgRmHwz7D/iOJreciVdEZ32BZwQzLXiGvFx0kmyLYM2ky0o bjPCR1E74+Ukq5cuvii5zVgRZy59POgOtzXBRr6dF3ppKqMqpYwbhQcAGbutpZZ5do3m DahA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=i6I00Ckq; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HDVzf3WN; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h192-20020a636cc9000000b004784654214fsi17929719pgc.442.2023.01.12.13.06.13; Thu, 12 Jan 2023 13:06:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=i6I00Ckq; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HDVzf3WN; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240839AbjALVDM (ORCPT + 99 others); Thu, 12 Jan 2023 16:03:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240629AbjALVCM (ORCPT ); Thu, 12 Jan 2023 16:02:12 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE6A245654 for ; Thu, 12 Jan 2023 12:46:39 -0800 (PST) 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+hDCLoMPGqqpk46HgTzcfubDKzZJWeoCoCFGPvboXXbQa7Vwz0CNEQekclL3g0A5bfh2aCqLklaQfl1muUG6CL9D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hfzONLqjlOvS0BfuN6eNuYubZa45j4VkWw4j52UinPFx2+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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754852325394382425?= X-GMAIL-MSGID: =?utf-8?q?1754852325394382425?= 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: 42813 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4104690wrt; Thu, 12 Jan 2023 13:05:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXt007K4bLBe8OIIW+FK+HtW+wMLh7kEk4oRKkDZaMBSw2Sqfu4XiXhLh2uns9gS7RpRZjEL X-Received: by 2002:a05:6a20:d04a:b0:ad:3ada:c712 with SMTP id hv10-20020a056a20d04a00b000ad3adac712mr94831054pzb.14.1673557515629; Thu, 12 Jan 2023 13:05:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673557515; cv=pass; d=google.com; s=arc-20160816; b=l24CamurchS5Vq/lQ2cWaxikAxo+gc0Uo1bmXA93bq4vt8Ye9e6XuymHy4tCnWb1Rk gNeXbc+PvWwigxo3jnh2SPiBlKMNkvx3r4ak3w8zGETjyUYHO+L8tKVaHgvziARB1Mn3 mN+aQn+DnMjRhTiFJUUHYL9rQe1JKTctRZ8jdZCdDjWTQ92Ka+wWdP1VueF1E+CeOGBB Z2R0akeJvK/yNPm1en+ShiICxJmkwQq88JT9tu3Q1py4xVnJbUKSKaFqLm4bXp2lJBPu jOfbejgVxiLX+9pTTOvn3IoZ7l9L7olBLoQ0bkzU+9nduEOvnSce4WbTZehyi1uFFyyX SnYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=2lZcX7VrbQTi1+7mVOVczMeZDYnWD5m9QVBm9IatMv0=; b=Vv+xKDToTmFFZC7WDDYeZ/9xKjjBymcdD9+D5HngddAub+93113nUpsocNk00RA7NI LaLs+YL7LnHlsUjrr89lInRT8+0Ps3zxeUs1BgTWKtaouji/TH5g2hQHwDxWw4dC500W xDKm/FqLxeKX+uI6UNr1fK1HzjFPNmjY+O7rxVNPvFoMPI95xQnCjEa99aHbtlOciDth KUWd5ceYCihE8Cw8JjeoJCnfJO45vMFdgJk/gKBH4MNRgV4ctSiis/eDieMSBpuzR8vh z8nGQFwNtEjK16KyhYo8ak8Cooz9Rt+RxuPh5kko9VxU5/D3o+INQoqDFoDbNx0HrCjN vVMw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=mjWcQvaA; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hLvw8vyB; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 22-20020a630b16000000b00477b29bb007si18669498pgl.854.2023.01.12.13.04.42; Thu, 12 Jan 2023 13:05:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=mjWcQvaA; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hLvw8vyB; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240857AbjALVDU (ORCPT + 99 others); Thu, 12 Jan 2023 16:03:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240615AbjALVCL (ORCPT ); Thu, 12 Jan 2023 16:02:11 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99CDC45651 for ; Thu, 12 Jan 2023 12:46:39 -0800 (PST) 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+Y7zut4zjikmAY1UGPr+TWY2xMYlKWoXK3JfwQ3K9aIZhjteYALDOlqCVRdlbFiMG43Er2T3mo2+uprTZ2VQ4kOX6Sm9piIeg6o6vZaXdr9/wa8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/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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754852245588102019?= X-GMAIL-MSGID: =?utf-8?q?1754852245588102019?= 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: 42814 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4104694wrt; Thu, 12 Jan 2023 13:05:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXsm0E8IhEXgE762H+e/S+Vt/GFttNMjfTKjhJLJ3q/5qTW6Vpa1iz6bEIVBoHuMshYXJsXO X-Received: by 2002:a17:902:d893:b0:193:b7e:2bf8 with SMTP id b19-20020a170902d89300b001930b7e2bf8mr23355412plz.59.1673557515962; Thu, 12 Jan 2023 13:05:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673557515; cv=pass; d=google.com; s=arc-20160816; b=0lUPE4Y72JicSF701hGX+RdeiXI0scbrl4n8k+cHJ0VD9T0K8NeUcQPbEOs4kNCAq1 KiTUZ1MwwhR0Svdt73vtyq1Phj6mDN0LegZQ0dT/1j52sMbSpx3M2bdQJ+IIzxmxfsjq 2QqIPnClf5HPDa4Jmbf0wj19RyC3rLyjTcezdxDEildDRa7KvG9NbiyNPMZ0ErHdCv2l H7VIYHExsQWzy0hFf07ZLmLdY21fQqK595XLMKapP3TLB6kzRiw3taaUOJ3EOOlrohCd PfpkD+Rnl4Emf1XZSxYIj8KRp9JuYAJg56iOr08Lmltv0K9VRpYb8SWsRikiQGpyRD3a UF6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=pX5Ehn0FhmHlD7jbJcixLeN9Bde5WmQy5YXsDNwQ/bE=; b=oRAhXhqgozTcqPjVjlbUxpekVYWD3fgd3xxI1ns12iFwm7qO4+vrJ0ltCndx9+MDEG 9zdhGrBmJWokaXEIDzmAYJi+AvT5/NRea/tmcL7q9x1eeIXHNVMLcKWBn4EYmduEM7AB +vxzdfa9LcXpKrt2HtUNGkhnXvK0IRa9X/PYPw0Ye0u5oRTkdLMCn2Vq7HRARW8FZg82 KS1yhoHF2ohSWPod6XFjtJWqeqIDIpNuKJawDXaDB5hLvGlW+qF81yEhhe10KhI8fOop m1AH604YuDzP6XrYdP+wfItIbTijYmUY7ZzFEc/rPrQkA5hjMAsSALCIHCMotQ1Fu0Mg Z72g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=0K8avunK; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=K7IzCtTk; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a170902da8300b0019268549979si19916469plx.263.2023.01.12.13.04.57; Thu, 12 Jan 2023 13:05:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=0K8avunK; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=K7IzCtTk; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232583AbjALVD1 (ORCPT + 99 others); Thu, 12 Jan 2023 16:03:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240130AbjALVCM (ORCPT ); Thu, 12 Jan 2023 16:02:12 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B88E6550 for ; Thu, 12 Jan 2023 12:46:41 -0800 (PST) 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: EcCFvgPpE6aHPDd5OYXiqvacEF0v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7CvDK4nVVB2DzUbInZb3DgJgQf3XBXQnocYWAf5nGNFZ24GQWpTJbziE0uaacBsCqScarppdmRYNAEnGbcuTh+jUgnPkzKdV1r6d5XUhJ1c8+hGrxHufrY6ME2RnlUsBi9nzsPFmb4NoxnUefArnI5fSQd4weRG3AG4VQW8XXcLY0GsCiNsJ9IFw7Q3rZGrPzjf/Qy7K0u9lz87s+reyYcFgjmfFW/v9sLF4r+615jAsatCHC1+SiVutrViaQlI6MVzlSMMf5bmey2vRUg0LmAnRZlphzyiiuekel3GRsnLfzjkjV9wRIM9oOkfKS5pSArxYBHK+4pVxT8dsWOLU8IfyqHaF830VK5zwxWAMk+yd7GMm9INUq5HCc6+Y+M1DVwP2MmaMmGwC3ZzSSilf2FzpjNl89c2wzPC8sEao1pbsaupnJzlz9j6cNnSjoldaf8OvJrWBrpn+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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754852245701788853?= X-GMAIL-MSGID: =?utf-8?q?1754852245701788853?= 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: 42815 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4104829wrt; Thu, 12 Jan 2023 13:05:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8+5Tj36DRyqEwuGY9Mh9YPJ0BTOEGdnzmzJkAwu+zcXRcjT0uVUnbeDItmcyd3FMbaCuB X-Received: by 2002:a17:90a:5994:b0:226:ae12:444d with SMTP id l20-20020a17090a599400b00226ae12444dmr33878004pji.43.1673557532250; Thu, 12 Jan 2023 13:05:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673557532; cv=pass; d=google.com; s=arc-20160816; b=NE9QRDLEHkbIOwgQ5w79qKl7TzDqYL5lwO/2R51vB3Tz75nmfQWKYRWwlkcnT2tVJn qHgv/leYCiPmzExQePvc1Zhj5nSmdnLFgHCRH7G96GHOyqWcUdNCLX0PWFai4PEa7B9c 2sSOzpE/3CGn3i3MAWB+IdrDzhN8w8bAYJlQ36OYPiNthDeWlZFpMX8sDDPK3JCSoA9D Ha5sQPwKrTRFOtCVIhUQz6NpiBCYji5IJ/PdNgCkJM6BS3+ZqdTmefBE6s22E0g9Yqm3 WDvpLwLsnUjIKnB+a15vGZU8H/Ulj5arAD8GfMe72vk6TRcO40ww7yqFzPBVEnH0gEwL xUsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=b/N92ggOTVESy4PAPzARUeux3nxn5O9kMIfCDwqMIIU=; b=o0rPW3IXbr4v7UDMnji9VyyAv/IpDp4GtBVYfDWKSs32r4OSeoojCka8c5KZe6f50t 73Nji8+RmsWfh1xTbibegDydqs39wUa44KxrMncISHKrYrm2odb4ICvDiagN6x0F4EhL KScYPjLhcDUENiOitLuxso8LGdInF7Oj38WtvUeIQbLmE4qUo9WTw6CJo6j9RrSV5X9n o51FEayA2Yx1lgnX7v6rUdAQ0QwPQFkae4vas8xQ2wyuxT5uFFCDWxC+l1XkjUNSBzrO tRJncMlaC2ZErRl+FGBvdH82yLNsNwWIzGse1vNDEv61jzJoJv2nnI9DAf7A0IVVLqss ukdA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=ljq+3vLR; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YtXTDONk; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a17090a1f8400b00202c8fa5c54si21582631pja.95.2023.01.12.13.05.16; Thu, 12 Jan 2023 13:05:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=ljq+3vLR; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YtXTDONk; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240879AbjALVDj (ORCPT + 99 others); Thu, 12 Jan 2023 16:03:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240634AbjALVCO (ORCPT ); Thu, 12 Jan 2023 16:02:14 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C576F4828D for ; Thu, 12 Jan 2023 12:46:44 -0800 (PST) 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+Q3F1UGLcXgwdCqOtzpmp1U2fcRbjvVlg4m62JQvA8MZ2wgerduJPHD1hfu6IRXB7MB/Z6woU0B5PO2euzbLwoIa+W3F/1VnnXebO5wIa9oxIC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JyrYhoVmNWj017mUfFQufPXEGNtNYPiazsU8KgEcmHajQOMY7hjB6ST6SR/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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754852263333713864?= X-GMAIL-MSGID: =?utf-8?q?1754852263333713864?= 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: 42817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4105175wrt; Thu, 12 Jan 2023 13:06:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXvjLtwxj0imcrm3NzFLnSYovi3TNUT01x1PQ2Hl5vXFoBCzW8A6fyFAXufax7tVkLsjzqvV X-Received: by 2002:a17:90a:8404:b0:226:8b19:4b0f with SMTP id j4-20020a17090a840400b002268b194b0fmr37814023pjn.24.1673557577567; Thu, 12 Jan 2023 13:06:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673557577; cv=pass; d=google.com; s=arc-20160816; b=ps3iFQc/+Lfy6Y/2QVwbtaPthp2GhSxP8rZ/lRidAogg0wHgPbSc4rPIASVb7M2ovx 5EbvYIAPyzEmiC+SxgGiFmczigKHyluUDKq05/p0cdVNUxgfwUcPiZatxPCE7/3VSgDH HiWENdN0qAi4qvjR3NOkwYWmLkADqquEn9r1XfC/UUM61HMg1yzyWreERjkWAvb4eLLP 7YEXh3QEw7jsQedMPLH2BhDaN5p2fgOJCso10q0JozdnvSgP5HNA/lJKOQcMNjeX/Dru CZgl7uATcrMVtcpFMm8OEyRJjNTf4b/9EzY5E2Nsp9+wkcNSvGmqZsk4CmMduikryIyI 3zxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=OJ2PP8aFeoNdhHtIahoaYvPgXtAM2nrK1T2oYw7fFJw=; b=nsoTMMsFbJ6r52yLlyjxhJeAyvisGbKosBwd/19PF3HiBoaCN5UJjFDlE+IQgp1Alm LU1Vdx7jSBxoL5N6sOj6V+rYzm8U/n/48lTHTNPOH/wZhz2vfGhCbOSXfDknZke6dSao 5XHTMH4OU3iR9aBvLlgGGtmnBViFNO+uy2o7o2oLMzwBmPhKRvoDV3rEoa48VPe0EQJx cFFdl9fi4mC3rn7N8uWPCUmuOKzLSxVsEVVR5MNlz1ie9wbKKmUptASAX8U2E85SI6mD k5TNcwT911tLrgYNgMK03Y8PcAv0H9vgMrQ4bvO2nVVw7LCupZ0kN/kjOxxffiZNqeJG IN3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=Sgl6AfG8; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CuOHGogx; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rj14-20020a17090b3e8e00b002291890533esi970172pjb.114.2023.01.12.13.05.56; Thu, 12 Jan 2023 13:06:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=Sgl6AfG8; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CuOHGogx; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240488AbjALVFF (ORCPT + 99 others); Thu, 12 Jan 2023 16:05:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234267AbjALVCu (ORCPT ); Thu, 12 Jan 2023 16:02:50 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 241BE551DF for ; Thu, 12 Jan 2023 12:46:53 -0800 (PST) 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+bVypuZalhWr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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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754852310194876792?= X-GMAIL-MSGID: =?utf-8?q?1754852310194876792?= 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: 42818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4105209wrt; Thu, 12 Jan 2023 13:06:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXvTW03/a9cd8cy5vTapdYk8TDdbDNP0TN/jtINefu2gLN71JSMSNiQvhriW57f2jgqjcyq8 X-Received: by 2002:a62:1b58:0:b0:581:4ab0:abcd with SMTP id b85-20020a621b58000000b005814ab0abcdmr7776757pfb.14.1673557581460; Thu, 12 Jan 2023 13:06:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673557581; cv=pass; d=google.com; s=arc-20160816; b=CONI5Hoifxuca02gpIpkb/kszH1ZElJJJVvOWaWGytcxtDpZqRv5rLOXcWhOInP82v ym1TMKYOrLOKWvKfD8r0nPmxTNFBdn+Jl2CvFMdgyjsF9zuX4oaWlvu4TdN7m5WroMK0 8hWTMl/AaTyMP374J6UKl5xZVk9bMq1X+bfZC8FDmdIYyHwqoDfx5udhYTd7Hc81AsCI MYvHBygtkAeDokCi0x+w9mzcNH7aqzOus+0gI+81gh5VABU1foDAmoj7wMN015vnZHcy S00JT+PIMx1VbGSV6JfWnclf4sTyIrgm7NjcMYvJX8XMcWMG3n1xaNpdWoz9kzXy/L/F oVHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=q6+oCQXcVUPDMQ62zkDTZuFqVr20l7Tj/4Q5KsZwSwk=; b=v3RS8abXOvT5TC75tsldHkbRSORkv9yJwjpug25K39Lkho7wtih1ORHyIhmsYB92Pw /dU12pLCTnCAkqWMctoG79malGJ4VWUtgml/KV323QnNpioRxhjWhlitxc0U6kVpO38D 0U+GLUIh0o6qxBSB+cm30i2BxGr5T3q0ZfvOkNF5/XqXIDoXgtnPS0bPSfX+Id0USwwK eIM/dF6mEZNGTJwB30ewwkW8HyIlwA/u+NU58Dt9zIZ9EBDsTUKI8Zd6IGlyOfAhdrnB sNc2ZKGzV9M1tGRwNsYJVkq0deChnji/JOsMvnN/6JVoer764L3LZ0bLCry+xmV7+FZf 8gew== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=Y1zHq+uM; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Dm6copwe; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v21-20020a056a00149500b0056e48944843si19557570pfu.355.2023.01.12.13.06.05; Thu, 12 Jan 2023 13:06:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=Y1zHq+uM; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Dm6copwe; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240363AbjALVFT (ORCPT + 99 others); Thu, 12 Jan 2023 16:05:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240737AbjALVDE (ORCPT ); Thu, 12 Jan 2023 16:03:04 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A959953297 for ; Thu, 12 Jan 2023 12:46:57 -0800 (PST) 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/QAW1SWzFsnbp6oXN0Y0Wc2HfVINiFlMD5eSDaYYgvXSqpKACxoj7yVOzj2GR5I9B1HIrpu7vMhi5eucwpO9hNBQbDqHTZJq7jsK7Zhp2xkmef+fyVUHnYWZXcQfEG4d8FRUwcfsjitahn+sOzcXzNXWA1IX53Kxq5g78v0BRtI6vQYPErbp3qyiuWxHY71xu2OYQo3yEc7NzaTkWitTLFMpowsVXv4SvPT12063Y69RghyG1J9TmjQlC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UW6zHLrMkkiFd9lkG6Y50oBoNdrfQzBJYEBKuyupRgrp/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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754852314597688940?= X-GMAIL-MSGID: =?utf-8?q?1754852314597688940?= 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: 42816 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4105045wrt; Thu, 12 Jan 2023 13:05:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXtbIetdfGdRaxEZFKkuzkm6oKJgujbXcHA/puh/O4h+b407pInAH+JeMgy+QwJUVSxpj9vd X-Received: by 2002:a05:6a20:3954:b0:b6:4b4a:bfc4 with SMTP id r20-20020a056a20395400b000b64b4abfc4mr10671850pzg.14.1673557559354; Thu, 12 Jan 2023 13:05:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673557559; cv=pass; d=google.com; s=arc-20160816; b=sERh5T/fsu/A6Uzv+yFG6S3DFbYZeWoCUeEeLvipJsxIJjAAMXTBIHnV5HyZsUVB2r yFFoftGQ19QoyRBxami/ObOddOCHkK9NXcUtOttULSRr2vpQwda9F6gfxb9nO1F4Ouit TIgfso3pGsDtgOigmMC9Nj7Cdrwz7nWLvXz1dTOHzTwaGv9ksTCJ/dsTs/Tsejt09Mmy 1queJC2Gdq3yceh4X3f6CP5URrPdpBvnwixq6cjP2+gfEuV/KGFui1APiH5uCLIV5tZF fr9clFIjDXMc11CVIjMaEUtzUWTbgSlMlw/Uhq549Sk3YCPYTgMYgE9p8HE2ZA9MjUnD DGZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Ll8zazKlpDCzUiZ/avQ+j45Xsf0kzAv847jvl6gqI3w=; b=G70LMVoaKl9H9NilRbR67su0B9q2dLXDlcMvO+GE+fARym+LkUIVDvVrIuVx/IDEXT 6W6okGZhGl8aznxhDUfKfoEhdl3L4vCYVEbUBtMNMMzA8rUT4GJd3JFpbHpbnhuK3MHa 4waNA7iuWPwLJ0E5mDKtLUyZ3uZupmWsu/TLoHb+3ITHRnk7AR/b+jFW0r/BdRxbxpZp 1sTag8xMcTY+bWCVOGa7b8nB5eYJ5prdV7jdkzHGn43V/y0RgE09aEiLRF+KeicAVh7a SSodB4EStCjprThEhdxj3RckPD+hozOiNg4xUcz1KgRewZBWH7aev8A+MQFErA11hO3d PlJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=vrBS0oso; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lckCxwbR; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v29-20020a63b95d000000b004b980d584eesi4742071pgo.49.2023.01.12.13.05.34; Thu, 12 Jan 2023 13:05:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=vrBS0oso; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lckCxwbR; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233122AbjALVEz (ORCPT + 99 others); Thu, 12 Jan 2023 16:04:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240324AbjALVC7 (ORCPT ); Thu, 12 Jan 2023 16:02:59 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55CC549170 for ; Thu, 12 Jan 2023 12:46:53 -0800 (PST) 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+qtdL2wW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OIhaIUSqZ93vop2vzX0HUr5TFot2giRwl0lavwkZOe3BI7EtaDitOE4oqTzY3fHDJpkI+1IIZu/yqGCWtQpaQfUW6QaSDrmhOQhjVd6A5Vec601IJgW1azcxBKMOcdI8PPesZbAi/XyXP97NFoUm5MTXi4RUXvUs8rWrhXELSkbZJIuCaYtFTHO2PWElwJjhqXwIVvprt9J68ic6zndkjyO9WHh4XlRBUTsbK1+DFUu2FMNpC4W3isdd28UoBJ9oH72s+/BxCvLJgE7HxjOAO+fSj6rSNu9sGNh+3LLKIVoSveFLnHTh8N7OnvNjJpTmkMYS6aMKap7gdb/9K087NdrFq/mGuMXHvvVz+UotcvWGJZa8DJwBG3EXigxOstpF3NYiL0CdZWa1H4DuAyqtELqn+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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754852291623800603?= X-GMAIL-MSGID: =?utf-8?q?1754852291623800603?= 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: 42820 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4105318wrt; Thu, 12 Jan 2023 13:06:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXs9Ky2JU94qo7HipYMKpkxXpRpq4jsfqt6YFYTtY+ftg1VEHYqRSbFNPLSZ5huXr8U9+hKw X-Received: by 2002:a17:902:cd0e:b0:193:37a7:cc1c with SMTP id g14-20020a170902cd0e00b0019337a7cc1cmr15241991ply.56.1673557596044; Thu, 12 Jan 2023 13:06:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673557596; cv=pass; d=google.com; s=arc-20160816; b=dHTroBUC9nfp6ekxU1vZyPIC2QrwPTf6X8+MZc7VK8sdn+Ej7/MPUZVlhOhwxQeEjJ D7nOnj/bDew5lJWZA2i7J7z/p5KVhxGVpJ8lY0DRuLtxWVnr5al5xwy9bQO8v4Irvff4 MvW1dERrQnoonuYOaVoa+dUSGMCavawTR3g+Wr7O7IiAw/zxLfOpFP5SIZ3f6xRtkWIU eqOQMAeLquSxhzT8iU1SjoO7MdCHD4S+K+kT6txV9N2OeI67A/bg8MEUX7Nciq9WQCeh cUXLKjSOwC7nUHr09KCe88IGhtUdxlLdENixbXkrlG4qIId7Li4pNfvVppcEiHzvXQr/ r80w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=tCuH70LX61NaAmPZDpiFd6AZPAtH40sYk1LROkus1Zs=; b=0VC0wfVC5ETNxZD5nk57WiWJu1JZNFMFV6SU0llbRXrZhVD9t0jTXINhp4V/TtJZeH 1KaslzBp+jE6W3K4TrM1xsh8Keq3JBpiOJRdIsuFm64NMxpgAtGVcHI0RpFZhErUPUQ4 mwCLREfrV4ZXu1kMKG6fooTNKaDMuz9YUAGU52EA67QkbqTjCY4cjWEOHuL96bA65LiT gIUurHg9hzaI7ud9nZ0JX7puAwIKLLqOnjKtcooKofgynfO3kZuSKNIXlUEtWjAnUUBQ slUAD+KD0EsY/wK7nSIzZ1jiWkIsfatih4SJzFNCxkKUs+jA9+UylbRxJpw6itjkMIei M8eQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=bFwnqI3K; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=qnjAOCIS; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z5-20020a170903018500b00189d0fa14d6si20598976plg.13.2023.01.12.13.06.21; Thu, 12 Jan 2023 13:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=bFwnqI3K; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=qnjAOCIS; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232693AbjALVFg (ORCPT + 99 others); Thu, 12 Jan 2023 16:05:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240567AbjALVDJ (ORCPT ); Thu, 12 Jan 2023 16:03:09 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37FDF544FB for ; Thu, 12 Jan 2023 12:47:02 -0800 (PST) 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/v5ka1ByvEzG0TljP7C0X5Z2GEVOTvrebqPF7E3o7LKSz6qcu1d3K8ppVtkGydob59DYaePMdpmKOpE4bwgBMcuI1QyzVvljN1ipYDQwTe0ZY9f2/Jshf0AjGxnKJreXvZHITl1aQBbUICXsMfDX+T6E+XuvhTegKpJf/oNzx9i6vBN0+nOn6efOb62+9Cm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l6MT6R8cR4z1pW7+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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754852329803769665?= X-GMAIL-MSGID: =?utf-8?q?1754852329803769665?= 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; } }