On 2/11/19 10:19 AM, Ira Weiny wrote: > On Mon, Feb 11, 2019 at 11:06:54AM -0700, Jason Gunthorpe wrote: >> On Mon, Feb 11, 2019 at 09:22:58AM -0800, Dan Williams wrote: [...] > John's patches will indicate to the FS that the page is gup pinned. But they > will not indicate longterm vs not "shorterm". A shortterm pin could be handled > as a "real truncate". So, are we back to needing a longterm "bit" in struct > page to indicate a longterm pin and allow the FS to perform this "virtual > write" after truncate? > > Or is it safe to consider all gup pinned pages this way? > > Ira > I mentioned this in another thread, but I'm not great at email threading. :) Anyway, it seems better to just drop the entire "longterm" concept from the internal APIs, and just deal in "it's either gup-pinned *at the moment*, or it's not". And let the filesystem respond appropriately. So for a pinned page that hits clear_page_dirty_for_io or whatever else care about pinned pages: -- fire mmu notifiers, revoke leases, generally do everything as if it were a long term gup pin -- if it's long term, then you've taken the right actions. -- if the pin really is short term, everything works great anyway. The only way that breaks is if longterm pins imply an irreversible action, such as blocking and waiting in a way that you can't back out of or get interrupted out of. And the design doesn't seem to be going in that direction, right? thanks, -- John Hubbard NVIDIA