Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6803412rwr; Tue, 25 Apr 2023 04:10:27 -0700 (PDT) X-Google-Smtp-Source: AKy350aE3/iUcaKJ+bOCA4sninQz+lvXnPVZFsOAiZd63d4vQ559mO0yPayi2uemDjzQ7Qy23s9n X-Received: by 2002:a17:90a:ad82:b0:247:5bb4:f445 with SMTP id s2-20020a17090aad8200b002475bb4f445mr17731411pjq.29.1682421026938; Tue, 25 Apr 2023 04:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682421026; cv=none; d=google.com; s=arc-20160816; b=UfKcsr5xYgVVNJvk2MeKS5JdVVCcPuvy6XFMFuDtXphADvFpfBZsc8QPANlQu2GZZN xRN5fFU+5TzlCMI0K+0z0MsTDYege20zy+Kv3SP7ZBU5y9FWgQd2RvfuT4Dfk/RRHDip cbCjJ4Myvmalu4Qdv7+L4ValyAyRECB9hUi2Z1o/KeRJAY3RX2GGs1H1e0eshO81EMas MUYR4/YAEw8vw+Px3RmPEoBIPR5+06g9oLnbWCxC5ip312pcOyXw9W7OtZnAN0VBiO4i RXG71c1jKo5uxTTqNp+ovBfUHKPU0JRSxoTBU+VUN7xjMO7iyF7auuDb+htAnDpfiIL8 BJKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:in-reply-to:mime-version :message-id:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=Gc4jFl8KquubYFrW8xZv5Gqj3fqTntNDZhVWlXh2E4U=; b=Rin6JJLSiR6HgvfwcqX/VMCZlOLCvYyXDV9SiW+WE7gGVFgv40CnJDN0Iq1bkjLSyb rxgggB3N0fibxN1L5jP8ZpPZUopSRHFQdyIjuvPxZQzGIwP8uvd81aOXw84K780cgw5A OS8NEKw/fitHqjY/N1LFeyOCEuQlFkuaKvoldcPMNEOQniRPEEUjzWpNUeYjj4eAxeyN N9aFP3VYjDtRQXuoEcY6fezgs7XaiiEocY1P3alsMnU7ZMMl2+Z5NfpjTFJ+OUplyC0x NGrriahwkiXpPwwTEAdLxbMnAaU7VtOZ98eN/05+JGbk6vGuXBCcGQMcMa6tir28WY1O OJdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ZpSJzBmg; 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=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk1-20020a17090b4a0100b002477dac5834si14406220pjb.95.2023.04.25.04.10.15; Tue, 25 Apr 2023 04:10:26 -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=@samsung.com header.s=mail20170921 header.b=ZpSJzBmg; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233863AbjDYLJv (ORCPT + 99 others); Tue, 25 Apr 2023 07:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233676AbjDYLJp (ORCPT ); Tue, 25 Apr 2023 07:09:45 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F3A1713 for ; Tue, 25 Apr 2023 04:09:25 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230425110914euoutp010fd8b5e1b0cdc70049c23a540f53499a~ZKPGoX2952946329463euoutp01P for ; Tue, 25 Apr 2023 11:09:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230425110914euoutp010fd8b5e1b0cdc70049c23a540f53499a~ZKPGoX2952946329463euoutp01P 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> 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+uYbR4vITPos9iyYxWTz91MdiMenQNUaLM925FntvaVvs2XuSxeLyrjlsFvfW/Ge1uDHh KVD5iUuMFr9/AMW274p0EPCY3XCRxWPBplKPzSu0PDat6mTz2PRpErvHiRm/WTxebJ7J6DF1 dr3H5tPVHp83yQVwRXHZpKTmZJalFunbJXBl/LhxhbngMG/F+iutbA2M07m7GDk4JARMJKas l+5i5OIQEljBKLHvxHs2COcLo8SrO/9Zuhg5gZzPjBJ778WC2CANp1Z9Y4EoWs4ocWTLT0YI B6jozPSbUO1bGCX+/v3GC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dr3H5tPVHp83yQVwRenZFOWXlqQqZOQXl9gqRRtaGOkZWlroGZlY6hkam8daGZkq6dvZpKTm ZJalFunbJehlzJ4uWNDMXfHo8FnGBsYPHF2MnBwSAiYSp1Z9Y+li5OIQEljKKHFz/2RGiISM xMYvV1khbGGJP9e62CCKPjJKfN/2gx3C2cIocWDTFLAOFgFVib4NfUAdHBxsAloSjZ3sIKaI gIbEmy1GIOXMAjeZJS7ensgMUi4s4CTxe34DE4jNK2Au8fD2aSaImRMZJb7134NKCEqcnPmE BcRmFtCRWLD7ExvIUGYBaYnl/8A+4AT64M3KDVBHK0k0bD7DAmHXSnS+Os02gVF4FpJJs5BM moUwaQEj8ypGkdTS4tz03GJDveLE3OLSvHS95PzcTYzAaN927OfmHYzzXn3UO8TIxMF4iFGC g1lJhJe30j1FiDclsbIqtSg/vqg0J7X4EKMpMCQmMkuJJucD001eSbyhmYGpoYmZpYGppZmx kjivZ0FHopBAemJJanZqakFqEUwfEwenVAPTzoR9s8tC7lw6lCf9LeB75a7fOgn/fGfWSSye 7H/ovKLE3nNn+zuXXe9qa5R6qMJxVER3Xf6R1as/rP2zI3JXwpLLN/07w2YcO66fVhVg7is7 52dP4/yCG1qTGH3/1KVYyz7xOryn46nV0q5Zk5gu6+1JnxOs7rCri/H620VaXd7J9xbNSAxM 3ddWENPxOEpYV3R3J8/PQnstg+fS6cXiE+uyGh9Pb315ifVCoTvnn121bx/VKVy/+uVF0Puc x8el7k9+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> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 ------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_--