search for: migrate_vma_setup

Displaying 20 results from an estimated 73 matches for "migrate_vma_setup".

2020 Jul 28
2
[PATCH v4 6/6] mm/migrate: remove range invalidation in migrate_vma_pages()
On Thu, Jul 23, 2020 at 03:30:04PM -0700, Ralph Campbell wrote: > When migrating the special zero page, migrate_vma_pages() calls > mmu_notifier_invalidate_range_start() before replacing the zero page > PFN in the CPU page tables. This is unnecessary since the range was > invalidated in migrate_vma_setup() and the page table entry is checked > to be sure it hasn't changed between migrate_vma_setup() and > migrate_vma_pages(). Therefore, remove the redundant invalidation. I don't follow this logic, the purpose of the invalidation is also to clear out anything that may be mirroring thi...
2020 Jul 31
1
[PATCH v4 6/6] mm/migrate: remove range invalidation in migrate_vma_pages()
..., Ralph Campbell wrote: > > > When migrating the special zero page, migrate_vma_pages() calls > > > mmu_notifier_invalidate_range_start() before replacing the zero page > > > PFN in the CPU page tables. This is unnecessary since the range was > > > invalidated in migrate_vma_setup() and the page table entry is checked > > > to be sure it hasn't changed between migrate_vma_setup() and > > > migrate_vma_pages(). Therefore, remove the redundant invalidation. > > > > I don't follow this logic, the purpose of the invalidation is also to >...
2020 Jun 19
0
[PATCH 01/16] mm: fix migrate_vma_setup() src_owner and normal pages
The caller of migrate_vma_setup() does not know what type of page is stored in the CPU's page tables. Pages within the specified range are free to be swapped out, migrated, or freed until after migrate_vma_setup() returns. The caller needs to set struct migrate_vma.src_owner in case a page is a ZONE device private page that t...
2020 Jul 13
9
[PATCH v2 0/5] mm/migrate: avoid device private invalidations
...y TLB invalidations when migrating a range of addresses from system memory to device private memory and some of those pages have already been migrated. The approach taken is to introduce a new mmu notifier invalidation event type and use that in the device driver to skip invalidation callbacks from migrate_vma_setup(). The device driver is also then expected to handle device MMU invalidations as part of the migrate_vma_setup(), migrate_vma_pages(), migrate_vma_finalize() process. Note that this is opt-in. A device driver can simply invalidate its MMU in the mmu notifier callback and not handle MMU invalidation...
2020 Jul 06
8
[PATCH 0/5] mm/migrate: avoid device private invalidations
...y TLB invalidations when migrating a range of addresses from system memory to device private memory and some of those pages have already been migrated. The approach taken is to introduce a new mmu notifier invalidation event type and use that in the device driver to skip invalidation callbacks from migrate_vma_setup(). The device driver is also then expected to handle device MMU invalidations as part of the migrate_vma_setup(), migrate_vma_pages(), migrate_vma_finalize() process. Note that this is opt-in. A device driver can simply invalidate its MMU in the mmu notifier callback and not handle MMU invalidation...
2020 Jul 28
0
[PATCH v4 6/6] mm/migrate: remove range invalidation in migrate_vma_pages()
...2020 at 03:30:04PM -0700, Ralph Campbell wrote: >> When migrating the special zero page, migrate_vma_pages() calls >> mmu_notifier_invalidate_range_start() before replacing the zero page >> PFN in the CPU page tables. This is unnecessary since the range was >> invalidated in migrate_vma_setup() and the page table entry is checked >> to be sure it hasn't changed between migrate_vma_setup() and >> migrate_vma_pages(). Therefore, remove the redundant invalidation. > > I don't follow this logic, the purpose of the invalidation is also to > clear out anything th...
2020 Jul 10
1
[PATCH 3/5] mm/notifier: add migration invalidation type
On Mon, Jul 06, 2020 at 03:23:45PM -0700, Ralph Campbell wrote: > Currently migrate_vma_setup() calls mmu_notifier_invalidate_range_start() > which flushes all device private page mappings whether or not a page > is being migrated to/from device private memory. In order to not disrupt > device mappings that are not being migrated, shift the responsibility > for clearing device p...
2020 Jul 23
9
[PATCH v4 0/6] mm/migrate: avoid device private invalidations
...y TLB invalidations when migrating a range of addresses from system memory to device private memory and some of those pages have already been migrated. The approach taken is to introduce a new mmu notifier invalidation event type and use that in the device driver to skip invalidation callbacks from migrate_vma_setup(). The device driver is also then expected to handle device MMU invalidations as part of the migrate_vma_setup(), migrate_vma_pages(), migrate_vma_finalize() process. Note that this is opt-in. A device driver can simply invalidate its MMU in the mmu notifier callback and not handle MMU invalidation...
2020 Jul 20
1
[PATCH v2 3/5] mm/notifier: add migration invalidation type
On Mon, Jul 13, 2020 at 10:21:47AM -0700, Ralph Campbell wrote: > Currently migrate_vma_setup() calls mmu_notifier_invalidate_range_start() > which flushes all device private page mappings whether or not a page > is being migrated to/from device private memory. In order to not disrupt > device mappings that are not being migrated, shift the responsibility > for clearing device p...
2020 Jul 21
6
[PATCH v3 0/5] mm/migrate: avoid device private invalidations
...y TLB invalidations when migrating a range of addresses from system memory to device private memory and some of those pages have already been migrated. The approach taken is to introduce a new mmu notifier invalidation event type and use that in the device driver to skip invalidation callbacks from migrate_vma_setup(). The device driver is also then expected to handle device MMU invalidations as part of the migrate_vma_setup(), migrate_vma_pages(), migrate_vma_finalize() process. Note that this is opt-in. A device driver can simply invalidate its MMU in the mmu notifier callback and not handle MMU invalidation...
2019 Jul 31
1
[PATCH 1/9] mm: turn migrate_vma upside down
...migrated. Note those pages were still copied to a new page and thus we wasted > -bandwidth but this is considered as a rare event and a price that we are > -willing to pay to keep all the code simpler. > +engine to perform copy from and to device memory. For this we need a new to > +use migrate_vma_setup(), migrate_vma_pages(), and migrate_vma_finalize() > +helpers. > > > Memory cgroup (memcg) and rss accounting > diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c > index 345c63cb752a..38416798abd4 100644 > --- a/drivers/gpu/drm...
2020 Jul 06
0
[PATCH 2/5] mm/migrate: add a direction parameter to migrate_vma
...owner field in struct migrate_vma is being used for two purposes, it implies the direction of the migration 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(). Signed-off-by: Ralph Campbell <rcampbell at nvidia.com> --- arch/powerpc/kvm/book3s_hv_uvmem.c | 2 ++ drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 ++ include/linux/migrate.h | 12 +++++++++--- lib/test_hmm.c | 2 ++ mm/migrate.c...
2020 Jul 13
0
[PATCH v2 2/5] mm/migrate: add a direction parameter to migrate_vma
...owner field in struct migrate_vma is being used for two purposes, it implies the direction of the migration 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(). Signed-off-by: Ralph Campbell <rcampbell at nvidia.com> Reviewed-by: Bharata B Rao <bharata at linux.ibm.com> --- arch/powerpc/kvm/book3s_hv_uvmem.c | 2 ++ drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 ++ include/linux/migrate.h | 12 +++++++++--- lib/test_hmm.c...
2020 Jul 21
0
[PATCH v3 2/5] mm/migrate: add a flags parameter to migrate_vma
...a 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. Signed-off-by: Ralph Campbell <rcampbell at nvidia.com> --- arch/powerpc/kvm/book3s_hv_uvmem.c | 4 +++- drivers/gpu/drm/nouveau/nouveau_dmem.c | 4 +++- incl...
2020 Jul 23
0
[PATCH v4 2/6] mm/migrate: add a flags parameter to migrate_vma
...a 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. Signed-off-by: Ralph Campbell <rcampbell at nvidia.com> Reviewed-by: Bharata B Rao <bharata at linux.ibm.com> --- arch/powerpc/kvm/book3s_hv_uvmem.c | 4...
2020 Jul 10
0
[PATCH 3/5] mm/notifier: add migration invalidation type
On 7/10/20 12:39 PM, Jason Gunthorpe wrote: > On Mon, Jul 06, 2020 at 03:23:45PM -0700, Ralph Campbell wrote: >> Currently migrate_vma_setup() calls mmu_notifier_invalidate_range_start() >> which flushes all device private page mappings whether or not a page >> is being migrated to/from device private memory. In order to not disrupt >> device mappings that are not being migrated, shift the responsibility >> for c...
2020 Jul 13
0
[PATCH v2 3/5] mm/notifier: add migration invalidation type
Currently migrate_vma_setup() calls mmu_notifier_invalidate_range_start() which flushes all device private page mappings whether or not a page is being migrated to/from device private memory. In order to not disrupt device mappings that are not being migrated, shift the responsibility for clearing device private mappings to t...
2020 Jul 20
0
[PATCH v2 0/5] mm/migrate: avoid device private invalidations
...when migrating a range of addresses from system > memory to device private memory and some of those pages have already > been migrated. The approach taken is to introduce a new mmu notifier > invalidation event type and use that in the device driver to skip > invalidation callbacks from migrate_vma_setup(). The device driver is > also then expected to handle device MMU invalidations as part of the > migrate_vma_setup(), migrate_vma_pages(), migrate_vma_finalize() process. > Note that this is opt-in. A device driver can simply invalidate its MMU > in the mmu notifier callback and not han...
2020 Jul 06
0
[PATCH 3/5] mm/notifier: add migration invalidation type
Currently migrate_vma_setup() calls mmu_notifier_invalidate_range_start() which flushes all device private page mappings whether or not a page is being migrated to/from device private memory. In order to not disrupt device mappings that are not being migrated, shift the responsibility for clearing device private mappings to t...
2020 Jun 25
2
[RESEND PATCH 2/3] nouveau: fix mixed normal and device private page migration
...I'm unclear how that makes things less delicate. > Can you expand on what you are worried about? > > The issue with invalidations might be better addressed by letting the device > driver handle device private page TLB invalidations when migrating to > system memory and changing migrate_vma_setup() to only invalidate CPU > TLB entries for normal pages being migrated to device private memory. > If a page isn't migrating, it seems inefficient to invalidate those TLB > entries. > > Any other suggestions? After a night's sleep, I think this might work. What do others th...