Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp301857lqb; Thu, 23 May 2024 20:39:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRLSpuEI+ge9OH4KiFxjQ7/jcy+QfGx3LZGyKhxERhVsYK6f9oM2oKeGeuuC6f9ZeulvNj46NEoGLdM2BYWkRXJD8lFh6zUAYjFqqE7Q== X-Google-Smtp-Source: AGHT+IEjelyPZu38Mzf+SVNx+m6HofVjOxNOSFPbUltBfm01jSUvP7I4FO/8h1y+ORVjcgQLmaqB X-Received: by 2002:a05:6870:808e:b0:24c:57cc:c1f6 with SMTP id 586e51a60fabf-24ca11ddae6mr1253130fac.1.1716521980183; Thu, 23 May 2024 20:39:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716521980; cv=pass; d=google.com; s=arc-20160816; b=kjCAsBqbNbkfL6s6l57ccbrN3tF9PlE55DK8PJxJhCR6gghGSebnY4c8DS0GIjYvOS B1ImoWY9n5OWQj/fP17d8Iw9zMzs0ugx4ZyVAWHDXf8Al/VgGUWDEK8VinO5swENWqVm iFvIG1CMktCFqJ/WyFDRqN0X71Yb2/hrqgBISwvve0eTOcDgDoTtQ2mUGJI/egSz/T6l UIUBdWLu4PK76juwiALi2GyVIoxvqOoLY+zVSsxAZr4X3zPS2APo4a5MhRvlx1AspUCK o/k7fSeiuZPpEVuA6hLp/+XC27pmA2Z2G7nc6BMzykCnFr+idY3iqhGnOVI+JFPr6sKE XMKg== 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=kEUNE5DDBugp0ptyOjlNvhJs+4yUfxAjHQz7sOYY5ZI=; fh=YLd9IbdBOj0P4PR96j+f2rfPLb7/dchyclgdvoY1PWc=; b=JE6Lm3LQVSleoD9jXCLY0EXM7QdZYt2llpq6au+OtXmST8i33ncdiFJaa63QT10Tl1 mE31vXivQi4o0Sc/wqRUXtL5JsLpcqlfqJ6iTF/L//QVRBllmVLWiFPiBRDozeE3O0sq zkemA5kFvkLNVWpGN3uqy45fPiznzJatWrWjFClHdDfWIBZ0W0NShul0rPCWZkR+2npE AzWelb4UBErXZdDo4HKSu2uicJnyUNaV9fFAoQZJ2Pm2ahU39WTNYX7m2HzuUgtooTL1 iAt8dgIZkwANeCVlqdFl8XrKe3kO2d0HjPySi/BqxJnkJmj/YnkSyNbtjxS/WHXEWHu8 qVlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="oO8pl/Rp"; 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-188266-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fd4d26f0si632167b3a.240.2024.05.23.20.39.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 20:39:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188266-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="oO8pl/Rp"; 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-188266-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Message-ID: <66500bfc.050a0220.f8120.3d6fSMTPIN_ADDED_BROKEN@mx.google.com> X-Google-Original-Message-ID: <20240523113454.6mwg6xnrkscu6yps@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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E2D812839CD for ; Fri, 24 May 2024 03:39:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 706BB39FFE; Fri, 24 May 2024 03:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="oO8pl/Rp" Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (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 A540938DF9 for ; Fri, 24 May 2024 03:39:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716521943; cv=none; b=qJmUKYJDm5T+1AbuyT8P4IsfeowknPeJIbMMM8x6PyShQhYtLZKS5CPXvESCLSdESFCAJY6ilvyGEeqqRwtcjnKbYLtHhn8Ba0BXVH2pcDKWGUvxChBbkJR6R5U8RVogViSTQJnFpehYX68MOCJoTG7hoNd/z5REemF98C/cg6Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716521943; c=relaxed/simple; bh=Rs8KfzPFWT1KO+9dMU8ukzxtSitXVwFhV5/HmJwGcis=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:In-Reply-To: Content-Type:References; b=hc+pvvZuAx8T+zTSWEFwXcRg58ZHJa7Rw2haSjv/G0aQAWOhNrmKZnkZdVvPW+/2SkCxtRwvFZKpplfq/2ouhqVOPgcPbBFl63dxfyLEvUBRGxSt0cracXLAP/MEMHoSP82srlf6lurMc/Xc5LipayHLC6rA8HWk5c0hX1CCx5Y= 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=oO8pl/Rp; arc=none smtp.client-ip=203.254.224.25 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 epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240524033859epoutp02ad683c8eb91535bee4d49b89bc8d4aef~ST5wQLyNt1937719377epoutp02d for ; Fri, 24 May 2024 03:38:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240524033859epoutp02ad683c8eb91535bee4d49b89bc8d4aef~ST5wQLyNt1937719377epoutp02d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1716521939; bh=kEUNE5DDBugp0ptyOjlNvhJs+4yUfxAjHQz7sOYY5ZI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oO8pl/RpKAB+7hnb8+/HuUwu4GfoNyg9mfIlRSee1S4yn6MftXaxZVI9095j+T5Z7 QYkRsH0CwLC2tlealGyxh9oldqrKWLLlRR/kOzKUC2lMEYqkIaJT3LWUrLvUfQlh9r q5nzNSzwGv/rvY9089VVkDawhsd5EJ79MaECwTLQ= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20240524033859epcas5p3ab5fb4a491caf8ca91d3b7f32528fa36~ST5vooHaQ0531105311epcas5p3S; Fri, 24 May 2024 03:38:59 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.183]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4VlrPF0SpVz4x9Pq; Fri, 24 May 2024 03:38:57 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id 77.94.19431.0DB00566; Fri, 24 May 2024 12:38:56 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20240523114201epcas5p35636ecdb5665cc3d792c120f43e67d96~SG2NGF_tW0305503055epcas5p30; Thu, 23 May 2024 11:42:01 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240523114201epsmtrp18a825758bc171b7a412521bf53c949f7~SG2NE_PA90370403704epsmtrp1T; Thu, 23 May 2024 11:42:01 +0000 (GMT) X-AuditID: b6c32a50-ccbff70000004be7-5d-66500bd0a7cf Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 33.F1.08924.98B2F466; Thu, 23 May 2024 20:42:01 +0900 (KST) Received: from nj.shetty?samsung.com (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240523114157epsmtip2db1c50506ea74d1d9e6f9373973e76e2~SG2JoFU973178131781epsmtip2B; Thu, 23 May 2024 11:41:57 +0000 (GMT) Date: Thu, 23 May 2024 11:34:54 +0000 From: Nitesh Shetty To: Bart Van Assche 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, 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: <97966085-d7a4-4238-a413-4cdac77af8bd@acm.org> X-Brightmail-Tracker: H4sIAAAAAAAAA02Te0xTVxzHd+69vRQEcwfqDrANVtzC23YUdkBwCyLezC3pZuYSCasNvUAD tF1bpjPZeIkKCyAoFKqM93gKExCBAZIiVqqMbTyGKNoZWCaMhxAVwmsthcX/Pr/H95zfIz82 blth4cCWSFWMQiqK5ZBWREuPm6vXbzsEkdyiov2oQX8bR8kX1nBUO55FoumeBYDy5pdxNNF9 DqCV/gEcNd9+BFBxaSGB7ne3YaijNAdD1bW9GLqsTsFQ78YMiXK0IwBNDmsw1DnmgUrOlhOo o7OPQIPtV0hU9NOkBarUrWMo+/wwhlonkgCqn54j0J0xRzSwpmN95EgPDh2h9aWQbtOMW9AD j64R9GB/PN1Yk0bSTeUJ9D9NBYD+5X4iSZdlXmTRGSmzJN2W+phFP5scI+i5rmGSzmyuAfS9 4lsWArvjMYHRjEjMKJwZaYRMLJFGBXGOHBUeFPr6cXlePH/0AcdZKopjgjghnwi8QiWxxuFw nL8RxcYbXQKRUsnZdyBQIYtXMc7RMqUqiMPIxbFyvtxbKYpTxkujvKWMKoDH5b7va0w8EROt Tu6ykK/sPLVa8xgkgkbrdGDJhhQfXlPPYia2pToAnBv1SQdWRl4AMOP875jZeAGgdkZrsa2o 6snGzYFOAKsbG4HZWATQ8EM/m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PGEiUTpNc8B6jfqMFTZ5YWuJl4j0IPKRgJ1 ll8mUWZuPxflPbFiKC3ZiKHSPjVAtwbNBGroEqA2yxNOsIDpfLaGacqGTJnuDZdp6y4imM7W aKZYf4JkDNeOMAOGi4CpeBVPMjmpZzjMqWPDJFOW8JbDjPZ3EYz5oZFkUkv0gGnJquOud9nK D5CykREqVuEduIO/e8CcQkTddDiQZjlPxgMrTwN4FKT9YH5tGq4BfMqZrgDw4btOzC7cYa6l DrezCyywfuTaQ6MAZuYk/B4oiqBF8Ef+PBuStBdsnqBscVd6Hvzak0fY4jh9nYTtVeNcm3Ch d0BTUxrHxo70Svi80sCx7xwGsOpjK2EXU2Djxb4/jNOL4RVDL247gNMCmGelbMijl8GcArEW 0Lr/Crr/Crp/hSyA64E7G6WUhcuUPlE+cjZGrJTIlNHycPGuvbJi8OcVFswvBff1I+IagFGg BkAKF7o6bitYG+bsKJXEHmQVe0MV0ZGssgYIKELo5ug2cErqTIdL9rN7WDaKVfy1GMXziMdE usmbzJ/N06wHeoMSUjwfreYHjQnmxqkPeXYH61SXQuLOjlqWjs8IMZY/UwXO8u3xvxL/s1L0 tLhEXWbJzwlZKOo++/JGwGL3oobcI++1a9GAdO6t9AumVDg81OipaR/+HpshS2px0/g2zY7e 5RehHfJ7EbpFl97b8dUhmO6Yrj/tyavQnPQKXGJQjVmSt08KytxZNxLzKUtlvrNH1OhW2kD5 D81ZJ94n6Q1OXNXitHlFs+Fo4UvlhtL13skz1C3H61MmFGpj82sn74qSqqldsaYhf2Oih5T4 /EW7MeDwi6TB7zuXhi3PiKuWR2TkZb53zd9w2XTX6Hsm8qrT9ZhvciQklLslPgtwhVLyCyPH J1t5AwAA X-CMS-MailID: 20240523114201epcas5p35636ecdb5665cc3d792c120f43e67d96 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----atUsqPFm-1W_PDIhMRaVeMNpJ8wr1jcbO3GdUizRktR65zpR=_20cab_" 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> <97966085-d7a4-4238-a413-4cdac77af8bd@acm.org> ------atUsqPFm-1W_PDIhMRaVeMNpJ8wr1jcbO3GdUizRktR65zpR=_20cab_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline On 22/05/24 11:05AM, Bart Van Assche wrote: >On 5/20/24 03: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. > >Plugs are per task. Can the following happen? We rely on per-context plugging to avoid this. >* Task A calls blk_start_plug() >* Task B calls blk_start_plug() >* Task A submits a REQ_OP_COPY_DST bio and a REQ_OP_COPY_SRC bio. Lets say this forms request A and stored in plug A >* Task B submits a REQ_OP_COPY_DST bio and a REQ_OP_COPY_SRC bio. Lets say this forms request B and stored in plug B >* Task A calls blk_finish_plug() >* Task B calls blk_finish_plug() >* The REQ_OP_COPY_DST bio from task A and the REQ_OP_COPY_SRC bio from > task B are combined into a single request. Here task A picks plug A and hence request A >* The REQ_OP_COPY_DST bio from task B and the REQ_OP_COPY_SRC bio from > task A are combined into a single request. same as above, request B So we expect this case not to happen. Thank you, Nitesh Shetty ------atUsqPFm-1W_PDIhMRaVeMNpJ8wr1jcbO3GdUizRktR65zpR=_20cab_ Content-Type: text/plain; charset="utf-8" ------atUsqPFm-1W_PDIhMRaVeMNpJ8wr1jcbO3GdUizRktR65zpR=_20cab_--