Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2257737pxm; Thu, 24 Feb 2022 20:58:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHrttFppe76kRShNpAZxf540CZlVmmelpNq8coT/hr2gYqZNQYgHEoVFOSh7EQXkD3t64f X-Received: by 2002:a17:906:a384:b0:6ce:c3f4:c59a with SMTP id k4-20020a170906a38400b006cec3f4c59amr4681962ejz.580.1645765138447; Thu, 24 Feb 2022 20:58:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645765138; cv=none; d=google.com; s=arc-20160816; b=LJrpcBMU4PZzW57xa9j1cyPEJ+Rpov2mQbjGzlPVsRHCRzdaRPN5EUEA/TN0ZoMs+P Im9GbNaNK0mHLwZeuxBEb2Hx/81Xv0oID2xZxp8tBr6N0WkjpGWmfU5epay2jnXd9t8G wzMrQYITRm4OTitWksA54ZvObvcVffbbsAbOT62Hyv3t3xeukPOYTWHdqov06Uq2AUUz V6pwfwWFCafxRdc6rpu6cXFL5dU/MFvZPA2TU9pjBcnm2ftXUD/IeA6FegdA8A1lDtM/ ICde9FaIhA+R7LrTP1c6ri/MMUpfAOtAnMy/o2J5xYWi0rFNj9d1Xq6uhekK2XGdKz4H dssA== 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=70BW6FiDnVYnABWjiPvBtlxZq7Trrd1lyFdONgt3Kx8=; b=TLIYRBv7bscLj/dmcXayVTsfCgbmorty7GpCs2EC8P9YSpla1QJ7PbJNmhHGM0b/wW YtOVPH+W9UhMtqcuGfZgVZPP61WtMaWgNdZlv1cjInrtu0/QbCkfQfzpt5PCCLoeq4Hm eAlhDRejJM49zrDmu3kORF+L+6FJkCpEPxxfMTkYWQB1ImHOw6mRJHzXDZ1GGuJl7evu /VO0gODe7kdOwc2X1HO63m8kl2d+D5XwwaK4Mot6Ey2FsGqeeODIxIoB57FCwJwQ8KWD JNlu5XwjigIGpO1c12K7lCDDyE9UBEwnAicBfEOLSNOe+XitjKiahT9mXD7oHg3hTx7y a5WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=udWPccjT; 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 ak17-20020a170906889100b006d6368b1bd2si1009531ejc.688.2022.02.24.20.58.34; Thu, 24 Feb 2022 20:58:58 -0800 (PST) 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=udWPccjT; 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 S237141AbiBYDot (ORCPT + 99 others); Thu, 24 Feb 2022 22:44:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237095AbiBYDor (ORCPT ); Thu, 24 Feb 2022 22:44:47 -0500 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D9AC21BC4F; Thu, 24 Feb 2022 19:44:15 -0800 (PST) Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20220225034414epoutp0450718f72c78f874e0fb57b31c70ccadf~W6phiETuI0602606026epoutp04k; Fri, 25 Feb 2022 03:44:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20220225034414epoutp0450718f72c78f874e0fb57b31c70ccadf~W6phiETuI0602606026epoutp04k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1645760654; bh=70BW6FiDnVYnABWjiPvBtlxZq7Trrd1lyFdONgt3Kx8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=udWPccjToqcFRGko4Qp7cQZMEt3LOUUrtYsUSi0t60b/WxPxL8HmANioqmDydjdDZ d7otW4RkgR3SSEIj3itTSj4Yi6IafVaPrVDCMDuXDdNDWh4KnDk20WBdNFp5ICs6hX XCHYZBcixfEypFzYAksp/gSAKFqQPm5KhsddNyto= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20220225034413epcas5p132b963987cc4f7a5cbd9fff0a657529f~W6pg8XAN51032610326epcas5p1o; Fri, 25 Feb 2022 03:44:13 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.175]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4K4bH82KPqz4x9QG; Fri, 25 Feb 2022 03:44:04 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id DA.BC.05590.48058126; Fri, 25 Feb 2022 12:44:04 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20220224120720epcas5p4437444a45856edbf828bf377207a6f06~Wt3gHzRD_2573725737epcas5p47; Thu, 24 Feb 2022 12:07:20 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220224120719epsmtrp1c47bedc43baaf8c001c483aca859fc23~Wt3gEQOmk0539305393epsmtrp1f; Thu, 24 Feb 2022 12:07:19 +0000 (GMT) X-AuditID: b6c32a4b-723ff700000015d6-a5-621850842539 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 28.30.29871.7F477126; Thu, 24 Feb 2022 21:07:19 +0900 (KST) Received: from test-zns (unknown [107.110.206.5]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220224120715epsmtip1faf192d135aed15d61e8c768642ca090~Wt3brgvle0640906409epsmtip1c; Thu, 24 Feb 2022 12:07:15 +0000 (GMT) Date: Thu, 24 Feb 2022 17:32:18 +0530 From: Nitesh Shetty To: Luis Chamberlain Cc: hch@lst.de, javier@javigon.com, chaitanyak@nvidia.com, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, axboe@kernel.dk, msnitzer@redhat.com, bvanassche@acm.org, martin.petersen@oracle.com, hare@suse.de, kbusch@kernel.org, Frederick.Knight@netapp.com, osandov@fb.com, lsf-pc@lists.linux-foundation.org, djwong@kernel.org, josef@toxicpanda.com, clm@fb.com, dsterba@suse.com, tytso@mit.edu, jack@suse.com, joshi.k@samsung.com, arnav.dawn@samsung.com, nitheshshetty@gmail.com, SelvaKumar S , Alasdair Kergon , Mike Snitzer , Sagi Grimberg , James Smart , Chaitanya Kulkarni , Alexander Viro , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 02/10] block: Introduce queue limits for copy-offload support Message-ID: <20220224120218.GA9117@test-zns> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA02Te0xTdxTH97v39raw1V3x9bNGh1UYyLNS6g+i24yNuxOTsZDsD+PSXeEG qqXt2uJrQdE6kgoEqNNBJYrbGAMXngsBSwkWWbW+YB0IB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JhbXJqXrpecn7uJEZx+tDR3MG5f9UHvECMTB+MhRgkOZiURXtNCsSQh3pTEyqrU ovz4otKc1OJDjNIcLErivBe6TsYLCaQnlqRmp6YWpBbBZJk4OKUamHwNn0S+lbMNubz+sfN1 7XCuexHyIiFTThYsLfgxoXSFOf81m4SismdJ2a//3BbvW2xj0pyu1PpjbvIdU5cNRpkLmlL5 7jx4Jn+x7/uRXumeosrdGntajJwM3a7Mm/u4kP3Jqhn7W6TkVfYK8qgqvIqZ2H7D5lBpC3ON ZIvkxBQx7ZNKq2ZMEy33vcgVcLeh8Y0E+68zIXGtEVNTVFzUfeOVc6XLnU2lsrXlndd1bGNQ cpNwMrvL/sNdZMWUro0dhlbZLBunbF5x+4vBmamLTCIvrXju4tpapuN7VyViG4Osd7f192Oh jKxspa5rdM+EtC17Ge0r+FbpbfwmjVy7v9PFwgrfrvgScSfBMkiJpTgj0VCLuag4EQDIVSLd rgMAAA== X-CMS-MailID: 20220224120720epcas5p4437444a45856edbf828bf377207a6f06 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----w44XasAgibz0dH83sqZUwD2VszzvD0Z8603isFAMQ6N2NX8f=_b23b0_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220214080605epcas5p16868dae515a6355cf9fecf22df4f3c3d References: <20220214080002.18381-1-nj.shetty@samsung.com> <20220214080002.18381-3-nj.shetty@samsung.com> <20220217090700.b7n33vbkx5s4qbfq@garbanzo> <20220217125901.GA3781@test-zns> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,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, T_SCC_BODY_TEXT_LINE 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 ------w44XasAgibz0dH83sqZUwD2VszzvD0Z8603isFAMQ6N2NX8f=_b23b0_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Tue, Feb 22, 2022 at 04:55:41PM -0800, Luis Chamberlain wrote: > On Thu, Feb 17, 2022 at 06:29:01PM +0530, Nitesh Shetty wrote: > > Thu, Feb 17, 2022 at 01:07:00AM -0800, Luis Chamberlain wrote: > > > The subject says limits for copy-offload... > > > > > > On Mon, Feb 14, 2022 at 01:29:52PM +0530, Nitesh Shetty wrote: > > > > Add device limits as sysfs entries, > > > > - copy_offload (RW) > > > > - copy_max_bytes (RW) > > > > - copy_max_hw_bytes (RO) > > > > - copy_max_range_bytes (RW) > > > > - copy_max_range_hw_bytes (RO) > > > > - copy_max_nr_ranges (RW) > > > > - copy_max_nr_ranges_hw (RO) > > > > > > Some of these seem like generic... and also I see a few more max_hw ones > > > not listed above... > > > > > queue_limits and sysfs entries are differently named. > > All sysfs entries start with copy_* prefix. Also it makes easy to lookup > > all copy sysfs. > > For queue limits naming, I tried to following existing queue limit > > convention (like discard). > > My point was that your subject seems to indicate the changes are just > for copy-offload, but you seem to be adding generic queue limits as > well. Is that correct? If so then perhaps the subject should be changed > or the patch split up. > Yeah, queue limits indicates copy offload. I think will make more readable by adding copy_offload_* prefix. > > > > +static ssize_t queue_copy_offload_store(struct request_queue *q, > > > > + const char *page, size_t count) > > > > +{ > > > > + unsigned long copy_offload; > > > > + ssize_t ret = queue_var_store(©_offload, page, count); > > > > + > > > > + if (ret < 0) > > > > + return ret; > > > > + > > > > + if (copy_offload && !q->limits.max_hw_copy_sectors) > > > > + return -EINVAL; > > > > > > > > > If the kernel schedules, copy_offload may still be true and > > > max_hw_copy_sectors may be set to 0. Is that an issue? > > > > > > > This check ensures that, we dont enable offload if device doesnt support > > offload. I feel it shouldn't be an issue. > > My point was this: > > CPU1 CPU2 > Time > 1) if (copy_offload > 2) ---> preemption so it schedules > 3) ---> some other high priority task Sets q->limits.max_hw_copy_sectors to 0 > 4) && !q->limits.max_hw_copy_sectors) > > Can something bad happen if we allow for this? > > max_hw_copy_sectors is read only for user. And inside kernel, this is set only by driver at initialization. ------w44XasAgibz0dH83sqZUwD2VszzvD0Z8603isFAMQ6N2NX8f=_b23b0_ Content-Type: text/plain; charset="utf-8" ------w44XasAgibz0dH83sqZUwD2VszzvD0Z8603isFAMQ6N2NX8f=_b23b0_--