[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241016154428.GD4020792@ziepe.ca>
Date: Wed, 16 Oct 2024 12:44:28 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Christoph Hellwig <hch@...radead.org>
Cc: Yonatan Maman <ymaman@...dia.com>, nouveau@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-mm@...ck.org, herbst@...hat.com, lyude@...hat.com,
dakr@...hat.com, airlied@...il.com, simona@...ll.ch,
leon@...nel.org, jglisse@...hat.com, akpm@...ux-foundation.org,
dri-devel@...ts.freedesktop.org, apopple@...dia.com,
bskeggs@...dia.com, Gal Shalom <GalShalom@...dia.com>
Subject: Re: [PATCH v1 1/4] mm/hmm: HMM API for P2P DMA to device zone pages
On Tue, Oct 15, 2024 at 09:49:30PM -0700, Christoph Hellwig wrote:
> > + /*
> > + * Used for private (un-addressable) device memory only. Return a
> > + * corresponding struct page, that can be mapped to device
> > + * (e.g using dma_map_page)
> > + */
> > + struct page *(*get_dma_page_for_device)(struct page *private_page);
>
> We are talking about P2P memory here. How do you manage to get a page
> that dma_map_page can be used on? All P2P memory needs to use the P2P
> aware dma_map_sg as the pages for P2P memory are just fake zone device
> pages.
FWIW, I've been expecting this series to be rebased on top of Leon's
new DMA API series so it doesn't have this issue.. I think this series
is at RFC quality, but shows more of the next steps.
I'm guessing they got their testing done so far on a system without an
iommu translation?
> which also makes it clear that returning a page from the method is
> not that great, a PFN might work a lot better, e.g.
>
> unsigned long (*device_private_dma_pfn)(struct page *page);
Ideally I think we should not have the struct page * at all through
these APIs if we can avoid it..
Jason
Powered by blists - more mailing lists