From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40C087B for ; Tue, 25 Apr 2023 11:09:22 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230425110914euoutp01a1c023e5e94f203189b0096c55669ba6~ZKPGinUBb2902429024euoutp01b for ; Tue, 25 Apr 2023 11:09:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230425110914euoutp01a1c023e5e94f203189b0096c55669ba6~ZKPGinUBb2902429024euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1682420954; bh=Gc4jFl8KquubYFrW8xZv5Gqj3fqTntNDZhVWlXh2E4U=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=ZpSJzBmgfMItZFL1GydmZGuV7A9DANq+FLr4aQyVdi24VNkp/SuxI81tY4tcnNRaV 3TrgU08eOtDduHCeRgPsbbuWnbT/tHv4qBl75aPD8lMuKfp3gUQQybyMeeCLzIy3wC b/oxmLOkUJ6jVhljx5E7e8dQa4fwLiz5ctZJI/P0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230425110913eucas1p16ebb723297aa94d2766c734d83183e6b~ZKPGNItUH1270512705eucas1p1e; Tue, 25 Apr 2023 11:09:13 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 6E.2B.42423.9D4B7446; Tue, 25 Apr 2023 12:09:13 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230425110913eucas1p22cf9d4c7401881999adb12134b985273~ZKPFz5aeZ0812808128eucas1p2k; Tue, 25 Apr 2023 11:09:13 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230425110913eusmtrp2c46b12ef17d135e5deccacac75179df6~ZKPFzHa7Q1014910149eusmtrp2o; Tue, 25 Apr 2023 11:09:13 +0000 (GMT) X-AuditID: cbfec7f2-25927a800002a5b7-37-6447b4d905ba Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2C.57.10549.9D4B7446; Tue, 25 Apr 2023 12:09:13 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230425110913eusmtip20311b17f49b03fde53a0b57a9dc3c58f~ZKPFnrhol0897708977eusmtip2H; Tue, 25 Apr 2023 11:09:13 +0000 (GMT) Received: from localhost (106.110.32.140) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 25 Apr 2023 12:09:12 +0100 Date: Tue, 25 Apr 2023 13:00:25 +0200 From: Pankaj Raghav To: Matthew Wilcox CC: Luis Chamberlain , , , , , , , , , , , , , , , , , Subject: Re: [RFC 2/8] shmem: convert to use folio_test_hwpoison() Message-ID: <20230425110025.7tq5vdr2jfom2zdh@localhost> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [106.110.32.140] X-ClientProxiedBy: CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMKsWRmVeSWpSXmKPExsWy7djPc7o3t7inGDyfrW4xZ/0aNovXhz8x Wqy+uYbR4vIT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el7k9+ma21/Wnhpcs/P4QLV5/4s0XUfaLbTPPtlr+rvu/cUOFnwcJn9bNVf4Z1ZlyRxxw2 Qesvm3UN1F6/VHSR7dmfFdrX82umSqrQd8kUJZbijERDLeai4kQAA3U0pX8DAAA= X-CMS-MailID: 20230425110913eucas1p22cf9d4c7401881999adb12134b985273 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----t5a.LUSxvZ8UNChTG7xN-7.3lkNPyOm_Ty_DrQaWPiPzU4rz=_ea8fb_" X-RootMTR: 20230425110913eucas1p22cf9d4c7401881999adb12134b985273 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230425110913eucas1p22cf9d4c7401881999adb12134b985273 References: <20230421214400.2836131-1-mcgrof@kernel.org> <20230421214400.2836131-3-mcgrof@kernel.org> ------t5a.LUSxvZ8UNChTG7xN-7.3lkNPyOm_Ty_DrQaWPiPzU4rz=_ea8fb_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Fri, Apr 21, 2023 at 11:42:53PM +0100, Matthew Wilcox wrote: > On Fri, Apr 21, 2023 at 02:43:54PM -0700, Luis Chamberlain wrote: > > The PageHWPoison() call can be converted over to the respective folio call > > folio_test_hwpoison(). This introduces no functional changes. > > Um, no. Nobody should use folio_test_hwpoison(), it's a nonsense. > > Individual pages are hwpoisoned. You're only testing the head page > if you use folio_test_hwpoison(). There's folio_has_hwpoisoned() to > test if _any_ page in the folio is poisoned. But blindly converting > PageHWPoison to folio_test_hwpoison() is wrong. I see a pattern in shmem.c where first the head is tested and for large folios, any of pages in the folio is tested for poison flag. Should we factor it out as a helper in shmem.c and use it here? static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos, ... if (folio_test_hwpoison(folio) || (folio_test_large(folio) && folio_test_has_hwpoisoned(folio))) { .. > > If anyone knows how to poison folio_test_hwpoison() to make it not > work, I'd appreciate it. IMO, I think it will be clear if folio_test_hwpoison checks if any of the page in the folio is poisoned and we should have a explicit helper such as folio_test_head_hwpoison if the callers want to only test if the head page is poisoned (although I am not sure if that is useful). ------t5a.LUSxvZ8UNChTG7xN-7.3lkNPyOm_Ty_DrQaWPiPzU4rz=_ea8fb_ Content-Type: text/plain; charset="utf-8" ------t5a.LUSxvZ8UNChTG7xN-7.3lkNPyOm_Ty_DrQaWPiPzU4rz=_ea8fb_--