From patchwork Wed Jan 18 17:40:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 45405 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2478192wrn; Wed, 18 Jan 2023 09:57:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXvHRJXpI08X6g7Pk8qqn8im5Hp8Pu4kj7J0wRBb5drf9XUh6Cyn5kai/h10ynm0MsHXTzEZ X-Received: by 2002:a17:907:3e18:b0:84d:3403:f4f2 with SMTP id hp24-20020a1709073e1800b0084d3403f4f2mr10829279ejc.62.1674064638849; Wed, 18 Jan 2023 09:57:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674064638; cv=pass; d=google.com; s=arc-20160816; b=mjXLn9dHEvw0QrxuwHDPo1Jj48PN9s6VQSj+c30eT/lE2sOu0pHeNy8uLEwtyQ8m+L xONffk8Idt4imXwreaRcyNzmAZ3hF+NctXj/9u01EgaT4NKAx9jDYfV2azOqrJpB3FIQ 8Tgo2oIwO5YpAJqptSIjzbDmBZb2sHTFuDIRMtUdaqd/ryqKuWq/lhZUbECEF2RwzGO2 FB2tMFgVWawFA10vg30sxbPAAedBR+7bNYWHlOcT7cLrVcdQGSHgT8kiM8wzwWPe1aSR KCc4E3ZcNjUs06493fMGfHbvxUINvtQtLx57CF5ErU892Mk+2K5Zg84dK8XRYci2Y6qd IiUQ== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=jBwWYq5JoP2WpGpN2uC7NrBWP1TgUG0Eso5jkrBRj54=; b=XYigWhsUNdPZLPzap4l5WxggNTsQdIZ4JFiAI146fdayFnkFIfLZkqy3tcP6nnY2bg uvHRekulae+Xx7caF/vwAgpJ7SKSnlfikk/+yuErEugfm2AlH+D6phdd5qFFlmPUVuhC bHejr4k0lPinK1c9DcwNmvoM/KmEnNy1O41X5CtIV/q1tnfPU+M2Vvr2Nb83Uduu+fcR MwTOgcGw5sEMA9n0HyqWVb43s7VJqbFhKrBE6hSX0U2gXMeeD90hRof9Xf25CJzE3B16 RO4/PR78eBVDfZNxWxdrTd6Z6m6BUI2L8Io6ljQAut9X6fjgQ5uYw04pqXPq/fozquvQ wd8w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=YlZT66HY; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Taavt5Fu; 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 wu10-20020a170906eeca00b0084d34979428si37299637ejb.329.2023.01.18.09.56.54; Wed, 18 Jan 2023 09:57:18 -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=YlZT66HY; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Taavt5Fu; 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 S230486AbjARRnG (ORCPT + 99 others); Wed, 18 Jan 2023 12:43:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbjARRma (ORCPT ); Wed, 18 Jan 2023 12:42:30 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF95859565 for ; Wed, 18 Jan 2023 09:41:42 -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 30IHQQSD023668; Wed, 18 Jan 2023 17:41:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=jBwWYq5JoP2WpGpN2uC7NrBWP1TgUG0Eso5jkrBRj54=; b=YlZT66HYi0+yMon5DzUjAPzRDBKFvJl3mca61WmNfC+3OYrlVLm6XCrmM3+0YayXqyy0 JZfTYWbpe2ZD7qAtPltSHGSb4PgMgd7Ce7tvRJxUsntBdnOXZgdnhd5wPrkRtaTy9e+1 +q5gPzGG+I2s6djJ+Vzr96OqszRSg0gq8NLlO5ZsixQq8DlH2DtKpYt9ph07GtcmctU2 bBe3uyBsDGMMapHBsHHzFsRLy1GeVWRtoDwOHJvumPpVVsIBqblgdD+JaoY8gEH/AgDV ydL3/09NfhEHmfv10LlOSNGqJr2og/1Zrb5O/HcQsGKu0mUkarW6FL3VmTqI5x1Ix6zI 9A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3medg77n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jan 2023 17:41:18 +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 30IHOTqo019525; Wed, 18 Jan 2023 17:41:18 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n6n500t58-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jan 2023 17:41:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M/u3EQAQmEFEHTocR+3gdBfPRLznOjG0gOOSFXRL+qUCXjm6mEsOKQ1KFuPnWPRqcP5h4EEdEXa3F0xSb/94Rpjc6lk1WrnIdpMpaG1xvP/xqfGaz5m97jOFU7O8fHPTKQRr+JZC59blWpcOyIi8kIsR2ldkDn422tFu9zVlj1M/Buklx3zeBtyaJtTXMbw9igf5ZkCI0cQxTMDYvFOVIOposWaOMB1MptdAVPXvZ86qS3lG5eeOrweaxXYM09x87GvtPX4vVIkCJSdXcwcawhe+5+cOQGt6q3CopS8mdaWG+LjRvHp+6QyVzuyDhHXlDy1hDnoyGUqR+UBi+K5RKQ== 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=jBwWYq5JoP2WpGpN2uC7NrBWP1TgUG0Eso5jkrBRj54=; b=FgWsz3ndIcBdP8Z6xJ/Ofujhuh8kTYEQBwuLEy2f42Dz7hubJGwwqmNDkB7xE8Q5VCEZampruaN/c6gGwG48H5SWoW1W+PgBOZkwhQavMBP6PQpHZSMQga8hMZqbtoQtdK9Er5oh66zPictsM4c399fZnX/dnFCB4T6XEZ8mEcSuOKxZ5HiA+U0FzC57rAMD69RBRep9eRnccTZzSB3/cu9AeeeiHXzE62vBG8w5P7X0u4H8u6JsbpJEstrhM6VGVL+HEVR51qGh+mwcwfGVMtWgbhyDmpZMalidBfWLRJoqd8M+1ueYe4BimyeUkVlodtz8/QLdnEsXmrtGzqUx6w== 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=jBwWYq5JoP2WpGpN2uC7NrBWP1TgUG0Eso5jkrBRj54=; b=Taavt5Fuo8gkipQxxgY8H8pxtCD4t3/tNiX6cnLFavDR8nQ1DKX93ELa/BqRumh0fX56K14lDN2yaitu/55nre2XNORjUnhSdg/VMJT7PBB9byUAsgHxKF+7lkAyQZy1cteWl8BgjiE33fKZsDqPxPTawXh6bgs0kiKm9bEcfEw= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by CH0PR10MB7535.namprd10.prod.outlook.com (2603:10b6:610:187::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.24; Wed, 18 Jan 2023 17:40:45 +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; Wed, 18 Jan 2023 17:40:45 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, willy@infradead.org, naoya.horiguchi@nec.com, Sidhartha Kumar Subject: [PATCH v2] mm/hugetlb: convert get_hwpoison_huge_page() to folios Date: Wed, 18 Jan 2023 09:40:39 -0800 Message-Id: <20230118174039.14247-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SJ0PR03CA0259.namprd03.prod.outlook.com (2603:10b6:a03:3a0::24) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|CH0PR10MB7535:EE_ X-MS-Office365-Filtering-Correlation-Id: 5407333f-eabb-43f1-6421-08daf97b20ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uwPM+Zk0hM9I6/+zyEpnw5rTD37Cx6qlA5vlp1Zc4mi2MoXCVIq/CEPyWLl+NdAyM+C5Tp2t9US4l20e7I3TQogXl4dlkpCDIYJL6eGEf/DyvjIA2EKcCBaR3d2t4mDkKNbDWd1Qx8QlJEAB8SIukOdrTk1xdnxKUlcj9+jXJMA4jI2gggOOxeoLihCkyqWKKSzOcTPeA/BJfVneuG9NQ4JNmyKdWiYi4FKJA1omV8MWg1ooL5ayok2zpl7EFxLMgsZToN5BAkLA0/wDdtKn916rO8KE0LlgyG4UN3iB8USB3XKs8dxAmVC6J/POHuScZvPhY8qmMEjb19JPhV/pStsggpjrgeKz33DrhcYqy4nAY1hcKt5/8RvqXHZR94umUR3tKafMgtuM5apucqCrkh3R3I7zJ+JszoAVNo4PsR6ChAsjyPrtQOj5GrroMIpJreykGpy2dszkb2jcKVZo1wgYWCnI6QUhzwWO/+tU+KhPTyiQOZQ0Ub8ZNyA5cuQG05ZuGETGROFG0BvCTssBLse/Dar0bF78PW0+rr6PQHFEtgt9Jngb0QBHPk7rx6P3QkQMHgLQamB9hXTqMazACgN/KPpVHlKCboWdUhlulLUf7Cx1pT1Z/SRkVoqHEnH8/ioGyyHzXVRe/+3xkLUq6Aww3Cq7Pq1adOhf60gJXXw61cM+D9FEOUY3opwaXJm7 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)(136003)(376002)(396003)(39860400002)(366004)(346002)(451199015)(2906002)(44832011)(6486002)(478600001)(1076003)(86362001)(41300700001)(8936002)(5660300002)(36756003)(66476007)(66556008)(66946007)(8676002)(4326008)(83380400001)(38100700002)(6666004)(107886003)(186003)(6506007)(26005)(6512007)(2616005)(316002)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kkn3dFlQJOIwNwalbutM5nHYN5hV+1xeNadgjSvxeQsxn8kFFHPqYfq784ENAbae3AysvgL443yJIAKQlKenf1Z1tKEzUmxUFcu8eEW3jWb6s1pDy6so62596I4l2Rma4xlTEdekEPmUvMxe/iOCMq+Te3Iz67iHvbbuly/JbPdNgA4gP3SXHtXahKrSbA5ttiwfIq7x+JhePRkDy+7hvrhfUE1sEKdRLeRoo8XdwxATyoVaAtmeMcRQCOeNK7CGopO7wLA2SbFF6qGMfcHGPzlWM6aoCzE16E8hExbVxlQgny0Ka2zyj52i89Y8wyhcQJHxgEmrHqO+wnMz7u3GIJc2FhFFuuOvYCk66i5IVcDbkkRobf2hNpLtCj4shIE4g/IuRx85p3hooXvChaAOHFU9mHv35fZqaa1YWLPsrZe9je8xVR8XIVlfFsIFwsgt1vgfvHHAzYy36QUFtUTWbih6BgnAzWBXttOdRcwdSftJJ0x7o/ae1t86kXl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ginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5407333f-eabb-43f1-6421-08daf97b20ad X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2023 17:40:45.2905 (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: i2OP2TF8U55UN9G7UGi0PmR+yzOke99OIEHM+F/T2pYn+vXWsCiIULXVHTaETiriw0t0IAB4i39LQdqlJQMkCFpiGVVBcZB8OuPCxVrXQuo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB7535 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-18_05,2023-01-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301180149 X-Proofpoint-ORIG-GUID: THzwjUO43ME8hpL3ZyS2l1n0jTiUE0ed X-Proofpoint-GUID: THzwjUO43ME8hpL3ZyS2l1n0jTiUE0ed 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?1755384002487336989?= X-GMAIL-MSGID: =?utf-8?q?1755384002487336989?= Straightforward conversion of get_hwpoison_huge_page() to get_hwpoison_hugetlb_folio(). Reduces two references to a head page in memory-failure.c Signed-off-by: Sidhartha Kumar Acked-by: Naoya Horiguchi Reviewed-by: Matthew Wilcox (Oracle) --- v1 -> v2 Change &folio->page == compound_head(page) to folio == page_folio(page) in __get_hwpoison_page() per Matthew add a-b include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 10 +++++----- mm/memory-failure.c | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index febc36f6c595..c6854fc50690 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -171,7 +171,7 @@ bool hugetlb_reserve_pages(struct inode *inode, long from, long to, long hugetlb_unreserve_pages(struct inode *inode, long start, long end, long freed); int isolate_hugetlb(struct folio *folio, struct list_head *list); -int get_hwpoison_huge_page(struct page *page, bool *hugetlb, bool unpoison); +int get_hwpoison_hugetlb_folio(struct folio *folio, bool *hugetlb, bool unpoison); int get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared); void putback_active_hugepage(struct page *page); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 856d2fdffbb9..c37a26c8392c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -7272,18 +7272,18 @@ int isolate_hugetlb(struct folio *folio, struct list_head *list) return ret; } -int get_hwpoison_huge_page(struct page *page, bool *hugetlb, bool unpoison) +int get_hwpoison_hugetlb_folio(struct folio *folio, bool *hugetlb, bool unpoison) { int ret = 0; *hugetlb = false; spin_lock_irq(&hugetlb_lock); - if (PageHeadHuge(page)) { + if (folio_test_hugetlb(folio)) { *hugetlb = true; - if (HPageFreed(page)) + if (folio_test_hugetlb_freed(folio)) ret = 0; - else if (HPageMigratable(page) || unpoison) - ret = get_page_unless_zero(page); + else if (folio_test_hugetlb_migratable(folio) || unpoison) + ret = folio_try_get(folio); else ret = -EBUSY; } diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 0b0a36afd79d..eb8c3cf2ca36 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1328,28 +1328,28 @@ static inline bool HWPoisonHandlable(struct page *page, unsigned long flags) static int __get_hwpoison_page(struct page *page, unsigned long flags) { - struct page *head = compound_head(page); + struct folio *folio = page_folio(page); int ret = 0; bool hugetlb = false; - ret = get_hwpoison_huge_page(head, &hugetlb, false); + ret = get_hwpoison_hugetlb_folio(folio, &hugetlb, false); if (hugetlb) return ret; /* - * This check prevents from calling get_page_unless_zero() for any - * unsupported type of page in order to reduce the risk of unexpected - * races caused by taking a page refcount. + * This check prevents from calling folio_try_get() for any + * unsupported type of folio in order to reduce the risk of unexpected + * races caused by taking a folio refcount. */ - if (!HWPoisonHandlable(head, flags)) + if (!HWPoisonHandlable(&folio->page, flags)) return -EBUSY; - if (get_page_unless_zero(head)) { - if (head == compound_head(page)) + if (folio_try_get(folio)) { + if (folio == page_folio(page)) return 1; pr_info("%#lx cannot catch tail\n", page_to_pfn(page)); - put_page(head); + folio_put(folio); } return 0; @@ -1418,11 +1418,11 @@ static int get_any_page(struct page *p, unsigned long flags) static int __get_unpoison_page(struct page *page) { - struct page *head = compound_head(page); + struct folio *folio = page_folio(page); int ret = 0; bool hugetlb = false; - ret = get_hwpoison_huge_page(head, &hugetlb, true); + ret = get_hwpoison_hugetlb_folio(folio, &hugetlb, true); if (hugetlb) return ret;