On Mon 23-11-20 11:31:59, Pavel Tatashin wrote: > > Makes sense, as this means no userspace change. > > > > > 2. Add an internal move_pages_zone() similar to move_pages() syscall > > > but instead of migrating to a different NUMA node, migrate pages from > > > ZONE_MOVABLE to another zone. > > > Call move_pages_zone() on demand prior to pinning pages from > > > vfio_pin_map_dma() for instance. > > > > As others already said, migrating away before the longterm pin should be > > the solution. IIRC it was one of the goals of long term pinning api > > proposed long time ago by Peter Ziljstra I think? The implementation > > that was merged relatively recently doesn't do that (yet?) for all > > movable pages, just CMA, but it could. > > From what I can tell, CMA is not solving exactly this problem. It > migrates pages from CMA before pinning, but it migrates them to > ZONE_MOVABLE. CMA suffers from a very similar problem. The existing solution is migrating out from the CMA region and it allows MOVABLE zones as well but that is merely an implementation detail and something that breaks movability on its own. So something to fix up, ideally for both cases. -- Michal Hocko SUSE Labs