search for: vmf

Displaying 20 results from an estimated 177 matches for "vmf".

Did you mean: vma
2023 Mar 28
3
[PATCH] mm: Take a page reference when removing device exclusive entries
...ernel.org --- mm/memory.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index 8c8420934d60..b499bd283d8e 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3623,8 +3623,19 @@ static vm_fault_t remove_device_exclusive_entry(struct vm_fault *vmf) struct vm_area_struct *vma = vmf->vma; struct mmu_notifier_range range; - if (!folio_lock_or_retry(folio, vma->vm_mm, vmf->flags)) + /* + * We need a page reference to lock the page because we don't + * hold the PTL so a racing thread can remove the + * device-exclusive entry...
2024 Jan 22
2
[PATCH] mm: Remove double faults once write a device pfn
Am 22.01.24 um 04:32 schrieb Xianrong Zhou: > The vmf_insert_pfn_prot could cause unnecessary double faults > on a device pfn. Because currently the vmf_insert_pfn_prot does > not make the pfn writable so the pte entry is normally read-only > or dirty catching. What? How do you got to this conclusion? > The first fault only sets up the p...
2019 Jun 27
1
[PATCH 12/25] memremap: add a migrate_to_ram method to struct dev_pagemap_ops
...hanged, 17 insertions(+), 67 deletions(-) Reviewed-by: Jason Gunthorpe <jgg at mellanox.com> I'ver heard there are some other use models for fault() here beyond migrate to ram, but we can rename it if we ever see them. > +static vm_fault_t hmm_devmem_migrate_to_ram(struct vm_fault *vmf) > { > - struct hmm_devmem *devmem = page->pgmap->data; > + struct hmm_devmem *devmem = vmf->page->pgmap->data; > > - return devmem->ops->fault(devmem, vma, addr, page, flags, pmdp); > + return devmem->ops->fault(devmem, vmf->vma, vmf->address,...
2024 Jan 24
1
[PATCH] mm: Remove double faults once write a device pfn
"Zhou, Xianrong" <Xianrong.Zhou at amd.com> writes: > [AMD Official Use Only - General] > >> >>>>> The vmf_insert_pfn_prot could cause unnecessary double faults on a >> >>>>> device pfn. Because currently the vmf_insert_pfn_prot does not >> >>>>> make the pfn writable so the pte entry is normally read-only or >> >>>>> dirty catching. >&gt...
2024 Jan 23
2
[PATCH] mm: Remove double faults once write a device pfn
Am 23.01.24 um 09:33 schrieb Zhou, Xianrong: > [AMD Official Use Only - General] > >>> The vmf_insert_pfn_prot could cause unnecessary double faults on a >>> device pfn. Because currently the vmf_insert_pfn_prot does not make >>> the pfn writable so the pte entry is normally read-only or dirty >>> catching. >> What? How do you got to this conclusion? > Sor...
2024 Jan 24
2
[PATCH] mm: Remove double faults once write a device pfn
Am 24.01.24 um 03:43 schrieb Zhou, Xianrong: > [AMD Official Use Only - General] > >>>>> The vmf_insert_pfn_prot could cause unnecessary double faults on a >>>>> device pfn. Because currently the vmf_insert_pfn_prot does not make >>>>> the pfn writable so the pte entry is normally read-only or dirty >>>>> catching. >>>> What? How do you...
2011 Nov 29
3
[PATCH] fs: push file_update_time into ->page_mkwrite
...curity/selinux/selinuxfs.c | 1 + 15 files changed, 14 insertions(+), 8 deletions(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 62857a8..ae2968f 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -610,6 +610,7 @@ v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) P9_DPRINTK(P9_DEBUG_VFS, "page %p fid %lx\n", page, (unsigned long)filp->private_data); + file_update_time(filp); v9inode = V9FS_I(inode); /* make sure the cache has finished storing the page */ v9fs_fscache_wait_on_page_write(inode, page); diff --git a/fs/btrfs/inode....
2023 Mar 29
1
[PATCH] mm: Take a page reference when removing device exclusive entries
On Tue, Mar 28, 2023 at 01:14:34PM +1100, Alistair Popple wrote: > +++ b/mm/memory.c > @@ -3623,8 +3623,19 @@ static vm_fault_t remove_device_exclusive_entry(struct vm_fault *vmf) > struct vm_area_struct *vma = vmf->vma; > struct mmu_notifier_range range; > > - if (!folio_lock_or_retry(folio, vma->vm_mm, vmf->flags)) > + /* > + * We need a page reference to lock the page because we don't > + * hold the PTL so a racing thread can rem...
2019 Jun 13
1
[PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops
...truct dev_pagemap to the dead state. > */ > void (*kill)(struct dev_pagemap *pgmap); > + > + /* > + * Used for private (un-addressable) device memory only. Must migrate > + * the page back to a CPU accessible page. > + */ > + vm_fault_t (*migrate)(struct vm_fault *vmf); > }; > > /** > diff --git a/include/linux/swapops.h b/include/linux/swapops.h > index 4d961668e5fc..15bdb6fe71e5 100644 > --- a/include/linux/swapops.h > +++ b/include/linux/swapops.h > @@ -129,12 +129,6 @@ static inline struct page *device_private_entry_to_page(swp...
2019 Jun 26
0
[PATCH 12/25] memremap: add a migrate_to_ram method to struct dev_pagemap_ops
...* Wait for refcount in struct dev_pagemap to be idle and reap it. */ void (*cleanup)(struct dev_pagemap *pgmap); + + /* + * Used for private (un-addressable) device memory only. Must migrate + * the page back to a CPU accessible page. + */ + vm_fault_t (*migrate_to_ram)(struct vm_fault *vmf); }; /** diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 4d961668e5fc..15bdb6fe71e5 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -129,12 +129,6 @@ static inline struct page *device_private_entry_to_page(swp_entry_t entry) { return pfn_to_page(swp...
2023 Mar 30
4
[PATCH v2] mm: Take a page reference when removing device exclusive entries
...y's --- mm/memory.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index f456f3b5049c..01a23ad48a04 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3563,8 +3563,21 @@ static vm_fault_t remove_device_exclusive_entry(struct vm_fault *vmf) struct vm_area_struct *vma = vmf->vma; struct mmu_notifier_range range; - if (!folio_lock_or_retry(folio, vma->vm_mm, vmf->flags)) + /* + * We need a reference to lock the folio because we don't hold + * the PTL so a racing thread can remove the device-exclusive + * entry and...
2019 Jun 13
0
[PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops
..._ops { * Transition the percpu_ref in struct dev_pagemap to the dead state. */ void (*kill)(struct dev_pagemap *pgmap); + + /* + * Used for private (un-addressable) device memory only. Must migrate + * the page back to a CPU accessible page. + */ + vm_fault_t (*migrate)(struct vm_fault *vmf); }; /** diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 4d961668e5fc..15bdb6fe71e5 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -129,12 +129,6 @@ static inline struct page *device_private_entry_to_page(swp_entry_t entry) { return pfn_to_page(swp...
2018 Apr 15
0
[RFC] Rewrite page fault interception in TTM drivers
...s/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -102,21 +102,23 @@ static void qxl_ttm_global_fini(struct qxl_device *qdev) } } -static struct vm_operations_struct qxl_ttm_vm_ops; -static const struct vm_operations_struct *ttm_vm_ops; - static int qxl_ttm_fault(struct vm_fault *vmf) { struct ttm_buffer_object *bo; - int r; bo = (struct ttm_buffer_object *)vmf->vma->vm_private_data; if (bo == NULL) return VM_FAULT_NOPAGE; - r = ttm_vm_ops->fault(vmf); - return r; + return ttm_bo_vm_fault(vmf); } +static const struct vm_operations_struct qxl_ttm_vm_ops =...
2020 Sep 09
1
[bug report] drm/nouveau: move io_reserve_lru handling into the driver v5
...ver v5" from Aug 21, 2020, leads to the following static checker warning: drivers/gpu/drm/nouveau/nouveau_ttm.c:148 nouveau_ttm_fault() warn: inconsistent returns '*bo->base.resv'. drivers/gpu/drm/nouveau/nouveau_ttm.c 126 static vm_fault_t nouveau_ttm_fault(struct vm_fault *vmf) 127 { 128 struct vm_area_struct *vma = vmf->vma; 129 struct ttm_buffer_object *bo = vma->vm_private_data; 130 pgprot_t prot; 131 vm_fault_t ret; 132 133 ret = ttm_bo_vm_reserve(bo, vmf); 134 if (ret) 135...
2023 Mar 28
1
[PATCH] mm: Take a page reference when removing device exclusive entries
...<jhubbard at nvidia.com> thanks, -- John Hubbard NVIDIA > > diff --git a/mm/memory.c b/mm/memory.c > index 8c8420934d60..b499bd283d8e 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -3623,8 +3623,19 @@ static vm_fault_t remove_device_exclusive_entry(struct vm_fault *vmf) > struct vm_area_struct *vma = vmf->vma; > struct mmu_notifier_range range; > > - if (!folio_lock_or_retry(folio, vma->vm_mm, vmf->flags)) > + /* > + * We need a page reference to lock the page because we don't > + * hold the PTL so a racing thread can rem...
2019 Aug 08
0
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...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_dmem_fault *fault) +static vm_fault_t nouveau_dmem_fault_copy_one(struct nouveau_drm *drm, + struct vm_fault *vmf, struct migrate_vma *args, + dma_addr_t *dma_addr) { - struct nouveau_drm *drm = fault->drm; struct device *dev = drm->dev->dev; - unsigned long addr, i, npages = 0; - nouveau_migrate_copy_t copy; - int ret; - + struct page *dpage, *spage; + vm_fault_t ret = VM_FAULT_SIGBUS; - /* Fir...
2019 Jun 13
0
[PATCH 11/22] memremap: remove the data field in struct dev_pagemap
...free(page); } else if (!count) __put_page(page); } diff --git a/mm/hmm.c b/mm/hmm.c index aab799677c7d..ff0f9568922b 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -1332,15 +1332,17 @@ static void hmm_devmem_ref_kill(struct dev_pagemap *pgmap) static vm_fault_t hmm_devmem_migrate(struct vm_fault *vmf) { - struct hmm_devmem *devmem = vmf->page->pgmap->data; + struct hmm_devmem *devmem = + container_of(vmf->page->pgmap, struct hmm_devmem, pagemap); return devmem->ops->fault(devmem, vmf->vma, vmf->address, vmf->page, vmf->flags, vmf->pmd); } -static...
2019 Aug 08
1
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...t *vma, > - const unsigned long *src_pfns, > - unsigned long *dst_pfns, > - unsigned long start, > - unsigned long end, > - struct nouveau_dmem_fault *fault) > +static vm_fault_t nouveau_dmem_fault_copy_one(struct nouveau_drm *drm, > + struct vm_fault *vmf, struct migrate_vma *args, > + dma_addr_t *dma_addr) > { > - struct nouveau_drm *drm = fault->drm; > struct device *dev = drm->dev->dev; > - unsigned long addr, i, npages = 0; > - nouveau_migrate_copy_t copy; > - int ret; > - > + struct page *dpage, *spage;...
2020 Jun 01
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...4:22: error: incompatible types when assigning to type 'pgprot_t' {aka 'struct <anonymous>'} from type 'int' cc1: some warnings being treated as errors vim +/pgprot_noncached +754 drivers/vhost/vdpa.c 742 743 static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf) 744 { 745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data; 746 struct vdpa_device *vdpa = v->vdpa; 747 const struct vdpa_config_ops *ops = vdpa->config; 748 struct vdpa_notification_area notify; 749 struct vm_area_struct *vma = vmf->vma; 750 u16...
2020 Jun 01
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...4:22: error: incompatible types when assigning to type 'pgprot_t' {aka 'struct <anonymous>'} from type 'int' cc1: some warnings being treated as errors vim +/pgprot_noncached +754 drivers/vhost/vdpa.c 742 743 static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf) 744 { 745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data; 746 struct vdpa_device *vdpa = v->vdpa; 747 const struct vdpa_config_ops *ops = vdpa->config; 748 struct vdpa_notification_area notify; 749 struct vm_area_struct *vma = vmf->vma; 750 u16...