Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1368300lqj; Mon, 3 Jun 2024 21:42:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJJ5ahepDxm5i5dkL1+Ho0ruwNqGdXdrHEH9+OuGexR4hpO0kD4aeqL3munVG2cKaDHwOzcGDPMq/Rco43Re3zG0tbeuL1ZFFrk4tGUQ== X-Google-Smtp-Source: AGHT+IF2RAlppqJyMQZfhbEUMt4Ds1zRRWBJGqVsEra6RUlK3JRnCdeWpcJwc49uJBbRb1xS8ZCj X-Received: by 2002:a05:6358:199c:b0:192:28de:f6ec with SMTP id e5c5f4694b2df-19b48d600e8mr1355344255d.18.1717476140940; Mon, 03 Jun 2024 21:42:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717476140; cv=pass; d=google.com; s=arc-20160816; b=L8repZRpiDe5IHP7HDUDvasT3bbQheOtskhdL9fhwnr1XTfZI15gNVwVuFBCo59zRj WvCHXVgoSB6RIeJsbbUeNU5L8bjf4Cf35AE2YPvPzCMpbkplGTH1iIhGSbjnCz/oCiDg NpiS79cpt0d64MCKvtcS9Zcrk4dzE9jU/kMkW6XULM+mIstCwPaEotyAsZWALbPmWwh0 pckSVEJVsxbeKUuUKOdd0WZGeRGpCghCrSZCsVZkeWxHZzyXxv5tKQg+BrjHIUHkFE/s LRN4sV3Ew9hGtiAMxfYxqzYtcPcb18mfvcejerzjGOK9DQ/J4PRhXuFivN0Ci515fF/x Y6Sw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=JSZ4kM1baM0Yr1n8F14QDY/zsEWU3JniU8UtUk1QePc=; fh=Rn495xOAHcdGsoyMZav3fOiulm1Z/PF+8laloJm+6Ys=; b=VKn5jSgH5yNQN6/LjxkARkkJxvnS31PzLWtak2It80o247qdReDo24iWnT8xLQLQiu 3seUh5MZsi0bTZrlbB4E7AhWzWzyOryHSGE2tImKoVj3UWrFLMJprWqxLXcar0stmfnx T7Noy4dcqSHpNUofP1PenfbywjuRXRN4jE2u+CsmTtlAVz6aOAgITRd7TGBWoiRpO2Y0 Vbo0LRlRcl/olhM7pbN3NKY2UaHP7blUjS6XjI/EbbBZSU63MLMA5ex7ZcfPwhhrkDA6 0G7iDlsPpg8wMRm7koxW8jFneaDt0osSPxG4Oo+BaBdAiCn8YaqdO5+D8tAqzrJmMsf6 /bQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-200021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200021-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c359e09c52si7308898a12.289.2024.06.03.21.42.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 21:42:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-200021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200021-linux.lists.archive=gmail.com@vger.kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B4FE3B24E46 for ; Tue, 4 Jun 2024 04:41:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AF5813DBAD; Tue, 4 Jun 2024 04:40:50 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 BB93613D638; Tue, 4 Jun 2024 04:40:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717476050; cv=none; b=MtwLwIoSHHG9bk/Yu3ixH8dXfJVgMgIIPPMsx0y5ufuNiwCTdYrIO+sNiz/Ue0CqxFaEPX85nMXZzhlhkhkDQBUkuyPwUMKpsahqaTgsDdPXq3Om08bWSurC+/X5WB2N/gqeY3c2aw+eI5b2EwvX1FyxSSKPcBcg9hnPDF1abio= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717476050; c=relaxed/simple; bh=YspLg/oZO+NECETpz3U99drDYtBVvMb6eMXzhEQZu1I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kjoKciJKskMO8scKIxjtcD8rSfWx52AhznzPgs68r8V9pBmAub31EbPFRz5yg857F//Dv+p8s8ML6p8gyUaKryygBIkf169Ahvqq0jVQ88fjPyr334LoE4KJuOGurTqmYjiCH+Z34s2V6RQQCZdXEiumrnvYWlTSMwlrxFqS2EE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id EAF7068D12; Tue, 4 Jun 2024 06:40:42 +0200 (CEST) Date: Tue, 4 Jun 2024 06:40:42 +0200 From: Christoph Hellwig To: Bart Van Assche Cc: Christoph Hellwig , Nitesh Shetty , 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. Message-ID: <20240604044042.GA29094@lst.de> References: <20240520102033.9361-1-nj.shetty@samsung.com> <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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Jun 03, 2024 at 10:12:48AM -0700, Bart Van Assche wrote: > Consider the following use case: > * 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. > * The stacking driver to which all REQ_OP_COPY_* operations have been > submitted processes bios asynchronusly. > * 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. > > This results in silent and hard-to-debug data corruption. Do you agree > that we should not restrict copy offloading to stacking drivers that > process bios synchronously and also that this kind of data corruption > should be prevented? 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. > > Thanks, > > Bart. ---end quoted text---