mm: handle multiple owners of device private pages in migrate_vma
authorChristoph Hellwig <hch@lst.de>
Mon, 16 Mar 2020 19:32:14 +0000 (20:32 +0100)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 26 Mar 2020 17:33:38 +0000 (14:33 -0300)
commit800bb1c8dc80bb4121446b56813067f3ea44edee
tree8ed199bf4aac9982b7863d71c0448742769f1a63
parentf894ddd5ff01d3bb48faf4dc533536bf5269c17a
mm: handle multiple owners of device private pages in migrate_vma

Add a new src_owner field to struct migrate_vma.  If the field is set,
only device private pages with page->pgmap->owner equal to that field are
migrated.  If the field is not set only "normal" pages are migrated.

Fixes: df6ad69838fc ("mm/device-public-memory: device memory cache coherent with CPU")
Link: https://lore.kernel.org/r/20200316193216.920734-3-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Tested-by: Bharata B Rao <bharata@linux.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
arch/powerpc/kvm/book3s_hv_uvmem.c
drivers/gpu/drm/nouveau/nouveau_dmem.c
include/linux/migrate.h
mm/migrate.c