Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp265103lqt; Thu, 6 Jun 2024 02:59:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdy2MJExiQ3B2zH2RMHU22vhCcRFPV+f7cQnKQPqcnQvZKD0IBegB+zAfKRtFOon3Ie2ePxy3ul0FpA0XczawP/97sV9kIJ5Wy93pX0Q== X-Google-Smtp-Source: AGHT+IHB7JoT86rEO9zWkYFDgbvBDGI1GPWAe41m3XWeKc/Hft8mBqDDhrGW6/SJKEp8N5VuRni5 X-Received: by 2002:a50:cd81:0:b0:574:eb69:fadf with SMTP id 4fb4d7f45d1cf-57a8bcc93efmr3076385a12.36.1717667991961; Thu, 06 Jun 2024 02:59:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717667991; cv=pass; d=google.com; s=arc-20160816; b=xqVGFL2aNbNmktvnb9HuazdsRbDHDttMFPz2HE+M73zLz9UHTXin04fUKnkN3XoEk8 YpU5I/W1SWxeQgcWGP19NdnVOxAG6Qlm5gKkGWVEUTD4pUJwq/yd3Yp1cVB8eUzT0XjT UFZj3gtMXyq/SHkG/jvYRvDgC+O0RENcr0nv8m6uthrj9ypRYd4SD8b/21kKUJWFjlJY zORUKseHpXTZIWfWeR4JtJwGAtl5QfzAbkfUjpZDuOmrMNuMnx7cPnU6/wtGACABo2rf S8z2jA79fvdMb8zGwPenKUw1QMb+nzbzpuxYwelTQa60oT4ua5ATwZOe2g3hwrldMg7P zY1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :from:date:dkim-signature:dkim-filter:message-id; bh=X/08X1olkAIHOusibyucFDGsWQxmM65XPCWbJyAP97k=; fh=VDkAbgvxN8OiVxvmTK2kLjqZSitiwwGYCV8xvpY2AqQ=; b=jUoOe9BkYbJwDtda2Psiwt9dA0EGypQm+I3XkpoPp0tiGkjNV7BY2ocuZY7hhem5Yq bhgyOHq3cCXVEIpgo9qc/VtOqjvbG5U//Jps8ahsKxV+xmvF+nhOh8SGZprvoYIi/DC1 B2UYGv9aDp+uvnQ59NVeQ7BCHZwFufajqrfexl5R+wDC9Gm2xMLjzjBWvGHhyqVA/pWw e5dTsXzhsFJ7OqxgCT2so8VCd5onOR8hQATTMoHlwktHFjNtUPrPeOOiPdADcVqIkWKL c11djE4U17T9cybaQqidp2RP5SHjxhCiiAJa7VLU9gl0sWf9dh0TV0a4IStAQ94qb9hP 2Kmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=QKw0wDIB; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-204075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204075-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae1fdb69si529792a12.275.2024.06.06.02.59.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=QKw0wDIB; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-204075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204075-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Message-ID: <66618897.050a0220.3cad8a.ac2eSMTPIN_ADDED_BROKEN@mx.google.com> X-Google-Original-Message-ID: <20240606072835.a7hnqm5mkzvgsojp@nj.shetty@samsung.com> Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 83F451F22D97 for ; Thu, 6 Jun 2024 09:59:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7238181B93; Thu, 6 Jun 2024 09:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="QKw0wDIB" Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (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 C3C2E1802DA for ; Thu, 6 Jun 2024 09:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717667973; cv=none; b=bANnye+gGzM/5U8qGIcqKPhveEIl7BtFsHqsN1qqJXw6yzazCo3kzTa4N27bICKM4AQ4p6zvGSPZCuhuhLJbGxToFm4Vrb0EGdedzgTqJf3GDbocpYl0Lg0NN3iTHv1m22POCt0IW58odTfiVUJngZkTlqVGl6Hx1NmumG/yFiI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717667973; c=relaxed/simple; bh=+kWRtm46EHgrfEjT1jHXAvldmafiXTrXdwgo0depAw8=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:In-Reply-To: Content-Type:References; b=ui4B5rehfjSvQF0qtwmSn/NNLtVUv4PTE7SsVWjhri1NQIRaQ89QTQKY5ADG6hQ/1OiLClsgCsxS1FEft+8dK2bMpPJ/qcIi4aV4c1tdo4I6DNEU9s4cX6OhMY7seqV64/bYIISqJSBJCQ9Efj2Bd191al8mbLLWs8phjd2tNE4= 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=QKw0wDIB; arc=none smtp.client-ip=203.254.224.34 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 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240606095929epoutp04738a815990efb1bf72dcea39fe926f55~WYesJn5br0691206912epoutp04B for ; Thu, 6 Jun 2024 09:59:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240606095929epoutp04738a815990efb1bf72dcea39fe926f55~WYesJn5br0691206912epoutp04B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1717667970; bh=X/08X1olkAIHOusibyucFDGsWQxmM65XPCWbJyAP97k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QKw0wDIB92CTHYFpIxJAvP41i3DJ/cf/0ZXQkxIvg3jr4bqVBhe5VbL0CBZzrUrbE VIsnKoi3ITrM41Z5pbK7a8XevDX5hsX25Fs2A4xZtx278nq37+lT2uXKtF7YrXjbk4 YCRlRNkc3u6DgyW/ZC5f8kM7jxZaEw/81EV7Z4xg= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20240606095929epcas5p245fe6bdf77b2f0f33a3edf73692d5856~WYerhxehs1456214562epcas5p21; Thu, 6 Jun 2024 09:59:29 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.174]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4Vw0DH2hHwz4x9Px; Thu, 6 Jun 2024 09:59:27 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id A2.3C.19174.F7881666; Thu, 6 Jun 2024 18:59:27 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20240606072827epcas5p285de8d4f3b0f6d3a87f8341414336b42~WWaz25d7o3006730067epcas5p2d; Thu, 6 Jun 2024 07:28:27 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240606072827epsmtrp28b89143fbe61df61e97e0db30931c9e8~WWaz1zddk3242132421epsmtrp2a; Thu, 6 Jun 2024 07:28:27 +0000 (GMT) X-AuditID: b6c32a50-157f7a8000004ae6-62-6661887f9388 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C9.FC.07412.B1561666; Thu, 6 Jun 2024 16:28:27 +0900 (KST) Received: from nj.shetty?samsung.com (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240606072823epsmtip2dad935b746ccadd32ea43752942abaab~WWawJjuEm2294122941epsmtip2Y; Thu, 6 Jun 2024 07:28:23 +0000 (GMT) Date: Thu, 6 Jun 2024 12:58:35 +0530 From: Nitesh Shetty To: Bart Van Assche Cc: Christoph Hellwig , Damien Le Moal , Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Keith Busch , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , Jan Kara , martin.petersen@oracle.com, david@fromorbit.com, hare@suse.de, 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. Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <4ffad358-a3e6-4a88-9a40-b7e5d05aa53c@acm.org> X-Brightmail-Tracker: H4sIAAAAAAAAA02Te0xTZxjG951zetoSyo7A9APUscKygdw62/rhRIyiHnUzJGbZhltKVw4t AdquFxTHwn1yGchlw1EUOyRyKYEJjIGCY6CAVccWoIsYCyawTQFh3ibrKAMKi//98j7Pm+f7 3jcvB3c1sT05cUodo1FKE/ikE9HW6+cXmJojjQ0pH+ahJnMfjjKKFnBkunuKRFO9jwAqm5vH 0UT3SYBstwZx1NpnBWj8x3BkrDpLoNvdHRjqrCrBUJ3pGoYqTmdi6NriDIlKeiwATY4YMNQ1 ugV9+0U1gTq7rhNo6NIZEp27MMlGNf12DBXnjGCofSIdoMapWQINjHqhwYV+1q6N9NDwIdpc BekOw102PWi9SNBDt/R0c30uSbdUp9J/tpQD+vLtNJI+X1jKogsyH5J0R/YYi/5rcpSgZ6+M kHRhaz2gbxqvsiPdouJ3KBhpDKPxZpQyVUycUh7GP3REskciEocIAgWhaBvfWylNZML4Ee9E Bu6LS1gaEN87SZqgXypFSrVafvDOHRqVXsd4K1RaXRifUcckqIXqIK00UatXyoOUjG67ICTk LdGSMTpe8aTIRKq/9Dg+cKeBSAP33PMAlwMpIczPyCbygBPHleoEsNGahS0LrtQjA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UizRktR65zpR=_61518_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240606072827epcas5p285de8d4f3b0f6d3a87f8341414336b42 References: <20240520102033.9361-3-nj.shetty@samsung.com> <9f1ec1c1-e1b8-48ac-b7ff-8efb806a1bc8@kernel.org> <665850bd.050a0220.a5e6b.5b72SMTPIN_ADDED_BROKEN@mx.google.com> <20240601055931.GB5772@lst.de> <20240604044042.GA29094@lst.de> <4ffad358-a3e6-4a88-9a40-b7e5d05aa53c@acm.org> ------atUsqPFm-1W_PDIhMRaVeMNpJ8wr1jcbO3GdUizRktR65zpR=_61518_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline On 04/06/24 04:44AM, Bart Van Assche wrote: >On 6/3/24 21:40, Christoph Hellwig wrote: >>There is no requirement to process them synchronously, there is just >>a requirement to preserve the order. Note that my suggestion a few >>arounds ago also included a copy id to match them up. If we don't >>need that I'm happy to leave it away. If need it it to make stacking >>drivers' lifes easier that suggestion still stands. > >Including an ID in REQ_OP_COPY_DST and REQ_OP_COPY_SRC operations sounds >much better to me than abusing the merge infrastructure for combining >these two operations into a single request. With the ID-based approach >stacking drivers are allowed to process copy bios asynchronously and it >is no longer necessary to activate merging for copy operations if >merging is disabled (QUEUE_FLAG_NOMERGES). > Single request, with bio merging approach: The current approach is to send a single request to driver, which contains both destination and source information inside separate bios. Do you have any different approach in mind ? If we want to proceed with this single request based approach, we need to merge the destination request with source BIOs at some point. a. We chose to do it via plug approach. b. Alternative I see is scheduler merging, but here we need some way to hold the request which has destination info, until source bio is also submitted. c. Is there any other way, which I am missing here ? Limitation of current plug based approach: I missed the possibility of asynchronous submission by stacked device. Since we enabled only dm-linear, we had synchronous submission till now and our test cases worked fine. But in future if we start enabling dm targets with asynchronous submission, the current plug based approach won't work. The case where Bart mentioned possibility of 2 different tasks sending copy[1] and they are getting merged wrongly is valid in this case. There will be corruption, copy ID approach can solve this wrong merging. Copy ID based merging might preserve the order, but we still need the copy destination request to wait for copy source bio to merge. Copy ID approach: We see 3 possibilities here: 1. No merging: If we include copy-id in src and dst bio, the bio's will get submitted separately and reach to the driver as separate requests. How do we plan to form a copy command in driver ? 2. Merging BIOs: At some point we need to match the src bio with the dst bio and send this information together to the driver. The current implementation. This still does not solve the asynchronous submission problem, mentioned above. 3. Chaining BIOs: This won't work with stacked devices as there will be cloning, and hence chain won't be maintained. [1] https://lore.kernel.org/all/d7ae00c8-c038-4bed-937e-222251bc627a@acm.org/ Thank You, Nitesh Shetty ------atUsqPFm-1W_PDIhMRaVeMNpJ8wr1jcbO3GdUizRktR65zpR=_61518_ Content-Type: text/plain; charset="utf-8" ------atUsqPFm-1W_PDIhMRaVeMNpJ8wr1jcbO3GdUizRktR65zpR=_61518_--