Reviewed-by: Alistair Popple <apop...@nvidia.com> On Thursday, 10 February 2022 6:28:13 PM AEDT Christoph Hellwig wrote: > Make the flow a little more clear and prepare for adding a new > ZONE_DEVICE memory type. > > Signed-off-by: Christoph Hellwig <h...@lst.de> > --- > mm/migrate.c | 27 ++++++++++++--------------- > 1 file changed, 12 insertions(+), 15 deletions(-) > > diff --git a/mm/migrate.c b/mm/migrate.c > index 30ecd7223656c1..746e1230886ddb 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -2788,24 +2788,21 @@ void migrate_vma_pages(struct migrate_vma *migrate) > > mapping = page_mapping(page); > > - if (is_zone_device_page(newpage)) { > - if (is_device_private_page(newpage)) { > - /* > - * For now only support private anonymous when > - * migrating to un-addressable device memory. > - */ > - if (mapping) { > - migrate->src[i] &= ~MIGRATE_PFN_MIGRATE; > - continue; > - } > - } else { > - /* > - * Other types of ZONE_DEVICE page are not > - * supported. > - */ > + if (is_device_private_page(newpage)) { > + /* > + * For now only support private anonymous when migrating > + * to un-addressable device memory. > + */ > + if (mapping) { > migrate->src[i] &= ~MIGRATE_PFN_MIGRATE; > continue; > } > + } else if (is_zone_device_page(newpage)) { > + /* > + * Other types of ZONE_DEVICE page are not supported. > + */ > + migrate->src[i] &= ~MIGRATE_PFN_MIGRATE; > + continue; > } > > r = migrate_page(mapping, newpage, page, MIGRATE_SYNC_NO_COPY); >
- [PATCH 05/27] mm: simplify freeing of devmap managed pag... Christoph Hellwig
- [PATCH 06/27] mm: don't include <linux/memremap.h>... Christoph Hellwig
- [PATCH 07/27] mm: remove the extra ZONE_DEVICE struct pa... Christoph Hellwig
- [PATCH 08/27] fsdax: depend on ZONE_DEVICE || FS_DAX_LIM... Christoph Hellwig
- [PATCH 09/27] mm: generalize the pgmap based page_free i... Christoph Hellwig
- [PATCH 10/27] mm: refactor check_and_migrate_movable_pag... Christoph Hellwig
- [PATCH 11/27] mm: refactor the ZONE_DEVICE handling in m... Christoph Hellwig
- Re: [PATCH 11/27] mm: refactor the ZONE_DEVICE hand... Alistair Popple
- [PATCH 12/27] mm: refactor the ZONE_DEVICE handling in m... Christoph Hellwig
- Re: [PATCH 12/27] mm: refactor the ZONE_DEVICE hand... Alistair Popple
- [PATCH 14/27] mm: build migrate_vma_* for all configs wi... Christoph Hellwig
- Re: [PATCH 14/27] mm: build migrate_vma_* for all c... Alistair Popple
- [PATCH 15/27] mm: add zone device coherent type memory s... Christoph Hellwig
- [PATCH 13/27] mm: move the migrate_vma_* device migratio... Christoph Hellwig
- Re: [PATCH 13/27] mm: move the migrate_vma_* device... Alistair Popple
- Re: [PATCH 13/27] mm: move the migrate_vma_* de... Christoph Hellwig
- [PATCH 16/27] mm: add device coherent vma selection for ... Christoph Hellwig
- [PATCH 17/27] mm/gup: fail get_user_pages for LONGTERM d... Christoph Hellwig
- [PATCH 18/27] drm/amdkfd: add SPM support for SVM Christoph Hellwig
- [PATCH 19/27] drm/amdkfd: coherent type as sys mem on mi... Christoph Hellwig