From patchwork Thu Jan 11 19:16:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13517732 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F993C4707B for ; Thu, 11 Jan 2024 19:18:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB75E6B008A; Thu, 11 Jan 2024 14:18:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A67576B0098; Thu, 11 Jan 2024 14:18:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 892C86B00A3; Thu, 11 Jan 2024 14:18:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7973D6B008A for ; Thu, 11 Jan 2024 14:18:39 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 54F4D1404C6 for ; Thu, 11 Jan 2024 19:18:39 +0000 (UTC) X-FDA: 81667991958.29.6B2DB49 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf20.hostedemail.com (Postfix) with ESMTP id 2F69D1C0007 for ; Thu, 11 Jan 2024 19:18:35 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=njpr5ebp; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TVLeoSM6; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf20.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705000715; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=L7OOCpTqUrsgINsrHoYRgEKhdwl58ZvICOwiKS3486A=; b=iRisTFqbTEfqkKBAt8+10kuM5RZQ/J0d44hUadnzsfmQZGaPN3YG+qdc4txBxI/yB/FfjH qn9zgGjKy5+uHYouEqpL6GcXGyDS/fhPOEHkMFNmBWvE6eIG/iH7NuQ4A1hkXU3XuJJiT4 rRPZZqkqsuEIN0706FJAt32mif4Pafs= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=njpr5ebp; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TVLeoSM6; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf20.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1705000715; a=rsa-sha256; cv=pass; b=AxKQnBsOKpn/vSpK5iioM8io7KN/tVP9Z7PJ5hSzGBWXXWCNEPKme47LAoO8tom/R8Mt1J VjD5F9xMLxhSwOUmuxqaHU0uEtqdd84MZkGaxk/4HAhGJrDrRoT0oW9HwgGvLL2Lly97it hZ2PiF/slNU0ae1ycGOGwc6AIbBpyCY= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40BI0pEx015492; Thu, 11 Jan 2024 19:18:21 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-11-20; bh=L7OOCpTqUrsgINsrHoYRgEKhdwl58ZvICOwiKS3486A=; b=njpr5ebpL5PkM4Bjd8GkQAbaKFAOjmb/hgbWnZXFPL4Z8r5J6BTzDx8xRSHuC3xK1bEX gSfZtf8ERbdYsgBlsQ2DPmiM5uLGNnjK1/0i2+9zAM5vLj0GzPHup8HZ0GL5cj5yVZzk xQ2aduCYDAGps7ZOCZs3B4BCy13HfkPlAODS+OgyGeKGVP+pLRx0oGJLwwbnKucWdcC3 MaTn4ybH/HOXGgHqrIyC+5sMPlglmQfhIjHCWfOPRnEW/cHWUxG+4GUWA0410dtl4BNE WPpuw+WqEzrf87j3F0rmeP2rcgNe4YtUgKJrCbeH7yZ+WPl+LpYp7XGYmkKsb/te6Tds +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 3vjmnerb95-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Jan 2024 19:18:21 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 40BIVob2030295; Thu, 11 Jan 2024 19:18:20 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3vfutqmsp3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Jan 2024 19:18:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lLERjxgwPdnyUQ4sH7/pP5YRMzcEgNA6/i4D4m6I39XYDB6r1dMviZV8eKJ2zZ7/NSaucqNl/6xnrctKm2JJDVJR74d6rGqeBZXInyn7aeAoZdgwNgozGUuWhS03IrJx1wecq6wwOKT7xpNV3ZMUUeQGJ8vWC3GzNpInHqm9lY6NzDyHsTaj/b8FIOh6A7qHXSLM4SNDiDnr1tBTD2O6Fkj4P1IQRKNZ/XCX8nRipaTwS+yyypWBvMdIQFglZ6eDntAge+EmiZIdkRSc+tdIR+5Qy7euB2TiD0RPf9rqchpWS7o+lqnpFwYXCi4vrerRl1tlKRobWV2k/IgYH5cr2w== 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=L7OOCpTqUrsgINsrHoYRgEKhdwl58ZvICOwiKS3486A=; b=YVo08NoDYvv7cS+fjyvyUAqXhtsNFxojpSYB0bI6UP3DT1dna89//d3DjVLaUOvj1L2KOCBEGkdUv5XtedwnHpvgW+jvHPMJz55d9bDia5E54OBUzRzEKqfCNaPppHWt+zicyXtoSuJQM5dtqp0JsTlJkAeuDES0kD4IeKaAhrE4Uc3AxsUqEYq518Vol2BYD03CfQPHXb3cL3X9E9WjYZoY2F+WyikQauy6/xjKrzmop9eNWY+QLninT7+HShdXOo0ih2TWCsKEaAybpDg4V+VppmMVX5QgAW06FRQIQWK+UGrYFQsXlrSMVGzw6Gunt1uAQUc99V25I15WLIjBhA== 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=L7OOCpTqUrsgINsrHoYRgEKhdwl58ZvICOwiKS3486A=; b=TVLeoSM6ZbK2Uxpc38Bwx5DDlREzNsE+X7qHCGMIIjet5HnijF7J8W2cZDlmY4UO3/GNCnaf1fM8RhF5DHn6U2/IAINoeafcJNJK8OSlurMkVK9RFn+CO8/hkJRU3XdtG7m+a7U/A4gjV0H+/FoJj39ipmufTn/EpmJb8PsdIIk= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BLAPR10MB5076.namprd10.prod.outlook.com (2603:10b6:208:30f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.19; Thu, 11 Jan 2024 19:18:14 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::78b9:5082:241a:d1fb]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::78b9:5082:241a:d1fb%3]) with mapi id 15.20.7181.020; Thu, 11 Jan 2024 19:18:13 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, usama.anjum@collabora.com, muchun.song@linux.dev, jiaqiyan@google.com, willy@infradead.org, linmiaohe@huawei.com, naoya.horiguchi@nec.com, shy828301@gmail.com, jthoughton@google.com, jane.chu@oracle.com, Sidhartha Kumar , stable@vger.kernel.org Subject: [PATCH] fix hugetlbfs hwpoison handling Date: Thu, 11 Jan 2024 11:16:55 -0800 Message-ID: <20240111191655.295530-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: SJ0PR05CA0146.namprd05.prod.outlook.com (2603:10b6:a03:33d::31) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|BLAPR10MB5076:EE_ X-MS-Office365-Filtering-Correlation-Id: aa9e5565-3bee-4642-ddc1-08dc12da031d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kGme4RSNlUQu3ejR6mMxP4Xf4o990fxrrBIAdmkuoR6qwl4MHmp20KWeecGZ9FFgVWReXeuuESx1+MM/JVfi/D60g7TyLUp0ze2xsurAeyVYOdEN9sJGtoHp05QbPeemDz76DxrmNzV2klv9PHxpKThZVUPQKJoWRKp9eo3X5bj2rDIAaJsGmARXtv1oyaJiQAghVT77+IcAk+8ewWzRl6nXplWbkB+oL9473wslN+OR2Lob7dfJjLj1K3plswEWn+LCXInY8hJTDz0rS4tz4wWGk0WnQjB2d17Fvmib8/wG06Af0hXziJL/o+KIg/wn1oRDlRlNKFbvfaAasKcwuDMwlTvekjmYXi7zZzJg7NfdqGoYH6NCRfaH0fi/oDQDb6oIM/es1liivD66vZLR/ydCWYrS+joG+4FFTt+fFlkDS3MwyawGj956GXhVX61qMisOLhXK8EhEQ9f3S8qtNGBGWCgAGEpa/7zW9yzKVAleuDuF8ZbYTQzkri4YeEYHWSdNSyMSIHR9OJTCtxCT1piApyJyrbrPcL9rjMdcbaY= 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:(13230031)(136003)(376002)(39860400002)(366004)(396003)(346002)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(41300700001)(83380400001)(86362001)(2616005)(6506007)(6666004)(966005)(478600001)(1076003)(6486002)(6512007)(4326008)(38100700002)(36756003)(44832011)(66556008)(66476007)(66946007)(8936002)(8676002)(316002)(2906002)(7416002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: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H4fHmQRPRqP6PnWFL/3kdD/5NDARHsAFM9S71hwM/+UCo178edZ+ietdjrLtc5PE+RpuSgiZNRYtW32ovYITja4VKVdGLybdISF6PmAEMNkrfEzgyIVptVIh4OylxTuxh9Ihxz71R/sWjfNu1DdD/aev15Ge2GySV4dZa/vpLKeYEhiHvT8gjhBrl42Pkxt9ecQy1Xg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa9e5565-3bee-4642-ddc1-08dc12da031d X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2024 19:17:54.5767 (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: npAPbt4LlcxYhTxMM3XJmrZDylRzi1wz92xHdO8iRkZfr1c8irpD38easQfgSqjiWGVPq3dUPeU6dAXrTXhfBtEKlwlrQqhR38j5nDlnMeA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB5076 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-11_11,2024-01-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401110151 X-Proofpoint-GUID: KB6mb_EAjapkjNzdx06z8o26PF3bXqkg X-Proofpoint-ORIG-GUID: KB6mb_EAjapkjNzdx06z8o26PF3bXqkg X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 2F69D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K9abGgpXglzPUj1smCLt9PZICE0c6X1l0mxtEhxhG5DLTvzoTH0Z7294pya+ca97Myts94kHOKZI+PkH8OPzZ4v+3cilLnSA5sZCBU7kiXr8ciPTKTL18uyGd4gvIp0VO8pkxb3kny180A/35lYcWTvvACVku+FmFF1sZrX4+ah24O/YXC7Cmpp9/EZwPjVwOE84+i5uVTFJ12IqMTBCDBLqYspdB4ln3bNUYucGyA46UxeZDolomjfMTwjBqUnHztzWqmT/apnYvf3IYYTpG+2i/YSwvSRcDOM5LMDc+gkhP+KmBGz9NKpiesuSZ96LD9cD37nJKzl1xqVpGWtojCOfBz1r69flqeL9ggxJQXu/5lko+XDNH+A0IrpCfltFdCm+/CJqRLI+n+BdYo5Ac1+qruS4OcdBk7gMHH6v/53EdbEAw/LXzHTVE4zfaJBx9XTUtz6A45DEkLYynANCYTxcEznON9rL8kf9vNEkP1+XcCxfimFqY1CcHoBSIVe4xI918aa2kK4i1+qJ6KZYiEkPuI3Xtk80JWtqloJvscQwx/dnEjRM/NsbX9aucfa0Uu/FdU9DLNCvRiShRxA6DCQ9gSRxHEqe X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: has_extra_refcount() makes the assumption that a ref count of 1 means the page is not referenced by other users. Commit a08c7193e4f1 (mm/filemap: remove hugetlb special casing in filemap.c) modifies __filemap_add_folio() by calling folio_ref_add(folio, nr); for all cases (including hugtetlb) where nr is the number of pages in the folio. We should check if the page is not referenced by other users by checking the page count against the number of pages rather than 1. In hugetlbfs_read_iter(), folio_test_has_hwpoisoned() is testing the wrong flag as, in the hugetlb case, memory-failure code calls folio_test_set_hwpoison() to indicate poison. folio_test_hwpoison() is the correct function to test for that flag. After these fixes, the hugetlb hwpoison read selftest passes all cases. Fixes: a08c7193e4f1 ("mm/filemap: remove hugetlb special casing in filemap.c") Closes: https://lore.kernel.org/linux-mm/20230713001833.3778937-1-jiaqiyan@google.com/T/#m8e1469119e5b831bbd05d495f96b842e4a1c5519 Cc: # 6.7+ Signed-off-by: Sidhartha Kumar Reported-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum --- fs/hugetlbfs/inode.c | 2 +- mm/memory-failure.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 36132c9125f9..3a248e4f7e93 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -340,7 +340,7 @@ static ssize_t hugetlbfs_read_iter(struct kiocb *iocb, struct iov_iter *to) } else { folio_unlock(folio); - if (!folio_test_has_hwpoisoned(folio)) + if (!folio_test_hwpoison(folio)) want = nr; else { /* diff --git a/mm/memory-failure.c b/mm/memory-failure.c index d8c853b35dbb..87f6bf7d8bc1 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -973,7 +973,7 @@ struct page_state { static bool has_extra_refcount(struct page_state *ps, struct page *p, bool extra_pins) { - int count = page_count(p) - 1; + int count = page_count(p) - folio_nr_pages(page_folio(p)); if (extra_pins) count -= 1;