From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DF4071DDD6; Sun, 10 Mar 2024 09:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710063319; cv=none; b=sDWapVDF8/QUsPU2PXtIrpWFVbhkqTZ5fOCe6oQ3KQWgD0BZwFTRHlPTmIbBUaAXcXyrI3exTGH4xzagDeIUkVtznMDi3oUkLVtq7WuSKCUsqDwpIzPxPMy+Hl70vSETWR53uRpL2RE46aHNFLePYFRCvzbVPsQXArd52rGQTuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710063319; c=relaxed/simple; bh=A56j1ShXDrhKO97iz6szIVzteEyqKgRDBPAwzXDzikI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ac80HIwoLIvu7vjqhEQWCnCFgliPyi+AzvJOs3WTTu4fp0DVzpFlG+gI1OamZQRLSSEI1YMXIbjkfHSFB/OoPU4zSu/DYvj2CDlt7P87+eHhq+QbZPXiN8SYFC4u0g9bYTIAEI4++BgN0ABl+XkE7lzenWdyN2lrroYS2FDnSYs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=U5txpaxj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="U5txpaxj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0B84C433F1; Sun, 10 Mar 2024 09:35:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710063318; bh=A56j1ShXDrhKO97iz6szIVzteEyqKgRDBPAwzXDzikI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U5txpaxjWhNjC2+i4ewRBUTMbOl9INv+8VjxpWaxk1WEUrjJg3az83iYX2Mn4D5SW yc6zUeCxxSQMhZvCdnpcpuT+AYCkhv/mL7iK7m+UeKVcbupJn2l7VTPaYgCjgBMOA/ BVU6BAh38XlKsUBRkSdAb8irqFKw0ZmI0R/LcvETKy/DSscUI1S6TDxF2MskopGD0N xWRfW9nVMxCaiAkZIpVfqgVBd2dslnlH2l6ODPwVzq2OuPr97rODqlhU5Xm7KbNrxR R7fTvQEaz2EW6Wj0d9pT+Nk4jaz7CJCi9Qxf7jgVSWm1t3UiO2ayk7llGARr05mmDQ jSKO3qAwJxGPw== Date: Sun, 10 Mar 2024 11:35:13 +0200 From: Leon Romanovsky To: Christoph Hellwig Cc: Jason Gunthorpe , Robin Murphy , Marek Szyprowski , Joerg Roedel , Will Deacon , Chaitanya Kulkarni , Jonathan Corbet , Jens Axboe , Keith Busch , Sagi Grimberg , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, linux-nvme@lists.infradead.org, kvm@vger.kernel.org, linux-mm@kvack.org, Bart Van Assche , Damien Le Moal , Amir Goldstein , "josef@toxicpanda.com" , "Martin K. Petersen" , "daniel@iogearbox.net" , Dan Williams , "jack@suse.com" , Zhu Yanjun Subject: Re: [RFC RESEND 00/16] Split IOMMU DMA mapping operation to two steps Message-ID: <20240310093513.GB12921@unreal> References: <20240306154328.GM9225@ziepe.ca> <20240306162022.GB28427@lst.de> <20240306174456.GO9225@ziepe.ca> <20240306221400.GA8663@lst.de> <20240307000036.GP9225@ziepe.ca> <20240307150505.GA28978@lst.de> <20240307210116.GQ9225@ziepe.ca> <20240308164920.GA17991@lst.de> <20240308202342.GZ9225@ziepe.ca> <20240309161418.GA27113@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: <20240309161418.GA27113@lst.de> On Sat, Mar 09, 2024 at 05:14:18PM +0100, Christoph Hellwig wrote: > On Fri, Mar 08, 2024 at 04:23:42PM -0400, Jason Gunthorpe wrote: > > > The DMA API callers really need to know what is P2P or not for > > > various reasons. And they should generally have that information > > > available, either from pin_user_pages that needs to special case > > > it or from the in-kernel I/O submitter that build it from P2P and > > > normal memory. > > > > I think that is a BIO thing. RDMA just calls with FOLL_PCI_P2PDMA and > > shoves the resulting page list into in a scattertable. It never checks > > if any returned page is P2P - it has no reason to care. dma_map_sg() > > does all the work. > > Right now it does, but that's not really a good interface. If we have > a pin_user_pages variant that only pins until the next relevant P2P > boundary and tells you about we can significantly simplify the overall > interface. And you will need to have a way to instruct that pin_user_pages() variant to continue anyway, because you asked for FOLL_PCI_P2PDMA. Without that force, you will have !FOLL_PCI_P2PDMA behaviour. When you say "simplify the overall interface", which interface do you mean? Thanks