From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 634B1127B69 for ; Fri, 24 May 2024 07:03:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716534218; cv=none; b=YdWlO2MJsp/denlxrgQ5GtCIGk4kGU932kyQAtZU8vZZVVqWrrKRRFy1IxPpgM+s/PHzOkyDKaZPauFun7uHDQbclvNIH8SbTG0zKJTwHYZhKwOz6jFiyi5FIfuFWVLAFB2kDhK4BuBdBPGn23oc8S028GXDN9IK1QRFTgP48eo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716534218; c=relaxed/simple; bh=F2JL3Tk4mSGuw62JqOU9hci9zTtERlsnAZex134S9BI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:In-Reply-To: Content-Type:References; b=XNmrK+vFXB7sDdcs603wgMyyVXfGDKxmAGQb6HRO9V/w8bnBxflxp8x9yMWS04Bfkn2IuJ5pTThgx7MjqVaLnVGanBvqWzedJZZi8txe54dK6uVmLAQO1FBWGZkR582Mp0A+dRBZs/w8qgYdOcW+AvWFbhmseQ3WXFkZgLdwFeY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=GqL9tjnZ; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="GqL9tjnZ" Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240524070331epoutp03790f46f37fce997e3506050c390ad884~SWsVJD4BL0146501465epoutp03Z for ; Fri, 24 May 2024 07:03:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240524070331epoutp03790f46f37fce997e3506050c390ad884~SWsVJD4BL0146501465epoutp03Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1716534211; bh=fcrs1hfVkjlHVW7bOXNOC8znpYsTD2JmXRZJGVnZaTg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GqL9tjnZZt8X6EigF1/D5trSRVqa3CmecAJbL891GseVyUaF5ibFdJ6syZS7PAjWU EMQbagZf+nBm810/AshsWNVSYa4JK3qP+RV2Qdc7UKloK5ak50urZ1nqY2pkPP4P/i /1nMD2xnS7YlMQmDNGP+DUD4UDSHLAc1Svfk5Wa4= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20240524070330epcas5p193140b9e9c3ca20ce1044b5e97e16cc7~SWsUYtv1G2043720437epcas5p18; Fri, 24 May 2024 07:03:30 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.181]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4VlwxD29VZz4x9Q6; Fri, 24 May 2024 07:03:28 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 43.35.09665.0CB30566; Fri, 24 May 2024 16:03:28 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20240524070201epcas5p3a398a82835799d0956448c3590544c0a~SWrBgm2e33040130401epcas5p3j; Fri, 24 May 2024 07:02:01 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240524070201epsmtrp27d72daa4f932ba34758cd2fa2e31a2ba~SWrBfF5Gm1951119511epsmtrp2S; Fri, 24 May 2024 07:02:01 +0000 (GMT) X-AuditID: b6c32a4b-829fa700000025c1-6d-66503bc0b68a Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id BA.14.19234.96B30566; Fri, 24 May 2024 16:02:01 +0900 (KST) Received: from nj.shetty?samsung.com (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240524070157epsmtip26fdc4027c3bba14725ebb809cd21c241~SWq93B5fC0925409254epsmtip2m; Fri, 24 May 2024 07:01:57 +0000 (GMT) Date: Fri, 24 May 2024 06:54:49 +0000 From: Nitesh Shetty To: Hannes Reinecke Cc: Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Keith Busch , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , Jan Kara , martin.petersen@oracle.com, bvanassche@acm.org, david@fromorbit.com, damien.lemoal@opensource.wdc.com, anuj20.g@samsung.com, joshi.k@samsung.com, nitheshshetty@gmail.com, gost.dev@samsung.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, dm-devel@lists.linux.dev, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v20 02/12] Add infrastructure for copy offload in block and request layer. Message-ID: <20240524065449.ydfracefq77urii4@nj.shetty@samsung.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA02Te0xTdxTH97u3vS1EyLXg/FmiwzKzVMKjUNgPBcYmIdegj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MPYHC9bdAqZrTqkVUCyw AsRCib9vjDk6XuQbp0jdx2vU2zS6BF5rBWKWlgT5zkrIjhNxSsVufifPJ/Oab5ZifULSqWAe TvUP/2NGgfD99NcGNTJPCI+rXViwZfmNpE2m89X2ol8OdM9c9rLaK2vpb+KYL4P/9jmalmyU VjwJ2Leh744+8mBglt7vYVPdSNimna4J8o8H3N0tlr8i4q/EtslyyNyo8Murjz6bZ3ZC+YM9 G6JWWGbTaatjU4Tq6JDfg9fCF+v3/zRla9ixv1+nqHNRb6rpVWpgzeNHWfOvXwk6lFOy0r72 UkraK0NMr2SNrd9ryCJzX4/p3lUipbb8k2dV1S4Wq0vrJ+taQ6O9+JDswMrhaR1ElRe0X9pA lmf+PEn/qw41KvvqlR3kzQel7smlTsPiN4fL5LJPAeoInw8OZb7rvoTW7lDIFkCNVvEVtAjO T3YDAAA= X-CMS-MailID: 20240524070201epcas5p3a398a82835799d0956448c3590544c0a X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----0ARpVfROdpzmGW4Ln12FwIta42jNjH8le_L8dBWq-uMGoSqN=_250cc_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240520102842epcas5p4949334c2587a15b8adab2c913daa622f References: <20240520102033.9361-1-nj.shetty@samsung.com> <20240520102033.9361-3-nj.shetty@samsung.com> ------0ARpVfROdpzmGW4Ln12FwIta42jNjH8le_L8dBWq-uMGoSqN=_250cc_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline On 21/05/24 09:01AM, Hannes Reinecke wrote: >On 5/20/24 12:20, Nitesh Shetty wrote: >>We add two new opcode REQ_OP_COPY_DST, REQ_OP_COPY_SRC. >>Since copy is a composite operation involving src and dst sectors/lba, >>each needs to be represented by a separate bio to make it compatible >>with device mapper. >>We expect caller to take a plug and send bio with destination information, >>followed by bio with source information. >>Once the dst bio arrives we form a request and wait for source >>bio. Upon arrival of source bio we merge these two bio's and send >>corresponding request down to device driver. >>Merging non copy offload bio is avoided by checking for copy specific >>opcodes in merge function. >> >>Signed-off-by: Nitesh Shetty >>Signed-off-by: Anuj Gupta >>--- >> block/blk-core.c | 7 +++++++ >> block/blk-merge.c | 41 +++++++++++++++++++++++++++++++++++++++ >> block/blk.h | 16 +++++++++++++++ >> block/elevator.h | 1 + >> include/linux/bio.h | 6 +----- >> include/linux/blk_types.h | 10 ++++++++++ >> 6 files changed, 76 insertions(+), 5 deletions(-) >> >I am a bit unsure about leveraging 'merge' here. As Bart pointed out, >this is arguably as mis-use of the 'merge' functionality as we don't >actually merge bios, but rather use the information from these bios to >form the actual request. >Wouldn't it be better to use bio_chain here, and send out the eventual >request from the end_io function of the bio chain? > With above bio chain approach, I see a difficulty while dealing with stacked/partitioned devices, as they might get remapped. Or am I missing something here ? Bart, Hannes, Regarding merge, does it looks any better, if we use single request operation such as REQ_OP_COPY and use op_flags(REQ_COPY_DST/REQ_COPY_SRC) to identify dst and src bios ? Regards, Nitesh Shetty ------0ARpVfROdpzmGW4Ln12FwIta42jNjH8le_L8dBWq-uMGoSqN=_250cc_ Content-Type: text/plain; charset="utf-8" ------0ARpVfROdpzmGW4Ln12FwIta42jNjH8le_L8dBWq-uMGoSqN=_250cc_--