search for: nouveau_dmem_migrate_copy_on

Displaying 20 results from an estimated 33 matches for "nouveau_dmem_migrate_copy_on".

2019 Aug 07
4
[PATCH] nouveau/hmm: map pages after migration
.../class.h> #include <nvif/object.h> #include <nvif/if500b.h> #include <nvif/if900b.h> +#include <nvif/if000c.h> #include <linux/sched/mm.h> #include <linux/hmm.h> @@ -560,11 +562,12 @@ nouveau_dmem_init(struct nouveau_drm *drm) } static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, - struct vm_area_struct *vma, unsigned long addr, - unsigned long src, dma_addr_t *dma_addr) + struct vm_area_struct *vma, unsigned long src, + dma_addr_t *dma_addr, u64 *pfn) { struct device *dev = drm->dev->dev; struct page *dpage, *spage; + unsigned long...
2020 Jun 23
1
[RESEND PATCH 2/3] nouveau: fix mixed normal and device private page migration
...(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c > index cc9993837508..f6a806ba3caa 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c > +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c > @@ -540,6 +540,12 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, > if (!(src & MIGRATE_PFN_MIGRATE)) > goto out; > > + if (spage && is_device_private_page(spage)) { > + paddr = nouveau_dmem_page_addr(spage); > + *dma_addr = DMA_MAPPING_ERROR; > + goto done; > + } > + > dpage = no...
2020 Jul 23
0
[PATCH v4 4/6] nouveau/svm: use the new migration invalidation
...to_pfn(dpage)) | MIGRATE_PFN_LOCKED; return 0; error_dma_unmap: + mutex_unlock(&svmm->mutex); dma_unmap_page(dev, *dma_addr, PAGE_SIZE, DMA_BIDIRECTIONAL); error_free_page: __free_page(dpage); @@ -531,7 +537,8 @@ nouveau_dmem_init(struct nouveau_drm *drm) } static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, - unsigned long src, dma_addr_t *dma_addr, u64 *pfn) + struct nouveau_svmm *svmm, unsigned long src, + dma_addr_t *dma_addr, u64 *pfn) { struct device *dev = drm->dev->dev; struct page *dpage, *spage; @@ -561,6 +568,7 @@ static unsigned long nouveau_dmem_migr...
2019 Aug 08
2
[PATCH] nouveau/hmm: map pages after migration
...ot;turn the hmm migrate_vma upside down" but without patch 9 >> "mm: remove the unused MIGRATE_PFN_WRITE" and adds a use for the flag. > > This looks useful. I've already dropped that patch for the pending > resend. Thanks. > >> static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, >> - struct vm_area_struct *vma, unsigned long addr, >> - unsigned long src, dma_addr_t *dma_addr) >> + struct vm_area_struct *vma, unsigned long src, >> + dma_addr_t *dma_addr, u64 *pfn) > > I'll pick up the removal of the not needed...
2019 Aug 08
0
[PATCH] nouveau/hmm: map pages after migration
...4611.GC7171 at redhat.com/T/#u > "turn the hmm migrate_vma upside down" but without patch 9 > "mm: remove the unused MIGRATE_PFN_WRITE" and adds a use for the flag. This looks useful. I've already dropped that patch for the pending resend. > static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, > - struct vm_area_struct *vma, unsigned long addr, > - unsigned long src, dma_addr_t *dma_addr) > + struct vm_area_struct *vma, unsigned long src, > + dma_addr_t *dma_addr, u64 *pfn) I'll pick up the removal of the not needed addr argument for the pat...
2020 Jun 22
7
[RESEND PATCH 0/3] nouveau: fixes for SVM
These are based on 5.8.0-rc2 and intended for Ben Skeggs' nouveau tree. I believe the changes can be queued for 5.8-rcX after being reviewed. These were part of a larger series but I'm resending them separately as suggested by Jason Gunthorpe. https://lore.kernel.org/linux-mm/20200619215649.32297-1-rcampbell at nvidia.com/ Note that in order to exercise/test patch 2 here, you will need a
2019 Aug 13
0
[PATCH] nouveau/hmm: map pages after migration
...#include <nvif/if500b.h> > #include <nvif/if900b.h> > +#include <nvif/if000c.h> > > #include <linux/sched/mm.h> > #include <linux/hmm.h> > @@ -560,11 +562,12 @@ nouveau_dmem_init(struct nouveau_drm *drm) > } > > static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, > - struct vm_area_struct *vma, unsigned long addr, > - unsigned long src, dma_addr_t *dma_addr) > + struct vm_area_struct *vma, unsigned long src, > + dma_addr_t *dma_addr, u64 *pfn) > { > struct device *dev = drm->dev->dev; > struct pa...
2020 Jun 23
2
[RESEND PATCH 1/3] nouveau: fix migrate page regression
...n(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c > index e5c230d9ae24..cc9993837508 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c > +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c > @@ -550,7 +550,7 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, > DMA_BIDIRECTIONAL); > if (dma_mapping_error(dev, *dma_addr)) > goto out_free_page; > - if (drm->dmem->migrate.copy_func(drm, page_size(spage), > + if (drm->dmem->migrate.copy_func(drm, 1, > NOUVEAU_APER_VRAM, paddr, N...
2020 Jun 22
0
[RESEND PATCH 2/3] nouveau: fix mixed normal and device private page migration
...1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c index cc9993837508..f6a806ba3caa 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -540,6 +540,12 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, if (!(src & MIGRATE_PFN_MIGRATE)) goto out; + if (spage && is_device_private_page(spage)) { + paddr = nouveau_dmem_page_addr(spage); + *dma_addr = DMA_MAPPING_ERROR; + goto done; + } + dpage = nouveau_dmem_page_alloc_locked(drm); if (!dpage) go...
2020 Mar 03
2
[PATCH v2] nouveau/hmm: map pages after migration
.../class.h> #include <nvif/object.h> #include <nvif/if500b.h> #include <nvif/if900b.h> +#include <nvif/if000c.h> #include <linux/sched/mm.h> #include <linux/hmm.h> @@ -558,10 +560,11 @@ nouveau_dmem_init(struct nouveau_drm *drm) } static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, - unsigned long src, dma_addr_t *dma_addr) + unsigned long src, dma_addr_t *dma_addr, u64 *pfn) { struct device *dev = drm->dev->dev; struct page *dpage, *spage; + unsigned long paddr; spage = migrate_pfn_to_page(src); if (!spage || !(src & MIGRATE_P...
2020 Mar 04
5
[PATCH v3 0/4] nouveau/hmm: map pages after migration
Originally patch 4 was targeted for Jason's rdma tree since other HMM related changes were queued there. Now that those have been merged, these patches just contain changes to nouveau so they could go through any tree. I guess Ben Skeggs' tree would be appropriate. Changes since v2: Added patches 1-3 to fix some minor issues. Eliminated nouveau_find_svmm() since it is easily found.
2019 Jul 29
0
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_vma
...drm->dmem = NULL; } -static void -nouveau_dmem_migrate_alloc_and_copy(struct vm_area_struct *vma, - const unsigned long *src_pfns, - unsigned long *dst_pfns, - unsigned long start, - unsigned long end, - struct nouveau_migrate *migrate) +static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, + struct vm_area_struct *vma, unsigned long addr, + unsigned long src, dma_addr_t *dma_addr) { - struct nouveau_drm *drm = migrate->drm; struct device *dev = drm->dev->dev; - unsigned long addr, i, npages = 0; - nouveau_migrate_copy_t copy; - int ret; - - /*...
2020 May 20
2
[PATCH] nouveau/hmm: fix migrate zero page to GPU
...rm) case VOLTA_DMA_COPY_A: case TURING_DMA_COPY_A: drm->dmem->migrate.copy_func = nvc0b5_migrate_copy; + drm->dmem->migrate.clear_func = nvc0b5_migrate_clear; drm->dmem->migrate.chan = drm->ttm.chan; return 0; default: @@ -487,21 +537,28 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, unsigned long paddr; spage = migrate_pfn_to_page(src); - if (!spage || !(src & MIGRATE_PFN_MIGRATE)) + if (!(src & MIGRATE_PFN_MIGRATE)) goto out; dpage = nouveau_dmem_page_alloc_locked(drm); if (!dpage) goto out; - *dma_addr = dma_map_page(dev,...
2020 Jul 06
8
[PATCH 0/5] mm/migrate: avoid device private invalidations
The goal for this series is to avoid device private memory 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
2020 Jul 21
6
[PATCH v3 0/5] mm/migrate: avoid device private invalidations
The goal for this series is to avoid device private memory 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
2020 Jul 13
9
[PATCH v2 0/5] mm/migrate: avoid device private invalidations
The goal for this series is to avoid device private memory 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
2020 Jul 23
9
[PATCH v4 0/6] mm/migrate: avoid device private invalidations
The goal for this series is to avoid device private memory 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
2019 Jul 29
0
[PATCH 8/9] mm: remove the unused MIGRATE_PFN_DEVICE flag
...d, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c index 6cb930755970..f04686a2c21f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -582,8 +582,7 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, *dma_addr)) goto out_dma_unmap; - return migrate_pfn(page_to_pfn(dpage)) | - MIGRATE_PFN_LOCKED | MIGRATE_PFN_DEVICE; + return migrate_pfn(page_to_pfn(dpage)) | MIGRATE_PFN_LOCKED; out_dma_unmap: dma_unmap_page(dev, *dma_addr, PAGE_SIZE, DMA_BIDIRECTIONAL);...
2019 Aug 10
0
[PATCH] nouveau/hmm: map pages after migration
On Thu, Aug 08, 2019 at 02:29:34PM -0700, Ralph Campbell wrote: >>> { >>> struct nouveau_fence *fence; >>> unsigned long addr = args->start, nr_dma = 0, i; >>> for (i = 0; addr < args->end; i++) { >>> args->dst[i] = nouveau_dmem_migrate_copy_one(drm, args->vma, >>> - addr, args->src[i], &dma_addrs[nr_dma]); >>> + args->src[i], &dma_addrs[nr_dma], &pfns[i]); >> >> Nit: I find the &pfns[i] way to pass the argument a little weird to read. >> Why not "pfns + i"? >...
2019 Aug 14
0
[PATCH 09/10] mm: remove the unused MIGRATE_PFN_DEVICE flag
...d, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c index d96b987b9982..fa1439941596 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -580,8 +580,7 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, *dma_addr)) goto out_dma_unmap; - return migrate_pfn(page_to_pfn(dpage)) | - MIGRATE_PFN_LOCKED | MIGRATE_PFN_DEVICE; + return migrate_pfn(page_to_pfn(dpage)) | MIGRATE_PFN_LOCKED; out_dma_unmap: dma_unmap_page(dev, *dma_addr, PAGE_SIZE, DMA_BIDIRECTIONAL);...