Displaying 20 results from an estimated 54 matches for "migrate_pfn".
2019 Jul 29
0
[PATCH 8/9] mm: remove the unused MIGRATE_PFN_DEVICE flag
.../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);
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 229153c2c496..8b46c...
2019 Aug 14
0
[PATCH 09/10] mm: remove the unused MIGRATE_PFN_DEVICE flag
.../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);
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 1e67dcfd318f..72120...
2019 Jul 29
1
[PATCH 9/9] mm: remove the MIGRATE_PFN_WRITE flag
On 7/29/19 7:28 AM, Christoph Hellwig wrote:
> The MIGRATE_PFN_WRITE is only used locally in migrate_vma_collect_pmd,
> where it can be replaced with a simple boolean local variable.
>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
Reviewed-by: Ralph Campbell <rcampbell at nvidia.com>
> ---
> include/linux/migrate.h | 1 -
&g...
2020 Jul 20
2
[PATCH v2 2/5] mm/migrate: add a direction parameter to migrate_vma
..., Jul 20, 2020 at 12:54:53PM -0700, Ralph Campbell wrote:
> > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h
> > > index 3e546cbf03dd..620f2235d7d4 100644
> > > +++ 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_FROM_SYSTEM,
> > > + MIGRATE_VMA_FROM_DEVICE_PRIVATE,
> > > +};
> >
> > I wou...
2020 Jul 20
2
[PATCH v2 2/5] mm/migrate: add a direction parameter to migrate_vma
...art,
> + .dir = MIGRATE_VMA_FROM_SYSTEM,
> };
> unsigned long i;
> u64 *pfns;
> diff --git a/include/linux/migrate.h b/include/linux/migrate.h
> index 3e546cbf03dd..620f2235d7d4 100644
> +++ 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_FROM_SYSTEM,
> + MIGRATE_VMA_FROM_DEVICE_PRIVATE,
> +};
I would have guessed this is more natural as _FROM_DEVICE_ and
TO_DEVICE_ ?
All...
2019 Jul 29
0
[PATCH 9/9] mm: remove the MIGRATE_PFN_WRITE flag
The MIGRATE_PFN_WRITE is only used locally in migrate_vma_collect_pmd,
where it can be replaced with a simple boolean local variable.
Signed-off-by: Christoph Hellwig <hch at lst.de>
---
include/linux/migrate.h | 1 -
mm/migrate.c | 9 +++++----
2 files changed, 5 insertions(+), 5 deletions(-)...
2019 Jul 29
24
turn the hmm migrate_vma upside down
Hi Jérôme, Ben and Jason,
below is a series against the hmm tree which starts revamping the
migrate_vma functionality. The prime idea is to export three slightly
lower level functions and thus avoid the need for migrate_vma_ops
callbacks.
Diffstat:
4 files changed, 285 insertions(+), 602 deletions(-)
A git tree is also available at:
git://git.infradead.org/users/hch/misc.git
2020 Jul 06
0
[PATCH 2/5] mm/migrate: add a direction parameter to migrate_vma
...tart = start,
+ .dir = MIGRATE_VMA_FROM_SYSTEM,
};
unsigned long i;
u64 *pfns;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 3e546cbf03dd..620f2235d7d4 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_FROM_SYSTEM,
+ MIGRATE_VMA_FROM_DEVICE_PRIVATE,
+};
+
struct migrate_vma {
struct vm_area_struct *vma;
/*
@@ -199,11 +204,12 @@ struct migrate_vma {
/*
* Se...
2020 Jul 13
0
[PATCH v2 2/5] mm/migrate: add a direction parameter to migrate_vma
...tart = start,
+ .dir = MIGRATE_VMA_FROM_SYSTEM,
};
unsigned long i;
u64 *pfns;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 3e546cbf03dd..620f2235d7d4 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_FROM_SYSTEM,
+ MIGRATE_VMA_FROM_DEVICE_PRIVATE,
+};
+
struct migrate_vma {
struct vm_area_struct *vma;
/*
@@ -199,11 +204,12 @@ struct migrate_vma {
/*
* Se...
2019 Aug 08
10
turn hmm migrate_vma upside down v2
...607 deletions(-)
A git tree is also available at:
git://git.infradead.org/users/hch/misc.git migrate_vma-cleanup.2
Gitweb:
http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/migrate_vma-cleanup.2
Changes since v1:
- fix a few whitespace issues
- drop the patch to remove MIGRATE_PFN_WRITE for now
- various spelling fixes
- clear cpages and npages in migrate_vma_setup
- fix the nouveau_dmem_fault_copy_one return value
- minor improvements to some nouveau internal calling conventions
2019 Jul 29
2
[PATCH 9/9] mm: remove the MIGRATE_PFN_WRITE flag
On Mon, Jul 29, 2019 at 05:28:43PM +0300, Christoph Hellwig wrote:
> The MIGRATE_PFN_WRITE is only used locally in migrate_vma_collect_pmd,
> where it can be replaced with a simple boolean local variable.
>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
NAK that flag is useful, for instance a anonymous vma might have
some of its page read only even if the vma h...
2019 Jul 31
1
[PATCH 5/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...- unsigned long addr, i, npages = 0;
> - nouveau_migrate_copy_t copy;
> - int ret;
> -
> -
> - /* First allocate new memory */
> - for (addr = start, i = 0; addr < end; addr += PAGE_SIZE, i++) {
> - struct page *dpage, *spage;
> -
> - dst_pfns[i] = 0;
> - spage = migrate_pfn_to_page(src_pfns[i]);
> - if (!spage || !(src_pfns[i] & MIGRATE_PFN_MIGRATE))
> - continue;
> + struct page *dpage, *spage;
>
> - dpage = alloc_page_vma(GFP_HIGHUSER, vma, addr);
> - if (!dpage) {
> - dst_pfns[i] = MIGRATE_PFN_ERROR;
> - continue;
> - }
&g...
2020 Jul 21
0
[PATCH v3 2/5] mm/migrate: add a flags parameter to migrate_vma
...= start,
+ .flags = MIGRATE_VMA_SELECT_SYSTEM,
};
unsigned long i;
u64 *pfns;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 3e546cbf03dd..aafec0ca7b41 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 = (1UL << 0),
+ MIGRATE_VMA_SELECT_DEVICE_PRIVATE = (1UL << 1),
+};
+
struct migrate_vma {
struct vm_area_struct *vma;
/*
@@ -199...
2020 Jul 23
0
[PATCH v4 2/6] mm/migrate: add a flags parameter to migrate_vma
...= start,
+ .flags = MIGRATE_VMA_SELECT_SYSTEM,
};
unsigned long i;
u64 *pfns;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 3e546cbf03dd..aafec0ca7b41 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 = (1UL << 0),
+ MIGRATE_VMA_SELECT_DEVICE_PRIVATE = (1UL << 1),
+};
+
struct migrate_vma {
struct vm_area_struct *vma;
/*
@@ -199...
2019 Aug 08
0
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...addr, i, npages = 0;
- nouveau_migrate_copy_t copy;
- int ret;
-
+ struct page *dpage, *spage;
+ vm_fault_t ret = VM_FAULT_SIGBUS;
- /* First allocate new memory */
- for (addr = start, i = 0; addr < end; addr += PAGE_SIZE, i++) {
- struct page *dpage, *spage;
-
- dst_pfns[i] = 0;
- spage = migrate_pfn_to_page(src_pfns[i]);
- if (!spage || !(src_pfns[i] & MIGRATE_PFN_MIGRATE))
- continue;
-
- dpage = alloc_page_vma(GFP_HIGHUSER, vma, addr);
- if (!dpage) {
- dst_pfns[i] = MIGRATE_PFN_ERROR;
- continue;
- }
- lock_page(dpage);
-
- dst_pfns[i] = migrate_pfn(page_to_pfn(dpage)) |
-...
2019 Jul 29
0
[PATCH 5/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...;drm;
struct device *dev = drm->dev->dev;
- unsigned long addr, i, npages = 0;
- nouveau_migrate_copy_t copy;
- int ret;
-
-
- /* First allocate new memory */
- for (addr = start, i = 0; addr < end; addr += PAGE_SIZE, i++) {
- struct page *dpage, *spage;
-
- dst_pfns[i] = 0;
- spage = migrate_pfn_to_page(src_pfns[i]);
- if (!spage || !(src_pfns[i] & MIGRATE_PFN_MIGRATE))
- continue;
+ struct page *dpage, *spage;
- dpage = alloc_page_vma(GFP_HIGHUSER, vma, addr);
- if (!dpage) {
- dst_pfns[i] = MIGRATE_PFN_ERROR;
- continue;
- }
- lock_page(dpage);
-
- dst_pfns[i] = migrate...
2019 Aug 08
1
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...M_FAULT_SIGBUS;
You can remove this line and return VM_FAULT_SIGBUS in the error path below.
>
> - /* First allocate new memory */
> - for (addr = start, i = 0; addr < end; addr += PAGE_SIZE, i++) {
> - struct page *dpage, *spage;
> -
> - dst_pfns[i] = 0;
> - spage = migrate_pfn_to_page(src_pfns[i]);
> - if (!spage || !(src_pfns[i] & MIGRATE_PFN_MIGRATE))
> - continue;
> -
> - dpage = alloc_page_vma(GFP_HIGHUSER, vma, addr);
> - if (!dpage) {
> - dst_pfns[i] = MIGRATE_PFN_ERROR;
> - continue;
> - }
> - lock_page(dpage);
> -
>...
2019 Jul 29
0
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_vma
...gt;drm;
struct device *dev = drm->dev->dev;
- unsigned long addr, i, npages = 0;
- nouveau_migrate_copy_t copy;
- int ret;
-
- /* First allocate new memory */
- for (addr = start, i = 0; addr < end; addr += PAGE_SIZE, i++) {
- struct page *dpage, *spage;
-
- dst_pfns[i] = 0;
- spage = migrate_pfn_to_page(src_pfns[i]);
- if (!spage || !(src_pfns[i] & MIGRATE_PFN_MIGRATE))
- continue;
-
- dpage = nouveau_dmem_page_alloc_locked(drm);
- if (!dpage)
- continue;
-
- dst_pfns[i] = migrate_pfn(page_to_pfn(dpage)) |
- MIGRATE_PFN_LOCKED |
- MIGRATE_PFN_DEVICE;
- npages++...
2020 Jul 20
1
[PATCH v2 2/5] mm/migrate: add a direction parameter to migrate_vma
...h Campbell wrote:
> > > > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h
> > > > > index 3e546cbf03dd..620f2235d7d4 100644
> > > > > +++ 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_FROM_SYSTEM,
> > > > > + MIGRATE_VMA_FROM_DEVICE_PR...
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