Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1304372pxb; Sun, 11 Apr 2021 15:03:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNb1b4uB7/qBPD4/p6HYZzGeLZgzIohVLx0yhRHwBddi0AVWWtuO0womnV7X+EWx8HUnqe X-Received: by 2002:aa7:86c8:0:b029:249:3950:afff with SMTP id h8-20020aa786c80000b02902493950afffmr8478959pfo.79.1618178631489; Sun, 11 Apr 2021 15:03:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618178631; cv=none; d=google.com; s=arc-20160816; b=0YJNsqIB0GmLGueMmjcyfFHQHBocdvOI2CNtBY5N6+u+f6nRK11qwya9Cu3xi4VOVR tCdIt7k7N0IVsL6svXAyc05AZhb3uJRzQhC4d5L+us11AsP+Kff+NpKqTe5Sr/9m01M2 I/wfMCa/S+HphKoAIiTMM68V0+sdVIQuqDEhVTLcbWWUZkmK+Q5aOBvJ8rYpK3W0EV10 rREm/eJGO6L9PuG5WeBHeWv2oNR+sT+Rz1rPrCLP/SfkS5+/jEOU8dKAApAGsxhKQx3r 3kHn5Gnbh5igkq3vZZeFqGlx5rGljk8dE+JhP2YzCSljyHphPI2wt7aC1Tm5C4DDKSQx A3mA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/8TJhA68h/8e3XqwlnCzlH6v3LnaNubb1RVVGCxTa4g=; b=gMGujlKrSF5wnxK8tMmYZqQenLvIZy9LW5vt4Jhu3PBJKQfIHV91dL3Se+Z9lv9fSA Ere1IFYMxKHAAIkV6ZoMxb3j+K2xixZ9Vky0vPv9GTaiyigrzNUR9fr/7Bd3Tm9CC5JJ 9RGDXurTN3fuasofArVlkMjY5K/xTw0oAaRBxef0U+0HjjKFP1SqdkNAemUEV78yDng2 P79VjfYZlXWk9Qr/uUo+DT+Ddiy7iwksG54Fbm+dAuBdnMGknQzOQTKqQ9ZqKan10aaJ o8qae5DX4qK0RchNrFYCgja05XjKsYOtHZjuKslKtcUCs11fPB8VisTxHXCLIGDAJzbN ssOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b="J/l21sH2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si11670336plh.161.2021.04.11.15.03.38; Sun, 11 Apr 2021 15:03:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b="J/l21sH2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236248AbhDKT1C (ORCPT + 99 others); Sun, 11 Apr 2021 15:27:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236064AbhDKT1B (ORCPT ); Sun, 11 Apr 2021 15:27:01 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B809BC06138C for ; Sun, 11 Apr 2021 12:26:44 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id j4-20020a05600c4104b029010c62bc1e20so5659191wmi.3 for ; Sun, 11 Apr 2021 12:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=javigon-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=/8TJhA68h/8e3XqwlnCzlH6v3LnaNubb1RVVGCxTa4g=; b=J/l21sH2xEiKQ5zss8PE24t6RX0KijI3aKHY/zYCZ215ztzsJxk3YljLf/9ftP+pPe W2hIc9la/fpqnWUY3TUAuScz4dE1UIQItk2QhltQbkThx0ZFcUtLEyo9eWse4P5qaoGn sVrV13I6RW6IfJqFSoDl8o3kyGU7FpHMH7YI6Vv6I/QtjipsPPfa1VoVXNs55fE86dWB fmA6d8XTjvDkCBtqS8KZ8EzaGTFkfEAVMmtmWT7qIMmUGtH2ziIzg7IpgUebjLAj6Yb9 l6g37HwskvyYSfmzdloylJzUbLJUGkrKUGnzOCqluZCe6dn9gEVSQ08hl5AMZ80QmEgB CohA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=/8TJhA68h/8e3XqwlnCzlH6v3LnaNubb1RVVGCxTa4g=; b=D3rFeFOozPLYw9Gedyxqlm4/FSoq4sZVdHjSKtR08Ohf7SDA6LONCAclMJ5rohGeL0 vCQaQ4zZycO+n8hpcanBAULQFTGgb9eK+WNEXfaNaE/JV08pZQwBzqxOz41yR4jFue9R dI/+kaaQbCIm/ie9PiIXTfR1qut0su+N+Hql3dT9H5eFKVr+wMplyBKNy1L+D/rZMubs jwk+ODkoPxmk+7KQIfElDJrO8jNUYnx/YnHHr/1TQ0mEsZpXnwDJ1g8xGgOA/NgJlMlb /3rH2TQMpLga4/SpDNVgGzpuzNv3x7hKCAjYtGiYm9H4pxBRorArDTtLffchEntEiWkn LO/Q== X-Gm-Message-State: AOAM532YUX6AZi53576pbf54mB6vv6i/HRQIS+bAP2tmMu6PQKbxpOSc vhV7V7z/aIwL4Wu16GG1ICNA5w== X-Received: by 2002:a1c:f20e:: with SMTP id s14mr23533683wmc.100.1618169203190; Sun, 11 Apr 2021 12:26:43 -0700 (PDT) Received: from localhost (5.186.124.214.cgn.fibianet.dk. [5.186.124.214]) by smtp.gmail.com with ESMTPSA id d5sm16939244wrx.0.2021.04.11.12.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Apr 2021 12:26:42 -0700 (PDT) Date: Sun, 11 Apr 2021 21:26:41 +0200 From: Javier =?utf-8?B?R29uesOhbGV6?= To: Max Gurtovoy Cc: Chaitanya Kulkarni , SelvaKumar S , linux-nvme@lists.infradead.org, axboe@kernel.dk, Damien Le Moal , kch@kernel.org, sagi@grimberg.me, snitzer@redhat.com, selvajove@gmail.com, linux-kernel@vger.kernel.org, nj.shetty@samsung.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, joshi.k@samsung.com, kbusch@kernel.org, joshiiitr@gmail.com, hch@lst.de Subject: Re: [RFC PATCH v5 0/4] add simple copy support Message-ID: <20210411192641.ya6ntxannk3gjyl5@mpHalley.localdomain> References: <5BE5E1D9-675F-4122-A845-B0A29BB74447@javigon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.04.2021 12:10, Max Gurtovoy wrote: > >On 4/10/2021 9:32 AM, Javier González wrote: >>>On 10 Apr 2021, at 02.30, Chaitanya Kulkarni wrote: >>> >>>On 4/9/21 17:22, Max Gurtovoy wrote: >>>>>On 2/19/2021 2:45 PM, SelvaKumar S wrote: >>>>>This patchset tries to add support for TP4065a ("Simple Copy Command"), >>>>>v2020.05.04 ("Ratified") >>>>> >>>>>The Specification can be found in following link. >>>>>https://nvmexpress.org/wp-content/uploads/NVM-Express-1.4-Ratified-TPs-1.zip >>>>> >>>>>Simple copy command is a copy offloading operation and is used to copy >>>>>multiple contiguous ranges (source_ranges) of LBA's to a single destination >>>>>LBA within the device reducing traffic between host and device. >>>>> >>>>>This implementation doesn't add native copy offload support for stacked >>>>>devices rather copy offload is done through emulation. Possible use >>>>>cases are F2FS gc and BTRFS relocation/balance. >>>>> >>>>>*blkdev_issue_copy* takes source bdev, no of sources, array of source >>>>>ranges (in sectors), destination bdev and destination offset(in sectors). >>>>>If both source and destination block devices are same and copy_offload = 1, >>>>>then copy is done through native copy offloading. Copy emulation is used >>>>>in other cases. >>>>> >>>>>As SCSI XCOPY can take two different block devices and no of source range is >>>>>equal to 1, this interface can be extended in future to support SCSI XCOPY. >>>>Any idea why this TP wasn't designed for copy offload between 2 >>>>different namespaces in the same controller ? >>>Yes, it was the first attempt so to keep it simple. >>> >>>Further work is needed to add incremental TP so that we can also do a copy >>>between the name-spaces of same controller (if we can't already) and to the >>>namespaces that belongs to the different controller. >>> >>>>And a simple copy will be the case where the src_nsid == dst_nsid ? >>>> >>>>Also why there are multiple source ranges and only one dst range ? We >>>>could add a bit to indicate if this range is src or dst.. >>One of the target use cases was ZNS in order to avoid fabric transfers during host GC. You can see how this plays well with several zone ranges and a single zone destination. >> >>If we start getting support in Linux through the different past copy offload efforts, I’m sure we can extend this TP in the future. > >But the "copy" command IMO is more general than the ZNS GC case, that >can be a private case of copy, isn't it ? It applies to any namespace type, so yes. I just wanted to give you the background for the current "simple" scope through one of the use cases that was in mind. >We can get a big benefit of offloading the data copy from one ns to >another in the same controller and even in different controllers in >the same subsystem. Definitely. > >Do you think the extension should be to "copy" command or to create a >new command "x_copy" for copying to different destination ns ? I believe there is space for extensions to simple copy. But given the experience with XCOPY, I can imagine that changes will be incremental, based on very specific use cases. I think getting support upstream and bringing deployed cases is a very good start.