Re: [PATCH RFC 0/6] Allow file-backed or shared device private pages

From: Matthew Wilcox
Date: Thu Mar 27 2025 - 12:49:29 EST


On Thu, Mar 27, 2025 at 07:49:47AM -0700, Alistair Popple wrote:
> On Wed, Mar 26, 2025 at 02:14:59AM +0000, Matthew Wilcox wrote:
> > So, there's no need to put DEVICE_PRIVATE pages in the page cache.
> > Instead the GPU will take a copy of the page(s). We agreed that there
> > will have to be some indication (probably a folio flag?) that the GPU has
> > or may have a copy of (some of) the folio so that it can be invalidated
> > if the page is removed due to truncation / eviction.
> >
> > Alistair, let me know if that's not what you think we agreed to ;-)
>
> That all looks about right. I think the flag/indication is a good idea and is
> probably the best solution, but I will need to write the code to truely convince
> myself of that :-)

It might end up making more sense to make it a per-VMA flag or a
per-inode flag, but that's probably something you're in a better
position to determine than I am.