[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190131081355.GC26495@lst.de>
Date: Thu, 31 Jan 2019 09:13:55 +0100
From: Christoph Hellwig <hch@....de>
To: Logan Gunthorpe <logang@...tatee.com>
Cc: Jason Gunthorpe <jgg@...lanox.com>, Christoph Hellwig <hch@....de>,
Jerome Glisse <jglisse@...hat.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Christian Koenig <christian.koenig@....com>,
Felix Kuehling <Felix.Kuehling@....com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
Joerg Roedel <jroedel@...e.de>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>
Subject: Re: [RFC PATCH 3/5] mm/vma: add support for peer to peer to device
vma
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.
Powered by blists - more mailing lists