From mboxrd@z Thu Jan 1 00:00:00 1970 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 7BDD23C73CC; Wed, 23 Sep 2026 04:55:13 +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=1790139317; cv=none; b=ik0GAqjK/Jd68GcxXSnR4Jj/M9zLMMwLfERUMG1lFkqHEWLLL/OEMDl3r3717PU1XMubxXxcqS3fAw7u/gTKmnoh9pdWiPKrKsUtDDEDfXEDvi4PPK+D0QwvbByYuS/giQJiDGS4XpDZTLb1heRFzLeTGh2EZhjdmc7bL6Snmcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790139317; c=relaxed/simple; bh=Qs19OWKtYjUAEmVURvXm80xgS1L3ZM2WRz5g0LPu/o0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kctbwbDCL8M+FQa6X9aZh4IF6GItBhmTojST5XdtUiCIVT5dahUVcLTDxmLZmMDe2raQyazm1KhqZ3F3JB1OwJnlPv2Wks8yAhunpC8LYpadkcepk20Q9OEwpmbmF1C4KhVMfxMjDekfghUKFaxXjG1DWIxbUA5QUeWOgryyLAk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (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=pass (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 B955768BFE; Wed, 23 Sep 2026 06:55:05 +0200 (CEST) Date: Wed, 23 Sep 2026 06:55:05 +0200 From: Christoph Hellwig To: Pavel Begunkov Cc: Christoph Hellwig , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , Keith Busch , Sagi Grimberg , Alexander Viro , Christian Brauner , Jan Kara , Andrew Morton , Jens Axboe , Nitesh Shetty , Kanchan Joshi , Anuj Gupta , Tushar Gohad , William Power , Phil Cayton , Matthew Brost , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Benjamin Marzinski , dm-devel@lists.linux.dev Subject: Re: [PATCH v6 06/13] nvme-pci: implement dma-buf backed requests Message-ID: <20260923045505.GB26231@lst.de> References: <20260922132016.GA30684@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 Tue, Sep 22, 2026 at 02:37:08PM +0100, Pavel Begunkov wrote: >> Sashiko had a few comments, which I think are correct - if we use >> dma_map_sg to map the data, we need to use the sync_sg APIs to >> transfer ownership. That only matters on non-coherent architectures >> with MMU, but we need to get it right. > > I've seen that and fixed everything locally that should be fixed, > apart from the sync. I wonder what we can do about that? I can > somehow replace it with the sg variant for now, but sync'ing the > entire possibly multi-GB mapping for, let's say, a 512B I/O, sounds > not wise. If we'd want to fix this for real we'd need to add an offset to the sync by sg methods. Or move away from scatterlists in dma-buf, given that they are a horrible API. All of these are bigger projects, though. So for now I think you'd want to do the sync all, and have the people who run high-performance io_uring code on non-coherent platforms suffer. > And I can think of another place that does mix sync_single > with sgs. Which one?