Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp168286lqt; Wed, 5 Jun 2024 22:56:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7yShXY/1Qd+6jrmVcdVkgHysoxHeIRXOMyFRHCyhklAZaVUf7xG/udzwca8Z50lS+LPwkohTjcSlH4NUS8RcQsc+os2cCIdP6eyKlTQ== X-Google-Smtp-Source: AGHT+IEAReZHR2vLpovDAs5ZAh7STwRCkb0NML7ubOUu7yRTNrrOpGQdSl3s5a3pjOEvWp4o5ZZ4 X-Received: by 2002:a05:6214:46a0:b0:6af:ed33:1dbe with SMTP id 6a1803df08f44-6b030a96354mr41351176d6.57.1717653393678; Wed, 05 Jun 2024 22:56:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717653393; cv=pass; d=google.com; s=arc-20160816; b=Ve2WFG9V43h1/DkXq9jttPfujBJHQMomnYkLkHk8O8QMPFsL93PNMHzhN+qhkRaVFA PdH4LvdpUhXE4JbgN3BUE0pMkagzlKjuRhW9esbc8W4GsmIMgH0MPXxsjnADSgXQ8RqS 4A7Yko9TQZF2n8sTrj4Y1DmysnHbMv/lyc0jq1HMFLhlNAXrZzf49iqqA6pIfUEdCIqu qJcwNiQoUnNqh9mxkYMPKSFHMgeYMxdPkRC2IKTyfa1QEcN0G9bET7ePhZM1bvy3iGCH lrhRM3qG/UlIYbacjUx6oQPjG8KHni5jYrGmJE2ZOgVg1CFafEms12zJ7FNcxJIv0tLi hbvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date; bh=Wl4UotmSNPGrfEBwWQN8ldoZrOXqmvjb5gDzyBJQvE4=; fh=/zE+TFRojMi64IyxvB04VBF8wAHUQai5UlddjTr1wbA=; b=HCxPQURjimfecsFwSt382idQnoU5UMN5f8GMeUjPx4swxEJj4U/9DVREIcZjUxSexq fcw27LKMypvx8poK7bSodA1kd4kMMRC8KowObdhlassUoEJZxqCwfqgdpoo5IwJ4DCFO DQhjGQ63gS0uwn70SFEW6EGXVHlqfHN4NUMuz7GlsMa09B9maIBT2ytqxIhd6Dht9FgV MJizl+eQhwB4gq9M9CCDoWb72vfWFw1FFWB3RoDMNaPnfDHHXVpaaa0hvo4hz4n3l9ox q08Xfzj4LJtO6r2FqLRNHHxASYEDNRssjNaZinXV8bS6ZzmlAhnr/nfFoJ/jgARX2Y8O ffHA==; 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-203629-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203629-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04f632131si7833486d6.40.2024.06.05.22.56.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 22:56:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203629-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-203629-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203629-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E6C471C23CF8 for ; Thu, 6 Jun 2024 05:56:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACA6D44361; Thu, 6 Jun 2024 05:56:18 +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 E8EF938384; Thu, 6 Jun 2024 05:56:16 +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=1717653378; cv=none; b=mPb+PD2U3BlbScu7MEgdtj7vhYng+n90/SJTerJQ+qy0Yu8OwhzDIYmraDvRBPPArTXe/kaIpe8gM1vZlRE4uVrXI0id64/SFP5HBSRhyXkih8h7XUE1rcB67sucxR+/a2sZpIEFJPRaQm6z+IlSIHlcQjuB2bD91FDZ5QTE2gk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717653378; c=relaxed/simple; bh=+onNZkVXBC2e2U49WLtGBQYSo60QizKXolbb1+gx7Z0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=JbmjnJwbkG76VQ89e3p11pDc7Zw2ZObt9DwTmBjljgS0YnEgDyoZrOGABvdnf6b9b3wui+NpYJadCT88HigJqzKqk+h4ScNrvDxoa2IqxFaicTvGt3gX5p6/SBM4KbVFT/11LzS4qOaeFq0NqMw9X9RZsr2dcbxWkqJpZRXtkZo= 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 6AACE68CFE; Thu, 6 Jun 2024 07:56:11 +0200 (CEST) Date: Thu, 6 Jun 2024 07:56:11 +0200 From: Christoph Hellwig To: Nitesh Shetty Cc: Christoph Hellwig , 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, bvanassche@acm.org, 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 03/12] block: add copy offload support Message-ID: <20240606055611.GA9404@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 User-Agent: Mutt/1.5.17 (2007-11-01) On Tue, Jun 04, 2024 at 10:50:26AM +0000, Nitesh Shetty wrote: >>> + if (!cio) >>> + return -ENOMEM; >>> + atomic_set(&cio->refcount, 1); >>> + cio->waiter = current; >>> + cio->endio = endio; >>> + cio->private = private; >> >> For the main use this could be allocated on-stack. Is there any good >> reason to not let callers that really want an async version to implement >> the async behavior themselves using suitable helpers? >> > We cannot do on-stack allocation of cio as we use it in endio handler. > cio will be used to track partial IO completion as well. > Callers requiring async implementation would need to manage all this > bookkeeping themselves, leading to duplication of code. We felt it is > better to do it here onetime. > Do you see it any differently ? We don't really to these async variants for other in-kernel I/O, so unless we have a really good reason I'd not do here. The usual approach is to just have a submission helper for async in-kernel special bios types, and the let the caller handle the rest.