Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6845041imu; Thu, 31 Jan 2019 00:14:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN5O0UfOluhKV1bW8lxmnULC2U4etUHz7pf2j6A2w/2yZVUUqS0u7iRWY7vAahTPfLEJLVN7 X-Received: by 2002:a17:902:a70b:: with SMTP id w11mr33562868plq.84.1548922458777; Thu, 31 Jan 2019 00:14:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548922458; cv=none; d=google.com; s=arc-20160816; b=EkkDVxuVOfYvaZ28dWFYSZH9wF8ZV6oUBupbs+VWmodEcaGRf8MzwUUYm7OzgYDG1l TdYTX8KMMJBmsqcj4A5bq2fNgbUPqAo9JPmQOA4TTNn8U4XBCQN6MxW+9RCMWP1SFrfI txhv/PYnYrR6PeiwnZhZ4snLs6QlB8BJfkKsLrVmHfndcqmRefTX8NLAigAmSsCCbiJ3 EG0XvGO6olUEltW9+kuoulfFGcAkwCAXlg/jNjWXuhu54sbylm/CCWqXqGyzG2WaUHGE 0MXiMo/wj0wV48CWudyoD8WjNQVAqq5QoMbranVHLrH1YytQODGFL2lS4BLAoODKy6Mk 2YHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Acblo/+uJNdHMW4pb8e5e4aiH0t/0RVfvjUck2tlkTY=; b=D4bwd9mkj3zA59900DmB873J5znvAiPLmHDMRBkUYphnEpUqZsKerY2PeSdcrfbGW0 93xIUDqHx4mmOaz8yB7u41YDReLL3gIQT5idMbtsgCAiuQNJxJEvzwlbF8gTP8W8TXim /kRNip2pOCFYh3yDXU/e6bNN6Jxm70XN00yegUbG7G/UG8CLIeTrOtzbxqWejxB7aHHg 1WBmti8QAs+8PvrNmzvK+ioizldflBlnAOPwmSncv7AGyE9pUHhhZUSU2snnabJLXvnX 9+USAXY7CucFKXqnazTYJ6x2kK5J0AFKrA0YxjkzzxgD2MYmPaeEFzS+hdkni84FsfgP NnOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si817381pfi.75.2019.01.31.00.14.02; Thu, 31 Jan 2019 00:14:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728475AbfAaIN5 (ORCPT + 99 others); Thu, 31 Jan 2019 03:13:57 -0500 Received: from verein.lst.de ([213.95.11.211]:56255 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbfAaIN5 (ORCPT ); Thu, 31 Jan 2019 03:13:57 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 9A19368CEB; Thu, 31 Jan 2019 09:13:55 +0100 (CET) Date: Thu, 31 Jan 2019 09:13:55 +0100 From: Christoph Hellwig To: Logan Gunthorpe Cc: Jason Gunthorpe , Christoph Hellwig , Jerome Glisse , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , "Rafael J . Wysocki" , Bjorn Helgaas , Christian Koenig , Felix Kuehling , "linux-pci@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Marek Szyprowski , Robin Murphy , Joerg Roedel , "iommu@lists.linux-foundation.org" Subject: Re: [RFC PATCH 3/5] mm/vma: add support for peer to peer to device vma Message-ID: <20190131081355.GC26495@lst.de> References: <20190129234752.GR3176@redhat.com> <655a335c-ab91-d1fc-1ed3-b5f0d37c6226@deltatee.com> <20190130041841.GB30598@mellanox.com> <20190130080006.GB29665@lst.de> <20190130190651.GC17080@mellanox.com> <840256f8-0714-5d7d-e5f5-c96aec5c2c05@deltatee.com> <20190130195900.GG17080@mellanox.com> <35bad6d5-c06b-f2a3-08e6-2ed0197c8691@deltatee.com> <20190130215019.GL17080@mellanox.com> <07baf401-4d63-b830-57e1-5836a5149a0c@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07baf401-4d63-b830-57e1-5836a5149a0c@deltatee.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 30, 2019 at 03:52:13PM -0700, Logan Gunthorpe wrote: > > *shrug* so what if the special GUP called a VMA op instead of > > traversing the VMA PTEs today? Why does it really matter? It could > > easily change to a struct page flow tomorrow.. > > Well it's so that it's composable. We want the SGL->DMA side to work for > APIs from kernel space and not have to run a completely different flow > for kernel drivers than from userspace memory. Yes, I think that is the important point. All the other struct page discussion is not about anyone of us wanting struct page - heck it is a pain to deal with, but then again it is there for a reason. In the typical GUP flows we have three uses of a struct page: (1) to carry a physical address. This is mostly through struct scatterlist and struct bio_vec. We could just store a magic PFN-like value that encodes the physical address and allow looking up a page if it exists, and we had at least two attempts at it. In some way I think that would actually make the interfaces cleaner, but Linus has NACKed it in the past, so we'll have to convince him first that this is the way forward (2) to keep a reference to the memory so that it doesn't go away under us due to swapping, process exit, unmapping, etc. No idea how we want to solve this, but I guess you have some smart ideas? (3) to make the PTEs dirty after writing to them. Again no sure what our preferred interface here would be If we solve all of the above problems I'd be more than happy to go with a non-struct page based interface for BAR P2P. But we'll have to solve these issues in a generic way first.