Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp248359lqk; Sat, 9 Mar 2024 08:14:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUZlHkyb+kq9qDVYyRmnNbmnDhMJqul9jpwTIW8emt6bbrBx6pMqAY6hilJgJKnDRHGSJ7A05NTT3Xi+Q2F6T3rkGQYuZSvmkxH/DstMw== X-Google-Smtp-Source: AGHT+IGCO0TG6WGWTOHLnmN8dvkWzUfC87nS8B1Hq00rBpVIajbodf5kSGxVLDsWFBdpC4HIr7Cv X-Received: by 2002:a05:6a00:1409:b0:6e6:5348:844b with SMTP id l9-20020a056a00140900b006e65348844bmr2316881pfu.24.1710000886036; Sat, 09 Mar 2024 08:14:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1710000886; cv=pass; d=google.com; s=arc-20160816; b=yi2RJz9bpGv0i0g8Ici1amCR5psIQHspBBz/jJK7hll5oqB3b1Y87YBKEBzZ7LRVw/ FSPnBoxB7cxTwOcNy6wXjUmi7KbchZDdJT9fgDLbDVrSvwEFudy6w+hNwIP7udOmGIAp NWiiiehOaZECYGWaWbLKzph7hOcyiHaZoGC1VeomfhcJ9O5wRDKxQTqDJzQc0hklLMFw zWZHJ3b7Fo0XayrGCIaxr9reA6ZrnPGltvRZfg0cIJnA0n4lrUKFCjTcxbDHWmmjwAMH L5ygKZ+LYgZyDq6klpLe8gFPNT0XodTSyY/1bInmUpSdppoTpjj+gjGnfxiLbbor1ckr jVVg== 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=Si0PLbiZYN5lbylf8hrTMmvO0jMokuoB/IgowEDnsXY=; fh=jRDc2X3onbhpqdaKS9nBti11D4KIfRsMU+kHMcDU2hM=; b=sSWe2lh01b/WJEV3kT8isLJ7IVP7nD5NLMu4KyA3on55FW17jvLv0iteAOKuC3y5nJ q0gHdwCZsmjgV0+bmxpvXk6U4yyVgQflsJH3XVIEZ7rCIHVkBYs5LcHj2+hsaBgGqkhO 6ooaMwVZjRNY7lQoKvydV4Mbml7zmyw4S3VtraBmtP5to3lh3I9M3qe8jbS8ji+33RAE gRD8foJ9FS0heqsK0UYkMkUifj25JOcPujThS/POmQ+2dC1nC5gD0R0wcg4ZwDxJYmiz f3NuhWajcBj61q4f8LbLZBsCg5cCzuffMEg0yp9fmjMizGeU9XYAD9HRk1zQKJicvsTX 1NTg==; 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-97949-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97949-linux.lists.archive=gmail.com@vger.kernel.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 b12-20020a63e70c000000b005e4837345a3si1648574pgi.400.2024.03.09.08.14.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 08:14:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97949-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; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-97949-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97949-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B05F7281888 for ; Sat, 9 Mar 2024 16:14:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81D144644C; Sat, 9 Mar 2024 16:14:33 +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 3C6004439F; Sat, 9 Mar 2024 16:14:31 +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=1710000873; cv=none; b=EEy1UtV9lfjqUe0EgZJYRs/DhmaoC1gMYPZ48tEwCHnLOmTWdSP+iB2x/dsibk17NvgxdW8jKrt0hYAv7hinNl3dQ4S5FDl+SVbzNVfTPXKVlpLIdvONPTFBgMt/Dn2Oj679gk4uG+3F2Lgw4LHrxJlE27ouqXEqQYD1XNSgXnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710000873; c=relaxed/simple; bh=I+7esQ6+7JWFVXLFfl3zXTTqxKwmpRLYFXlpXXMY+wg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tNXvnl+se3xWBiNr8gZyRkURdkWRoV9Lr9QdnxT7nfdaf7kTACbBYDedGdowGCkpOVKFGcIydJqlPRX3/goVbpQUkV26OSH7yXrovYXQWhFACjqAgx86vzZ7BSYsxdbQg/VuFzZScYA2WdQdCt2mqUEhBioll3Gf5LDdQcrwYdo= 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 B0C9D68BFE; Sat, 9 Mar 2024 17:14:18 +0100 (CET) Date: Sat, 9 Mar 2024 17:14:18 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , Leon Romanovsky , 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: <20240309161418.GA27113@lst.de> References: <20240306144416.GB19711@lst.de> <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> 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: <20240308202342.GZ9225@ziepe.ca> User-Agent: Mutt/1.5.17 (2007-11-01) 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.