Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1562018rwd; Thu, 8 Jun 2023 21:40:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4rzLPWgMaeVMwf+I/dFsRdMZZ/tkb+nulJ1mi2nZfH5xPuA2+X/WbunUiinSiPS4Lve8/j X-Received: by 2002:a05:6a00:3985:b0:652:4291:7cf5 with SMTP id fi5-20020a056a00398500b0065242917cf5mr820136pfb.9.1686285602029; Thu, 08 Jun 2023 21:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686285602; cv=none; d=google.com; s=arc-20160816; b=1K5vYGlg8cQO1gvXwuy2ZH5yV8ybYX/qYpgLMEqUfZRlubtO64IF5n/4C/wwrqZZSh /PLYnASZCBc23FZfM9Z2Dh8pHsZlnsIHd7VUT84RVC6Fnw9Q26P12A0wlNDcqkb9ZZ07 zBs0GELuOsCuE2/svwBqgVYhriOkuvgouOppCcLi0URcVQM3dV1aKxaY7WXKR8yytXcA Yum+yQgpdGfvaGXz2GGMLhj/Gb99fviGXo2Cx+ud9eOJRFg04T3Bi8mi60ff16KlDS+o LlCgpEI4TRKzgBNQfYSGCp+dcZAWCGq0kobuEMePRcMu5URe2/pkdsk2K5FxhO4QktrK lm7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jeVnrOV1EV2Jv8KgTlC0B4lqR8S0n0kMPSfRktLMFwI=; b=SlpphXKuD97jJgMXiA4S5ObgKGmGeI2bjagQAJtIV6fB689ltYSbYmZ+PsFUxEzaIp 1Ue+wxLL+HX9H3ER7q8LHwPNf361aY2JVD1hcef6jYmYv8ruvRWyhwnztPP3mvVXvu7a sdPikqhWPpngxhDGo/JiCtMyg37yoGJPsQi8JeicSwogUbTx2n67+wHOOd2c5mq/cBih 1wgUtGhS/VfGLaJhESNMRLVSO3uOr22y9kwAePcB2KB+0w07fCcgHqzfOtCXQceduA43 Z5rC6ZBoYvfNZyKIWpL6bon25SNDhjRBDi1BP0XSIaqj4OuXawE1uM/2F+4DgLo64zIr LU4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xA10fLwC; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k189-20020a636fc6000000b00543cba6043asi2091258pgc.151.2023.06.08.21.39.47; Thu, 08 Jun 2023 21:40:02 -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=@infradead.org header.s=bombadil.20210309 header.b=xA10fLwC; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238236AbjFIEZN (ORCPT + 99 others); Fri, 9 Jun 2023 00:25:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238220AbjFIEZG (ORCPT ); Fri, 9 Jun 2023 00:25:06 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B33C30C1; Thu, 8 Jun 2023 21:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jeVnrOV1EV2Jv8KgTlC0B4lqR8S0n0kMPSfRktLMFwI=; b=xA10fLwCQtkMdvBeUrApGqup58 UdE0v30IODwdOV2sHuX64in+XGEh2ZJSUUAiU30YuUCfq/Sha7x6SEKpNLjvkVFAlQ+We+lkKf3ET iDM48wKjh0C0WfRBXkLSpoghCvyI1LjmvV0E56K0Hs14qz7TuJ8uTumehrcimbba4BwUfF6aDrSJ2 kLU0uIkJ2gUlPecy2NKj+lgRU+Qe6XHz9B2iXtKiOqueMrqx7mVIKlvWCLlpZ67m/Q76qF45EyZLv S4dgb4Y/q98oDmWmnBwtuSSv7i0i21oQFSHI/FBN9V5/YggYtlNj4jekpFADH/h4dFL8rP6oTZYXC 7xr6ijdA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q7Tfy-00BaXx-39; Fri, 09 Jun 2023 04:24:38 +0000 Date: Thu, 8 Jun 2023 21:24:38 -0700 From: Christoph Hellwig To: Nitesh Shetty Cc: Christoph Hellwig , "Martin K. Petersen" , Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Keith Busch , Christoph Hellwig , Sagi Grimberg , James Smart , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , linux-scsi@vger.kernel.org, willy@infradead.org, hare@suse.de, djwong@kernel.org, bvanassche@acm.org, ming.lei@redhat.com, dlemoal@kernel.org, nitheshshetty@gmail.com, gost.dev@samsung.com, Kanchan Joshi , Javier =?iso-8859-1?Q?Gonz=E1lez?= , Anuj Gupta , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v12 5/9] nvme: add copy offload support Message-ID: References: <20230605121732.28468-1-nj.shetty@samsung.com> <20230605121732.28468-6-nj.shetty@samsung.com> <20230606113535.rjbhe6eqlyqk4pqq@green245> <20230608120817.jg4xb4jhg77mlksw@green245> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230608120817.jg4xb4jhg77mlksw@green245> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Thu, Jun 08, 2023 at 05:38:17PM +0530, Nitesh Shetty wrote: > Sure, we can do away with subsys and realign more on single namespace copy. > We are planning to use token to store source info, such as src sector, > len and namespace. Something like below, > > struct nvme_copy_token { > struct nvme_ns *ns; // to make sure we are copying within same namespace > /* store source info during *IN operation, will be used by *OUT operation */ > sector_t src_sector; > sector_t sectors; > }; > Do you have any better way to handle this in mind ? In general every time we tried to come up with a request payload that is not just data passed to the device it has been a nightmare. So my gut feeling would be that bi_sector and bi_iter.bi_size are the ranges, with multiple bios being allowed to form the input data, similar to how we implement discard merging. The interesting part is how we'd match up these bios. One idea would be that since copy by definition doesn't need integrity data we just add a copy_id that unions it, and use a simple per-gendisk copy I/D allocator, but I'm not entirely sure how well that interacts stacking drivers.