Message ID | 20230717181812.167757-1-sidhartha.kumar@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1279987vqt; Mon, 17 Jul 2023 11:37:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlH6hgCu3oONi4MGkbXOw3QiTXjgqBmovOG47eIDqgVLxE2ebBIa3Y+0SnrRFOTlBdV96NUv X-Received: by 2002:a17:906:1d8:b0:993:d7c4:1a78 with SMTP id 24-20020a17090601d800b00993d7c41a78mr10725734ejj.10.1689619025754; Mon, 17 Jul 2023 11:37:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689619025; cv=pass; d=google.com; s=arc-20160816; b=da9JxGlLOU2bKJBqM/NQNo4R1Y7x+FcbNWw6I6VTkZs4nurmOAlGNlXZXIF2AGpX/6 2/WMMPb80dJ+vHNciViQkXzCe8uJqZCViLfHGNDK1zqDsGVprGTRBrw0f/NAh6rHlbgN 65X/tXHB4uShRTy/S6zfJaJamfQSrTvRUCjnrQnr/38YCFw6UUTB4yyxLYN/K/5yPGVQ dQ5VDDXStwai7W1uiPnL6d5y9mEOOJfdzlOCxh6A1GrJs2Ts0r9ArRINMoR/sK2f9YCy wslGiG2EYB1KT9dKySzwAw2qJMBlCMz/tCLXxBZKHtJTTQxOoFxoCGZHxbKvc1Sviujk eZ6Q== 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=rHfjSNkVAEriO7MGs6R9fa/S3F5tV/SjhOCElVSk0lE=; fh=ewn+miTvc4aSSfTiliE3ES0UpOxpF9ZDVnBBTQSatFU=; b=eckypI2/tRVnzh+xz3dsAYTEJtzkF7Zbc7oqq/u3L68KO6VnqWLwVc38DRyHDcEz1S b4j8u3LfSHJUFFkq/835KwS1edhwF0uHW22H+mX/5gwZfK303fXnzG8G9t9dM9Ryyqr8 Q6k/QdDq9Zy1Cv2TjqaCu1TrKl+yZ+YuW5ik3c9xjEuHd1scquyjR+/arMfVbI1BPRtn Gb3BPGWKB8wR2H81wN3VMOBWfb1NR/38qUmpwUTyQ5rQVD+m23locRzXq1G06ILuiT8j HHr7NYQ9cVJp+jzXNI6KHfCfva9atXpjgjXh/TrHBvxaicIDYjHpPqxk/WAQ7z3Dh+2y ldlw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=IQTG7n9H; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="TTm/rV9C"; 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 gx19-20020a170906f1d300b00992e8bcf7fesi9157ejb.721.2023.07.17.11.36.42; Mon, 17 Jul 2023 11:37:05 -0700 (PDT) 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-2023-03-30 header.b=IQTG7n9H; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="TTm/rV9C"; 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 S231804AbjGQSTw (ORCPT <rfc822;daweilics@gmail.com> + 99 others); Mon, 17 Jul 2023 14:19:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231828AbjGQSTl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Jul 2023 14:19:41 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5235F19AE; Mon, 17 Jul 2023 11:19:21 -0700 (PDT) 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 36HEwrGo028923; Mon, 17 Jul 2023 18:18:52 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-2023-03-30; bh=rHfjSNkVAEriO7MGs6R9fa/S3F5tV/SjhOCElVSk0lE=; b=IQTG7n9HHl1u6ukKU4P6vDxkoXA7Zu4nosuZ+DdXrhEV/NHM5luqB/ZDRXrlqU3pWrJX Wt1bv9fbYsGLR+n+iOnfH0vFpOiBfDgNBQSyZ++w/bNEuhzS3PtPbzCu0LzSEHFKKdiU n5bdAAbW91DcqVuYed4VTI7j2B2u4OGLKPoCHGSZym5cTgd73MNxcZjznn4HaaIPjRKd kl+Gvc46t1yZPgunu4XDvU+UVDat3gxtkLnitpxen3/LPIJSYKaXeQi3d2+psY9KHwZa 3mzF5gRBVgS7pzo9wFJMiPaxvCUZ5tlNny+5j6spm8kf3is/I0B1/x68yJqtFp+LqFok YQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3run88kc0n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jul 2023 18:18:52 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36HHblxq019210; Mon, 17 Jul 2023 18:18:51 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ruhw4hfjn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jul 2023 18:18:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b3fRde6YHbiLsvPqUYR50GUFqtUvurD0kiozyghfVC2eSGI4aHePYLmvStOWscIsDYXWWao2GE9jD8LGwWzUjkTDd0ebG44QWOa2g5csmRnXkshPCp2/+H+g9BYkxl0NjQw41Fk97DzkIR6kmp/EeSYQhaZ7jubzPp6dfYRMU0PZNkDaiysKfsisTK3TyCfxEBVnhaaroGLJ0oRsRNgQDzhRnuPq/mbOTiSuULMsTlu0Pnb5olZvml3d7/9EJvYWkChaT0NZQNmXOEx2FGhJwGSsDZ36CH8WSy4iZMr6QDgH97ZLbv568NAYNSmX5YH0PQ8vIHasl2c78cglZENeTQ== 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=rHfjSNkVAEriO7MGs6R9fa/S3F5tV/SjhOCElVSk0lE=; b=eHG/p5vG0wQzeDktZz+ZEdK5NSbp+c5vkMlLdK+vjiwHqeOUxloqBRMen3uZ7QXQFIexMTKIOmmyrfcVqkH+DVf4zgfn//dsD9N7LVNGYh9MwvZgdtrg5msaoMlA3aVronaDSCwyf49n1HyyU6+s6di79gzwWgxPYzfQFEc7ajNVlu08pGBZ+RuUJs2u39aIQQKYVs7L3/mGtzaVRocEwumjsGq2dbVgp1056QY3mJBsMq+W8OokWhEar3ul6BlPH9v+NWsPXi3jT8F8aHslQOBgLgrE/q53hB4AgZAtb76we+MGV1F7J2BATMcMAsJe3krxY1ltm6Vk7e705jEf6w== 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=rHfjSNkVAEriO7MGs6R9fa/S3F5tV/SjhOCElVSk0lE=; b=TTm/rV9Crcg4ljlYZ+lTSQi+WBuSM6/OKSrwZCK2//fy10aJqe5sNIh4M8xFGsQi2LOlUTeG3Mh5g2MTD2bu0rJqDdOKgoVhg+kxdgO4iUhUMll/xIG5GRGZOAaab8BJuUkwsoR+5MGLE0JHxUeav/a+L/g42NQ/BjjJwqTalF0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by IA1PR10MB7446.namprd10.prod.outlook.com (2603:10b6:208:447::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul 2023 18:18:25 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::6bff:7715:4210:1e52]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::6bff:7715:4210:1e52%7]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023 18:18:25 +0000 From: Sidhartha Kumar <sidhartha.kumar@oracle.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, Sidhartha Kumar <sidhartha.kumar@oracle.com>, stable@vger.kernel.org Subject: [PATCH] mm/memory-failure: fix hardware poison check in unpoison_memory() Date: Mon, 17 Jul 2023 11:18:12 -0700 Message-ID: <20230717181812.167757-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|IA1PR10MB7446:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f17901c-7f8f-4a54-88e4-08db86f23637 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ncO29eV0RZlirGjaIKdMHtWS4wYOrK28XB76kGEPGKgdFJ5YYFteCxPnzEyM93FyS7U6byBwLOkV+QzVsGytrcgPn0dDV6lJW7h3tI5AAslX+2nnhk/OSOY2kfkUSAfghG3L/OBSbXBTAjuHsxTswLCTTlUQ0JcW9csSL70BQMz7T/nqkIbvFtgLsnJ6csCxe76GMtnQyIbN++OpJ+EAhBgQ2EfQ20cdcXrCQAWP4SBNqAe2BVSM1wfwpe70hcVJml/LitbPK6P0AJLhsI07XG8FOAw80K09080LrwgsDZr43gTWUaoZeIjtzp8s4ruwDW0Bylv9vcv5hCqHdztDIYQqzI0WZl0y5it+r2R1JBO8LRwr1VFjTzLEonQFwGFiVutCKTKEbLNiDjhAEq8HuD4njgSdgSey0cMiyZGtLVX6SOzYIw3OVqvkzQap4N8hFGdWMQ0Sg+Ls5hMY/6b/oe1yGlFETlJc2qhR1/zFxkKKq73ICQ76HrizH8fFNo//SxWNwSp/pwnBpJpccD+q8XzdG4lgXfBbUMkX20DLs4E= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(376002)(396003)(39860400002)(346002)(451199021)(8676002)(41300700001)(66476007)(66946007)(966005)(2906002)(4744005)(66556008)(8936002)(6666004)(6486002)(6512007)(86362001)(4326008)(316002)(2616005)(36756003)(5660300002)(44832011)(38100700002)(1076003)(6506007)(83380400001)(186003)(26005)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PwE6BOpO153nZLK61WQ8GxfM4vOlzZWISpsp8vEWjVGsa37hAWY9bxF+QwH3ooJoTGv0/gT0R7uQoGtfwW4dAsZM1xgGFaFsmCHke9/bUL6nL+ZcastqPR8Li5JZ/tIDdwoncobO7eo2XIgVNN9k83JSpA8a40gjFNNZ3QhtDp8S0/ZY98+5ktVGvWIH6XpyfFKdFKlLce72MX9vz7xLBnGrz//zNm9ILmfH5NeRPmqmVPrhVLz/agVS3TEmCel+0MBJfdHdSe6x9b2/XK3a/uVv78ZLr7ycWsbbaeV62HyX3cb1JytFFSivnLfkjC8QdgdG4b+JGJ3pKwFfAatTCEh53pY509QYfmz2w2d5sx7CMCKtkzOAtXs9DtDxeC/Hwd/Krf4+8mmSuKhki7GlHLtIn1bjdJrTLWwWh9eYYBSfGVdHKwLEvWwDW9ty/bMdaqSSHMEOG642SdG5sdOkBHaz5eWqnwrdhKyWxVB+OseAJat20i4cTKcw6fIf/3kEeveW0OWkuXSalfKV/Rx7IRy6Nv2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rossTenant-Network-Message-Id: 9f17901c-7f8f-4a54-88e4-08db86f23637 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 18:18:25.4548 (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: OyOkGiBmNacoqQwEFQ3WCsBI/oLlsCw/MsC4GOTBvTsSRhQVzwKdVYg8ppYwMC/AHEe2FU3d+ar0bo2MqJkdRSQhTPN9cM1wB1tT9EGlHOE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7446 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-17_13,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 mlxscore=0 adultscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxlogscore=989 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307170167 X-Proofpoint-GUID: P67nX16UgWE2s0RlTlaYly8OddGQPhMg X-Proofpoint-ORIG-GUID: P67nX16UgWE2s0RlTlaYly8OddGQPhMg X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771693959468315493 X-GMAIL-MSGID: 1771693959468315493 |
Series |
mm/memory-failure: fix hardware poison check in unpoison_memory()
|
|
Commit Message
Sidhartha Kumar
July 17, 2023, 6:18 p.m. UTC
It was pointed out[1] that using folio_test_hwpoison() is wrong
as we need to check the indiviual page that has poison.
folio_test_hwpoison() only checks the head page so go back to using
PageHWPoison().
Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios")
Cc: stable@vger.kernel.org #v6.4
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
[1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/
---
mm/memory-failure.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, 17 Jul 2023 11:18:12 -0700 Sidhartha Kumar <sidhartha.kumar@oracle.com> wrote: > It was pointed out[1] that using folio_test_hwpoison() is wrong > as we need to check the indiviual page that has poison. > folio_test_hwpoison() only checks the head page so go back to using > PageHWPoison(). Please describe the user-visible effects of the bug, especially when proposing a -stable backport.
On 7/17/2023 11:18 AM, Sidhartha Kumar wrote: > It was pointed out[1] that using folio_test_hwpoison() is wrong > as we need to check the indiviual page that has poison. > folio_test_hwpoison() only checks the head page so go back to using > PageHWPoison(). > > Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org> > Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios") > Cc: stable@vger.kernel.org #v6.4 > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> > > [1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/ > --- > mm/memory-failure.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 02b1d8f104d51..a114c8c3039cd 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -2523,7 +2523,7 @@ int unpoison_memory(unsigned long pfn) > goto unlock_mutex; > } > > - if (!folio_test_hwpoison(folio)) { > + if (!PageHWPoison(p)) { > unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n", > pfn, &unpoison_rs); > goto unlock_mutex; Would it worth the trouble to create folio_page_test_##lname(folio, index) macros to address folio subpage? thanks! -jane
On Mon, Jul 17, 2023 at 11:18:12AM -0700, Sidhartha Kumar wrote: > It was pointed out[1] that using folio_test_hwpoison() is wrong > as we need to check the indiviual page that has poison. > folio_test_hwpoison() only checks the head page so go back to using > PageHWPoison(). > > Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org> > Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios") > Cc: stable@vger.kernel.org #v6.4 > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> > > [1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/ > --- > mm/memory-failure.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 02b1d8f104d51..a114c8c3039cd 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -2523,7 +2523,7 @@ int unpoison_memory(unsigned long pfn) > goto unlock_mutex; > } > > - if (!folio_test_hwpoison(folio)) { > + if (!PageHWPoison(p)) { I don't think this works for hwpoisoned hugetlb pages that have PageHWPoison set on the head page, rather than on the raw subpage. In the case of hwpoisoned thps, PageHWPoison is set on the raw subpage, not on the head pages. (I believe this is not detected because no one considers the scenario of unpoisoning hwpoisoned thps, which is a rare case). Perhaps the function is_page_hwpoison() would be useful for this purpose? Thanks, Naoya Horiguchi > unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n", > pfn, &unpoison_rs); > goto unlock_mutex; > -- > 2.41.0 > > >
On Tue, Jul 18, 2023 at 09:14:09AM +0900, Naoya Horiguchi wrote: > On Mon, Jul 17, 2023 at 11:18:12AM -0700, Sidhartha Kumar wrote: > > It was pointed out[1] that using folio_test_hwpoison() is wrong > > as we need to check the indiviual page that has poison. > > folio_test_hwpoison() only checks the head page so go back to using > > PageHWPoison(). > > > > Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org> > > Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios") > > Cc: stable@vger.kernel.org #v6.4 > > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> > > > > [1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/ > > --- > > mm/memory-failure.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > > index 02b1d8f104d51..a114c8c3039cd 100644 > > --- a/mm/memory-failure.c > > +++ b/mm/memory-failure.c > > @@ -2523,7 +2523,7 @@ int unpoison_memory(unsigned long pfn) > > goto unlock_mutex; > > } > > > > - if (!folio_test_hwpoison(folio)) { > > + if (!PageHWPoison(p)) { > > > I don't think this works for hwpoisoned hugetlb pages that have PageHWPoison > set on the head page, rather than on the raw subpage. In the case of > hwpoisoned thps, PageHWPoison is set on the raw subpage, not on the head > pages. (I believe this is not detected because no one considers the > scenario of unpoisoning hwpoisoned thps, which is a rare case). Perhaps the > function is_page_hwpoison() would be useful for this purpose? Sorry, I was wrong. Checking PageHWPoison() is fine because the users of unpoison should know where the PageHWPoison is set via /proc/kpageflags. So this patch is OK to me after comments from other reviewers are resolved. Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com> Thanks, Naoya Horiguchi
On 7/17/23 12:00 PM, Andrew Morton wrote: > On Mon, 17 Jul 2023 11:18:12 -0700 Sidhartha Kumar <sidhartha.kumar@oracle.com> wrote: > >> It was pointed out[1] that using folio_test_hwpoison() is wrong >> as we need to check the indiviual page that has poison. >> folio_test_hwpoison() only checks the head page so go back to using >> PageHWPoison(). > > Please describe the user-visible effects of the bug, especially > when proposing a -stable backport. User-visible effects include existing hwpoison-inject tests possibly failing as unpoisoning a single subpage could lead to unpoisoning an entire folio. Memory unpoisoning could also not work as expected as the function will break early due to only checking the head page and not the actually poisoned subpage.
On 7/17/23 5:39 PM, Naoya Horiguchi wrote: > On Tue, Jul 18, 2023 at 09:14:09AM +0900, Naoya Horiguchi wrote: >> On Mon, Jul 17, 2023 at 11:18:12AM -0700, Sidhartha Kumar wrote: >>> It was pointed out[1] that using folio_test_hwpoison() is wrong >>> as we need to check the indiviual page that has poison. >>> folio_test_hwpoison() only checks the head page so go back to using >>> PageHWPoison(). >>> >>> Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org> >>> Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios") >>> Cc: stable@vger.kernel.org #v6.4 >>> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> >>> >>> [1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/ >>> --- >>> mm/memory-failure.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/mm/memory-failure.c b/mm/memory-failure.c >>> index 02b1d8f104d51..a114c8c3039cd 100644 >>> --- a/mm/memory-failure.c >>> +++ b/mm/memory-failure.c >>> @@ -2523,7 +2523,7 @@ int unpoison_memory(unsigned long pfn) >>> goto unlock_mutex; >>> } >>> >>> - if (!folio_test_hwpoison(folio)) { >>> + if (!PageHWPoison(p)) { >> >> >> I don't think this works for hwpoisoned hugetlb pages that have PageHWPoison >> set on the head page, rather than on the raw subpage. In the case of >> hwpoisoned thps, PageHWPoison is set on the raw subpage, not on the head >> pages. (I believe this is not detected because no one considers the >> scenario of unpoisoning hwpoisoned thps, which is a rare case). Perhaps the >> function is_page_hwpoison() would be useful for this purpose? > > Sorry, I was wrong. Checking PageHWPoison() is fine because the users of > unpoison should know where the PageHWPoison is set via /proc/kpageflags. > So this patch is OK to me after comments from other reviewers are resolved. > Hi Naoya, While taking a closer at the patch, later in unpoison_memory() there is also: - ret = TestClearPageHWPoison(page) ? 0 : -EBUSY; + ret = folio_test_clear_hwpoison(folio) ? 0 : -EBUSY; I thought this folio conversion would be safe because page is the result of a compound_head() call but I'm wondering if the same issue exists here and we should be calling TestClearPageHWPoison() on the specific subpage by doing TestClearPageHWPoison(p). Thanks, Sidhartha Kumar > Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com> > > Thanks, > Naoya Horiguchi >
On Tue, Jul 18, 2023 at 07:30:23AM -0700, Sidhartha Kumar wrote: > On 7/17/23 5:39 PM, Naoya Horiguchi wrote: > > On Tue, Jul 18, 2023 at 09:14:09AM +0900, Naoya Horiguchi wrote: > > > On Mon, Jul 17, 2023 at 11:18:12AM -0700, Sidhartha Kumar wrote: > > > > It was pointed out[1] that using folio_test_hwpoison() is wrong > > > > as we need to check the indiviual page that has poison. > > > > folio_test_hwpoison() only checks the head page so go back to using > > > > PageHWPoison(). > > > > > > > > Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org> > > > > Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios") > > > > Cc: stable@vger.kernel.org #v6.4 > > > > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> > > > > > > > > [1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/ > > > > --- > > > > mm/memory-failure.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > > > > index 02b1d8f104d51..a114c8c3039cd 100644 > > > > --- a/mm/memory-failure.c > > > > +++ b/mm/memory-failure.c > > > > @@ -2523,7 +2523,7 @@ int unpoison_memory(unsigned long pfn) > > > > goto unlock_mutex; > > > > } > > > > - if (!folio_test_hwpoison(folio)) { > > > > + if (!PageHWPoison(p)) { > > > > > > > > > I don't think this works for hwpoisoned hugetlb pages that have PageHWPoison > > > set on the head page, rather than on the raw subpage. In the case of > > > hwpoisoned thps, PageHWPoison is set on the raw subpage, not on the head > > > pages. (I believe this is not detected because no one considers the > > > scenario of unpoisoning hwpoisoned thps, which is a rare case). Perhaps the > > > function is_page_hwpoison() would be useful for this purpose? > > > > Sorry, I was wrong. Checking PageHWPoison() is fine because the users of > > unpoison should know where the PageHWPoison is set via /proc/kpageflags. > > So this patch is OK to me after comments from other reviewers are resolved. > > > > Hi Naoya, > > While taking a closer at the patch, later in unpoison_memory() there is > also: > > - ret = TestClearPageHWPoison(page) ? 0 : -EBUSY; > + ret = folio_test_clear_hwpoison(folio) ? 0 : -EBUSY; > > I thought this folio conversion would be safe because page is the result of > a compound_head() call but I'm wondering if the same issue exists here and > we should be calling TestClearPageHWPoison() on the specific subpage by > doing TestClearPageHWPoison(p). In this case (get_hwpoison_page returns 0), the target of unpoison_memory was buddy page or free huge page, so there seems not any realistic problem. But putting back to TestClearPageHWPoison() looks consistent, so I'm fine with it. Thanks, Naoya Horiguchi
On 2023/7/18 2:18, Sidhartha Kumar wrote: > It was pointed out[1] that using folio_test_hwpoison() is wrong > as we need to check the indiviual page that has poison. > folio_test_hwpoison() only checks the head page so go back to using > PageHWPoison(). > > Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org> > Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios") > Cc: stable@vger.kernel.org #v6.4 > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> > > [1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/ > --- > mm/memory-failure.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 02b1d8f104d51..a114c8c3039cd 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -2523,7 +2523,7 @@ int unpoison_memory(unsigned long pfn) > goto unlock_mutex; > } > > - if (!folio_test_hwpoison(folio)) { > + if (!PageHWPoison(p)) { For successfully handled pages, they should be non-compound pages (dissolved, splitted or normal pages). So this patch makes no change for them. But for failed to hwpoisoned thp and hugetlb, there's some difference. But since Naoya points out that, "the users of unpoison should know where the PageHWPoison is set via /proc/kpageflags.", I'm fine with this patch. Reviewed-by: Miaohe Lin <linmiaohe@huawei.com> Thanks.
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 02b1d8f104d51..a114c8c3039cd 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2523,7 +2523,7 @@ int unpoison_memory(unsigned long pfn) goto unlock_mutex; } - if (!folio_test_hwpoison(folio)) { + if (!PageHWPoison(p)) { unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n", pfn, &unpoison_rs); goto unlock_mutex;