Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7124340rwb; Wed, 23 Nov 2022 02:28:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf6r8nCQ4yVYzNrzU2o05ORaOZn6Rq4bYyp0eN0DqW0AWbwNtCiAa3i58LxBJnZwdYcg5q8M X-Received: by 2002:aa7:c942:0:b0:458:e00e:5a85 with SMTP id h2-20020aa7c942000000b00458e00e5a85mr13866283edt.171.1669199319538; Wed, 23 Nov 2022 02:28:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669199319; cv=none; d=google.com; s=arc-20160816; b=xvTOL1ltpLuOpIngFGb8ngYfuV67lVBrv575R/dMnttnLurI7njwqfa5I0CAVGwtNo XWl9E5zwSxFs/VhkjowXvWdCw9G09NEqwLYH+MeHKLqQ3GIMQrv1ZyYwJoPV/1Tm7GlW LbqrpJOopbR21c/b59mhUAfHheYm6msHCIIF9p31dBKrAswniMEvq0ity5Pnw+2406hs 8gRcBAG3Bnl40N3i2b4yVWNcuU8T7Og4/LFPz/fRgEAQRiL3Q7aavT/Em3ABBm6FTtKa cpww5cvb4x7N6CuO55hzJ4w/IDqUDepdAaITKhobCDnb8pb5gung58V1O/S9Dc4/JnaB W4VQ== 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=RATXjSEMlvArFiAypct02J7pLW4b2IjGVBcHKkSxkmM=; b=BSU/8XY0beR4/MO4ERQRMtUyP9evI3tJu4aJIi0rGnad0Jtomj6Dg+uux1X4KllqyV eOH/BOeQx1pY5/vmyxlU2ry8lPo4qGzw0MLRR1tHfnmy+olQE//sLWPwCLoOoHngAFOM kFYwn4CcXkb9CqXsdQv/Un3YbDdMKS0zt1CZoOU1JY6Mm6HfA2qsyDIKPKJxAGyQjE63 9VtB1XL+18w90Gzr1X9K8RXVN0NcIawstiOj/7CXx246kEE708BO87b/vlj3ejau6LjQ o/9vohjDMREoF2ahGEm584fjKS99J+668e+1yYjzVVeWTC0zOXVe+B3oSmiigETERuzS /FdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SswfoFyq; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a056402050900b00462e4cbe815si12718052edv.550.2022.11.23.02.28.18; Wed, 23 Nov 2022 02:28:39 -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=@redhat.com header.s=mimecast20190719 header.b=SswfoFyq; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236052AbiKWIFz (ORCPT + 89 others); Wed, 23 Nov 2022 03:05:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236230AbiKWIFt (ORCPT ); Wed, 23 Nov 2022 03:05:49 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AF4185A36 for ; Wed, 23 Nov 2022 00:04:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669190683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RATXjSEMlvArFiAypct02J7pLW4b2IjGVBcHKkSxkmM=; b=SswfoFyqZhFY6DR6u8aguSA46uy7NqCUigiyttN5mnpcbDbIVhWqlN0LpsF/6ZhyqJPtJh xzUAV0YT+f/sEjfxIs1RG1HT9NRVezUkiZqLEflhkU4A8Zxg2o2VkTSVDiJCf7gp81MjtR YYijGGEpEtd32nbE6sfGKozr8Ux6fQ0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-122-0DCy3A1zNn-7l0VVIwmRXQ-1; Wed, 23 Nov 2022 03:04:38 -0500 X-MC-Unique: 0DCy3A1zNn-7l0VVIwmRXQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3FB54185A7A8; Wed, 23 Nov 2022 08:04:37 +0000 (UTC) Received: from T590 (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F7852024CBE; Wed, 23 Nov 2022 08:04:23 +0000 (UTC) Date: Wed, 23 Nov 2022 16:04:18 +0800 From: Ming Lei To: Nitesh Shetty Cc: axboe@kernel.dk, agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, james.smart@broadcom.com, kch@nvidia.com, damien.lemoal@opensource.wdc.com, naohiro.aota@wdc.com, jth@kernel.org, viro@zeniv.linux.org.uk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, anuj20.g@samsung.com, joshi.k@samsung.com, p.raghav@samsung.com, nitheshshetty@gmail.com, gost.dev@samsung.com, ming.lei@redhat.com Subject: Re: [PATCH v5 02/10] block: Add copy offload support infrastructure Message-ID: References: <20221123055827.26996-1-nj.shetty@samsung.com> <20221123055827.26996-3-nj.shetty@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221123055827.26996-3-nj.shetty@samsung.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 On Wed, Nov 23, 2022 at 11:28:19AM +0530, Nitesh Shetty wrote: > Introduce blkdev_issue_copy which supports source and destination bdevs, > and an array of (source, destination and copy length) tuples. > Introduce REQ_COPY copy offload operation flag. Create a read-write > bio pair with a token as payload and submitted to the device in order. > Read request populates token with source specific information which > is then passed with write request. > This design is courtesy Mikulas Patocka's token based copy I thought this patchset is just for enabling copy command which is supported by hardware. But turns out it isn't, because blk_copy_offload() still submits read/write bios for doing the copy. I am just wondering why not let copy_file_range() cover this kind of copy, and the framework has been there. When I was researching pipe/splice code for supporting ublk zero copy[1], I have got idea for async copy_file_range(), such as: io uring based direct splice, user backed intermediate buffer, still zero copy, if these ideas are finally implemented, we could get super-fast generic offload copy, and bdev copy is really covered too. [1] https://lore.kernel.org/linux-block/20221103085004.1029763-1-ming.lei@redhat.com/ thanks, Ming