Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp796848rwl; Wed, 29 Mar 2023 08:34:56 -0700 (PDT) X-Google-Smtp-Source: AKy350bcVT5tlKxkVNk4qXkU/QiD32k3jRbVSL+Ruuh+XdQRH3yAPn2+HZSnAID/VYV7VxQhtPyw X-Received: by 2002:aa7:d44c:0:b0:502:52dc:b9d0 with SMTP id q12-20020aa7d44c000000b0050252dcb9d0mr5409128edr.26.1680104096562; Wed, 29 Mar 2023 08:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680104096; cv=none; d=google.com; s=arc-20160816; b=dBI/Ka7e/aCYmBKr5Iu5QFMwPxReTfBKSlDt++qq4dbhZ8hjyMBhdXA827/2jgDHAv GMP66PVA73urZGglCU3kouno3h55I5DHSUQj19GFGN3vBS0t5bFfqv/H8pqAZcFNCkwj aWMcJAO2lUUSz34IXleQzQjpkbfHmtNoIb8XAi0O6LYeXRLRxr07eTS78LXWstKuL91s B+99apiCohi7g5rHvZYyJJGet4ETNJilaJJkG9k4C9KEpQbUGDf3gzy4queiuZ23ejQw I7IV5p8K8XnWwq6JlF3quJ9aqK8KBWRDjOMFyShVNUpF1Onu4enGZ3FYvixAbL7yF2yp leUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:user-agent :in-reply-to:mime-version:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=bctyMVUmY0qhLzKm25OFhS4f4wHOWRg4Noj6rlrn2TI=; b=S6wf+yNdBXbGFcxE39Usoh0CleemxdaQieFVZcTGa+nN9YtstAG7oFZFmDAkNhm3Bm McM5P9p89EdT5T+bB0f/0CGBLy812oqJ2FuRNguawur2pwgkauRBnR96j2xV9s/sksLy rSu823Q64natmJaiNfYermLy/YrL+1xna43jamh76bB6TQCJEaf6zIOMbyfbdHVCdh9e J9vFq6/eu2xRKfakNjaO6j3zhKKspvFySHg7YEplYHR7HRkcuqJRc414bwCKFcIEta+5 qtwqV/NjSVYSiHoH1bct0xWaBwrAFb2crRl6N66GVmSyo3AbzEweCu6a44J+KH+P3eUr M38w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kqVl1qcR; 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 m3-20020a056402050300b004c461474e86si34698159edv.152.2023.03.29.08.34.31; Wed, 29 Mar 2023 08:34:56 -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=kqVl1qcR; 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 S230222AbjC2PcJ (ORCPT + 99 others); Wed, 29 Mar 2023 11:32:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbjC2Pbt (ORCPT ); Wed, 29 Mar 2023 11:31:49 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F9B73C11 for ; Wed, 29 Mar 2023 08:31:48 -0700 (PDT) Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20230329153146epoutp01fdca80c4951e8597208bf4786638b9cc~Q7Zn8PNA31616116161epoutp01U for ; Wed, 29 Mar 2023 15:31:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20230329153146epoutp01fdca80c4951e8597208bf4786638b9cc~Q7Zn8PNA31616116161epoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680103906; bh=bctyMVUmY0qhLzKm25OFhS4f4wHOWRg4Noj6rlrn2TI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kqVl1qcRsJaP4w0DSKlH7e68M15t8YYMzalcn4QGbRbx4v54ei/GL0M+uwI/8xB0D xh1LTzI+oOtyclOETGhBm8liKWtLS8jTTtL8/Jims8CQfIy7b7k6Rpvb0TvRgCye/p +SluoMzyx93qbINkNHTdKqXLqVhutQl8CnOCmB8s= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20230329153145epcas5p35b6fdeb14808610a8be55f99ff00fab3~Q7ZnBqelD2866228662epcas5p3c; Wed, 29 Mar 2023 15:31:45 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.180]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4PmrBS0h0xz4x9Pt; Wed, 29 Mar 2023 15:31:44 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 65.DD.10528.FD954246; Thu, 30 Mar 2023 00:31:43 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20230329123527epcas5p19f78611d6900111716a43a3c4286c5e7~Q4-rYhrYm1108811088epcas5p18; Wed, 29 Mar 2023 12:35:27 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230329123527epsmtrp1161d3c81b432a24ee110b1121b0de50c~Q4-rXY9h81008710087epsmtrp1S; Wed, 29 Mar 2023 12:35:27 +0000 (GMT) X-AuditID: b6c32a49-e75fa70000012920-cc-642459df9d3a Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 84.F7.18071.F8034246; Wed, 29 Mar 2023 21:35:27 +0900 (KST) Received: from green5 (unknown [107.110.206.5]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230329123524epsmtip1138b35b1bdc68767a1329c754dfb5ae9~Q4-oYsfK82800228002epsmtip1c; Wed, 29 Mar 2023 12:35:24 +0000 (GMT) Date: Wed, 29 Mar 2023 18:04:44 +0530 From: Nitesh Shetty To: Damien Le Moal Cc: Anuj Gupta , Jens Axboe , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Keith Busch , Christoph Hellwig , Sagi Grimberg , James Smart , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , bvanassche@acm.org, hare@suse.de, ming.lei@redhat.com, joshi.k@samsung.com, nitheshshetty@gmail.com, gost.dev@samsung.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v8 1/9] block: Introduce queue limits for copy-offload support Message-ID: <20230329123444.GA3895@green5> MIME-Version: 1.0 In-Reply-To: <03c647ff-3c4f-a810-12c4-06a9dc62c90e@opensource.wdc.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA02TfUxTZxTG8957e7llAy8F5AU2JZcxAw5oR8suDsYWjbmTmREF2VwUG3oD SFualk43E4ZzwCATCoJKp8A2RcEFQqmMr06sAaTKYONrIF8jYCKgfGwKrAIrXFz873ee85y8 7zknh0AFF+w8iERlCqtWSuUUbo/V3vH18x/99A2ZcOTyLrrK0orSX+tWUPrGcC5OT99ZAPT5 uWWUtnZ0orTpyfc8eqC5HqGbf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75tqwrb6Z1w6Cpz3GtQmrbn+ijCc1c 0lLAYTGhmqLDD78riloMi9rnmSwVtYHXIr03iueav0rbSnIirHNeqwwai9/KTnd+Wt9OS07A KiwnsnBq58rzz5K+qHhh4VMEbxLdygcab9tYzy2yJ2t3jbxKiOL8biZuOy7SBt4wDTvYlL7+ 1LAir6xDq5Kt7XV1x+8nBTXUq7ZFiwjlbnGwL65Qin8D0vJpxWsDAAA= X-CMS-MailID: 20230329123527epcas5p19f78611d6900111716a43a3c4286c5e7 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----20UT-5VtB2RXxRyC_PhwUj8OofNvbA-fDS5AX-3x2UrzL_bJ=_1191b7_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230327084216epcas5p3945507ecd94688c40c29195127ddc54d References: <20230327084103.21601-1-anuj20.g@samsung.com> <20230327084103.21601-2-anuj20.g@samsung.com> <20230329104142.GA11932@green5> <03c647ff-3c4f-a810-12c4-06a9dc62c90e@opensource.wdc.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 ------20UT-5VtB2RXxRyC_PhwUj8OofNvbA-fDS5AX-3x2UrzL_bJ=_1191b7_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Wed, Mar 29, 2023 at 09:24:11PM +0900, Damien Le Moal wrote: > On 3/29/23 19:41, Nitesh Shetty wrote: > >>> +What: /sys/block//queue/copy_max_bytes > >>> +Date: November 2022 > >>> +Contact: linux-block@vger.kernel.org > >>> +Description: > >>> + [RW] While 'copy_max_bytes_hw' is the hardware limit for the > >>> + device, 'copy_max_bytes' setting is the software limit. > >>> + Setting this value lower will make Linux issue smaller size > >>> + copies from block layer. > >> > >> This is the maximum number of bytes that the block > >> layer will allow for a copy request. Must be smaller than > >> or equal to the maximum size allowed by the hardware indicated > > > > Looks good. Will update in next version. We took reference from discard. > > > >> by copy_max_bytes_hw. Write 0 to use the default kernel > >> settings. > >> > > > > Nack, writing 0 will not set it to default value. (default value is > > copy_max_bytes = copy_max_bytes_hw) > > It is trivial to make it work that way, which would match how max_sectors_kb > works. Write 0 to return copy_max_bytes being equal to the default > copy_max_bytes_hw. > > The other possibility that is also interesting is "write 0 to disable copy > offload and use emulation". This one may actually be more useful. > We were following discard implementation. I feel now both options are good. We can finalize based on community feedback. > > > >>> + > >>> + > >>> +What: /sys/block//queue/copy_max_bytes_hw > >>> +Date: November 2022 > >>> +Contact: linux-block@vger.kernel.org > >>> +Description: > >>> + [RO] Devices that support offloading copy functionality may have > >>> + internal limits on the number of bytes that can be offloaded > >>> + in a single operation. The `copy_max_bytes_hw` > >>> + parameter is set by the device driver to the maximum number of > >>> + bytes that can be copied in a single operation. Copy > >>> + requests issued to the device must not exceed this limit. > >>> + A value of 0 means that the device does not > >>> + support copy offload. > >> > >> [RO] This is the maximum number of kilobytes supported in a > >> single data copy offload operation. A value of 0 means that the > >> device does not support copy offload. > >> > > > > Nack, value is in bytes. Same as discard. > > Typo. I meant Bytes. Your text is too long an too convoluted, so unclear. > Acked, will update in next version > -- > Damien Le Moal > Western Digital Research > > ------20UT-5VtB2RXxRyC_PhwUj8OofNvbA-fDS5AX-3x2UrzL_bJ=_1191b7_ Content-Type: text/plain; charset="utf-8" ------20UT-5VtB2RXxRyC_PhwUj8OofNvbA-fDS5AX-3x2UrzL_bJ=_1191b7_--