summaryrefslogtreecommitdiff
path: root/include/linux/migrate.h
diff options
context:
space:
mode:
authorRalph Campbell <rcampbell@nvidia.com>2020-07-24 01:30:00 +0300
committerJason Gunthorpe <jgg@nvidia.com>2020-07-28 22:20:33 +0300
commit5143192cd410c4fc83be09a2e73423765aee072b (patch)
treee6943dd73d6cad7a9afc3fdeeb90542d5bef4a50 /include/linux/migrate.h
parent1a77decd0caed0bc5b6f5e474981d574076f0841 (diff)
downloadlinux-5143192cd410c4fc83be09a2e73423765aee072b.tar.xz
mm/migrate: add a flags parameter to migrate_vma
The src_owner field in struct migrate_vma is being used for two purposes, it acts as a selection filter for which types of pages are to be migrated and it identifies device private pages owned by the caller. Split this into separate parameters so the src_owner field can be used just to identify device private pages owned by the caller of migrate_vma_setup(). Rename the src_owner field to pgmap_owner to reflect it is now used only to identify which device private pages to migrate. Link: https://lore.kernel.org/r/20200723223004.9586-3-rcampbell@nvidia.com Signed-off-by: Ralph Campbell <rcampbell@nvidia.com> Reviewed-by: Bharata B Rao <bharata@linux.ibm.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include/linux/migrate.h')
-rw-r--r--include/linux/migrate.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 3e546cbf03dd..16e03a51e5cf 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -180,6 +180,11 @@ static inline unsigned long migrate_pfn(unsigned long pfn)
return (pfn << MIGRATE_PFN_SHIFT) | MIGRATE_PFN_VALID;
}
+enum migrate_vma_direction {
+ MIGRATE_VMA_SELECT_SYSTEM = 1 << 0,
+ MIGRATE_VMA_SELECT_DEVICE_PRIVATE = 1 << 1,
+};
+
struct migrate_vma {
struct vm_area_struct *vma;
/*
@@ -199,11 +204,11 @@ struct migrate_vma {
/*
* Set to the owner value also stored in page->pgmap->owner for
- * migrating out of device private memory. If set only device
- * private pages with this owner are migrated. If not set
- * device private pages are not migrated at all.
+ * migrating out of device private memory. The flags also need to
+ * be set to MIGRATE_VMA_SELECT_DEVICE_PRIVATE.
*/
- void *src_owner;
+ void *pgmap_owner;
+ unsigned long flags;
};
int migrate_vma_setup(struct migrate_vma *args);