[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZVNzS2EA4zQRwIQ7@nvidia.com>
Date: Tue, 14 Nov 2023 09:16:59 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Mina Almasry <almasrymina@...gle.com>
Cc: Yunsheng Lin <linyunsheng@...wei.com>, Jakub Kicinski <kuba@...nel.org>,
davem@...emloft.net, pabeni@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Willem de Bruijn <willemb@...gle.com>,
Kaiyuan Zhang <kaiyuanz@...gle.com>,
Jesper Dangaard Brouer <hawk@...nel.org>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Eric Dumazet <edumazet@...gle.com>,
Christian König <christian.koenig@....com>,
Matthew Wilcox <willy@...radead.org>, Linux-MM <linux-mm@...ck.org>
Subject: Re: [PATCH RFC 3/8] memory-provider: dmabuf devmem memory provider
On Tue, Nov 14, 2023 at 04:21:26AM -0800, Mina Almasry wrote:
> Actually because you put the 'strtuct page for devmem' in
> skb->bv_frag, the net stack will grab the 'struct page' for devmem
> using skb_frag_page() then call things like page_address(), kmap,
> get_page, put_page, etc, etc, etc.
Yikes, please no. If net has its own struct page look alike it has to
stay entirely inside net. A non-mm owned struct page should not be
passed into mm calls. It is just way too hacky to be seriously
considered :(
> > I would expect net stack, page pool, driver still see the 'struct page',
> > only memory provider see the specific struct for itself, for the above,
> > devmem memory provider sees the 'struct page_pool_iov'.
> >
> > The reason I still expect driver to see the 'struct page' is that driver
> > will still need to support normal memory besides devmem.
I wouldn't say this approach is unreasonable, but it does have to be
done carefully to isolate the mm. Keeping the struct page in the API
is going to make this very hard.
Jason
Powered by blists - more mailing lists