From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 142DDC35FFA for ; Wed, 19 Mar 2025 18:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:References:Content-Type: Content-Transfer-Encoding:In-Reply-To:From:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=r+OZ0dZjRdagPeJioXzbnIj1AKfJy9OpWi/BR3HcRpc=; b=W00ua5mqqSg5YK762DKYIQC+Wz xkAstX7w5Csh8OnGA94NtEAhvCb+WldFBuKXg0IJQcTpSiEoeHzHGuXaHtwV7DcxOCaL/IsK1nfi4 o2Zs5vhWjK055//j4j5loNEg3foDYEBthJfk2nZI0ewZ2G+9KJbBh/ZuGIewo0SlUJ4d+0+sI2hkS O/AIa/6Js0ZJqTLpsbe15AMFWSL8PIO3z6xerIisomL/Gwyq9btdcRGhTGK1EJ7zAgX8DRmbBAPCN ZciqXyEARvPkeQUzShhkWzC9LP2WQmFxrjpublviOtS7mmL02R/A1/UCT1fzyyvvNyg1JwQNqfp+T GUecXnRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tuxpI-00000009nlh-3iaN; Wed, 19 Mar 2025 18:07:36 +0000 Received: from [203.254.224.33] (helo=mailout3.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tuxoL-00000009nab-1fuu for linux-nvme@lists.infradead.org; Wed, 19 Mar 2025 18:06:40 +0000 Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20250319180633epoutp03bacb7596c7c8e8a0303f5c464715f990~uRnmYQ4dk1459014590epoutp03Y for ; Wed, 19 Mar 2025 18:06:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20250319180633epoutp03bacb7596c7c8e8a0303f5c464715f990~uRnmYQ4dk1459014590epoutp03Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1742407593; bh=r+OZ0dZjRdagPeJioXzbnIj1AKfJy9OpWi/BR3HcRpc=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=cp6G1JXW2TPfq9kLMUYadZsNun55gCCLBh3fmFI3NIymu410SIGfNoq/aJp8cC/AL FBYjj1pX8QPjTksSkDuu9sEuuE+h0ysFTT4uPLnd4DqSfX3MbwczWk747qY5XHszDZ oapQusRRPXvXVd6YkfpJs5SJrO7qiqYfw/2/ss3o= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20250319180633epcas5p37fdb720f28677dc579821d1b4f820966~uRnmEC2MM1969719697epcas5p32; Wed, 19 Mar 2025 18:06:33 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.178]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4ZHxVH4ZWnz4x9Pv; Wed, 19 Mar 2025 18:06:31 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 50.5D.19956.7A70BD76; Thu, 20 Mar 2025 03:06:31 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20250319180631epcas5p47dbbc86eb8982b6cb230ab33dfd43aa0~uRnj33X9u1744817448epcas5p4N; Wed, 19 Mar 2025 18:06:31 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20250319180631epsmtrp176ea9c1c70e9a2b5756a793717c5e402~uRnj3F3l21334513345epsmtrp1G; Wed, 19 Mar 2025 18:06:31 +0000 (GMT) X-AuditID: b6c32a4b-fe9f470000004df4-d5-67db07a78a2b Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 4F.EC.18729.6A70BD76; Thu, 20 Mar 2025 03:06:31 +0900 (KST) Received: from [107.122.11.51] (unknown [107.122.11.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20250319180629epsmtip27f2b0f464fbd09d8727b5ef0ca773742~uRniVqTrs2457824578epsmtip25; Wed, 19 Mar 2025 18:06:29 +0000 (GMT) Message-ID: <435cf6be-98e7-4b8b-ae42-e074091de991@samsung.com> Date: Wed, 19 Mar 2025 23:36:28 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [LSF/MM/BPF TOPIC] File system checksum offload To: "hch@infradead.org" Cc: Qu Wenruo , Johannes Thumshirn , Theodore Ts'o , "lsf-pc@lists.linux-foundation.org" , "linux-btrfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-block@vger.kernel.org" , "josef@toxicpanda.com" Content-Language: en-US From: Kanchan Joshi In-Reply-To: Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCJsWRmVeSWpSXmKPExsWy7bCmhu5y9tvpBn9uy1qcnrCIyeJv1z0m iz8PDS323tK2uPR4BbvFnr0nWSzmL3vKbrHv9V5mi9aen+wWa9Z9ZHfg8ti8Qstj85J6j8k3 ljN6NJ05yuyxfstVFo8JmzeyenzeJO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ovflbn/ubaph504hxJLcUaioRZzUXEiAOXN lTYkAwAA X-CMS-MailID: 20250319180631epcas5p47dbbc86eb8982b6cb230ab33dfd43aa0 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250318080742epcas5p31b31b3024d6f7d9d150c8a7c2db4dffd References: <20250130091545.66573-1-joshi.k@samsung.com> <20250130142857.GB401886@mit.edu> <97f402bc-4029-48d4-bd03-80af5b799d04@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250319_110638_877578_FD638FA3 X-CRM114-Status: GOOD ( 19.44 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On 3/18/2025 1:37 PM, hch@infradead.org wrote: > On Tue, Mar 18, 2025 at 12:36:44PM +0530, Kanchan Joshi wrote: >> Right, I'm not saying that protection is getting better. Just that any >> offload is about trusting someone else with the job. We have other >> instances like atomic-writes, copy, write-zeroes, write-same etc. > > So wahst is the use case for it? I tried to describe that in the cover letter of the PoC: https://lore.kernel.org/linux-btrfs/20250129140207.22718-1-joshi.k@samsung.com/ What is the "thread" model you are > trying to protect against (where thread here is borrowed from the > security world and implies data corruption caught by checksums). Seems you meant threat model. That was not on my mind for this series, but sure, we don't boost integrity with offload. >> >>> IFF using PRACT is an acceptable level of protection just running >>> NODATASUM and disabling PI generation/verification in the block >>> layer using the current sysfs attributes (or an in-kernel interface >>> for that) to force the driver to set PRACT will do exactly the same >>> thing. >> >> I had considered but that can't work because: >> >> - the sysfs attributes operate at block-device level for all read or all >> write operations. That's not flexible for policies such "do something >> for some writes/reads but not for others" which can translate to "do >> checksum offload for FS data, but keep things as is for FS meta" or >> other combinations. > > Well, we can easily do the using a per-I/O flag Right, a per-I/O flag (named REQ_INTEGRITY_OFFLOAD) is what I did in the patch: https://lore.kernel.org/linux-btrfs/20250129140207.22718-2-joshi.k@samsung.com/