Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp523119lqp; Wed, 22 May 2024 11:08:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1hPwB2Rzcxz3ZhzCYW+0nFddXKn9pXQM3lzObR1N5Ixf+2v8kKXwrjmsdQ9f9cGBw7n0SqaAuM4sQX9fHWzqEiNT9cHLfLyrCxQg78w== X-Google-Smtp-Source: AGHT+IFoSt3zom0olBhldACziMjMXw5TbFuChpQBeATbdVgp3+bqBNPbFEqIfjJQo/+Z7o4BhUz/ X-Received: by 2002:a05:6e02:148d:b0:36c:4f4f:ad62 with SMTP id e9e14a558f8ab-371f864f6c7mr32489925ab.13.1716401297686; Wed, 22 May 2024 11:08:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716401297; cv=pass; d=google.com; s=arc-20160816; b=Pv0DnHrx1TW39Wi9e//9KNOtYLIVcfICS+XyO6UGMzUqfUCDfdgbFoo9IqbSXKGYC0 yoHVUdkjwiybK+PiQkl/E96SMkd/e5Mhws1IpULTk5xfscpEwj5u9fwS8k7IKptl6jsm o3rVK8xDWkPjhYzNiPAw8n9MCm3oUiSk1eEzsmjKqYvpI/r39G+hmkV6aA7i8R275Oa/ L/Bp1hOx46ggeR04t+7vJJcm0oSMGHi9YKUTt3VfpHI+XCKDs9RP0LzlT7qJbmvNvVbY nWHif5pKDAbRG472EMKmBmRlN//UZpudAqP1WYckwbYc4ShFDw81B8qJGGkhPjT7+kKk X7kQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=L/Z8Mp/V6Xlw6wkYa899vAJPgD1/fbki4rEqLMN5kt0=; fh=3kSadvIci7cDegCuFUDIceLHOFyveQD31FWI/lPNS30=; b=jtVCFW4KQscrK78fBEmNGfVm57koaemW81SIDWT2OMVbkZbsAgtsuYyY2PYQk1LvEE 40KwH79qv+qJOMI+mM55P8hI5KQH2BuRlliJCC6BGa40uZqJLSKdB9FJavZdExE+doIg uaVzZuPRCVTROvC4s5S47b8gktvAL2ANpneXM4pVvDlE7bNcI7OciMAlS977za8vzkHI DfXI+3BP3h+dbfRsRU4zTeFydBUuq5bbYqK4Xeuf7TmctmjVwYuq2pwY00e97ILbx/IA itN7eVV30FiFjA3xLR0Cl1Bjs2vB4y5eyir3VzO54oQw/e4vHkTWsXJNvG6I2MLXTjeL T9hA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=w4GG+Zk5; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-186595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2a7268esi35496b3a.71.2024.05.22.11.08.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 11:08:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=w4GG+Zk5; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-186595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org 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 993D22844B8 for ; Wed, 22 May 2024 18:07:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75D6214600F; Wed, 22 May 2024 18:05:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="w4GG+Zk5" Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (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 380BC145B1D; Wed, 22 May 2024 18:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716401138; cv=none; b=VXe+q0EJdEHIFtK/Zjhc63rcyUR0KrPGuUr3EzmVmUj+/PYJu4yPkkxvuK9dWPYwmI5v8+YyQsv2cWOJ23kgoLoj5bli9ohx5AHCXJj5phjo1PVxqK5+QRhf8CYj8yFivMyqbpjiP32uPK6VaHHwsYgUPyQjf+91rKxBN4zjZr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716401138; c=relaxed/simple; bh=luEwbZp5k3nkrHj86wxSaPapUg/Y1fNnfoeZAYeQvfo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=byQi1sB9fc5AKcPLDq4w9f1u8UcKVLZNgw1C/V/zR6PRsMusKYuMEqbb8vrwAdKmDHEvvCQCeUtzntRhNsTaTe1F4JcEbmHFkW6sD6fYhfkgxHuneehsRVVG+s0UlppZ3ZePoonh8xzhyyMt0PxJOwu9Q5GnHCEK4+ycbm7rjPQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=w4GG+Zk5; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4Vkzk83zW8zlgMVN; Wed, 22 May 2024 18:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1716401127; x=1718993128; bh=L/Z8Mp/V6Xlw6wkYa899vAJP gD1/fbki4rEqLMN5kt0=; b=w4GG+Zk5K8I/0oN1UncHTyKd/Gk3/mstQgMKWu5t Ny7lWh1SNsdH2k/eerNIDbR63ln2fHwadLSxbN26wlaOya/Eb7PeDC2wO1wQKjb9 3Kv/JR7I2jGtvACEHUtbbltKIsewEnPsGTXlFkdHY5VQDRMbOzG2Cwd8N6o6Kglt VAATPhWT8TLmUPmX550QPPAX33B17Mu07oRnRQwIO7d7FhOlbWoNQaN1AFJr+alO tSKLeozFvhzoY0vF+hxn0Q0phgYjUm0983n3BJ3WEMUeCawbvbeOWfDl6EKHKFRy nODt7HOx9vbzAwF9c3bzRHWDHD+tlt4k1IYNX1Ev1w+wxg== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id F51LBj9xAtLQ; Wed, 22 May 2024 18:05:27 +0000 (UTC) Received: from [100.96.154.26] (unknown [104.132.0.90]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4Vkzjx0WdLzlgMVL; Wed, 22 May 2024 18:05:24 +0000 (UTC) Message-ID: <97966085-d7a4-4238-a413-4cdac77af8bd@acm.org> Date: Wed, 22 May 2024 11:05:24 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v20 02/12] Add infrastructure for copy offload in block and request layer. To: Nitesh Shetty , Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Keith Busch , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , Jan Kara Cc: 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 References: <20240520102033.9361-1-nj.shetty@samsung.com> <20240520102033.9361-3-nj.shetty@samsung.com> Content-Language: en-US From: Bart Van Assche In-Reply-To: <20240520102033.9361-3-nj.shetty@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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? * 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. * Task B submits a REQ_OP_COPY_DST bio and a REQ_OP_COPY_SRC bio. * 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. * 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. Thanks, Bart.