On Mon 02-07-18 09:02:27, Jan Kara wrote: > On Sun 01-07-18 23:10:04, John Hubbard wrote: [...] > > That is an interesting point. > > > > Holding off page writeback of this region does seem like it could cause > > problems under memory pressure. Maybe adjusting the watermarks so that we > > tell the writeback system, "all is well, just ignore this region until > > we're done with it" might help? Any ideas here are welcome... > > > > Longer term, maybe some additional work could allow the kernel to be able > > to writeback the gup-pinned pages (while DMA is happening--snapshots), but > > that seems like a pretty big overhaul. > > We could use bounce pages to safely writeback pinned pages. However I don't > think it would buy us anything. From MM point of view these pages are > impossible-to-get-rid-of (page refcount is increased) and pernamently-dirty > when GUP was for write (we don't know when dirty data arrives there). So > let's not just fool MM by pretending we can make them clean. That's going > to lead to just more problems down the road. Absolutely agreed! We really need to have means to identify those pages first. Only then we can make an educated guess what to do about them. Adding kludges here and there is a wrong way about dealing with this whole problem. So try to focus on a) a reliable way to detect a longterm pin and b) provide an API that would tell the page to be released by its current owner (ideally in two modes, async to kick the process in the background and continue with something else and sync if there is no other way than waiting for the pin. -- Michal Hocko SUSE Labs