Commit cc374377 authored by Ralph Campbell's avatar Ralph Campbell Committed by Jason Gunthorpe

mm/hmm: remove hmm_range vma

Since hmm_range_fault() doesn't use the struct hmm_range vma field, remove
it.

Link: https://lore.kernel.org/r/20190726005650.2566-8-rcampbell@nvidia.comSuggested-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarRalph Campbell <rcampbell@nvidia.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent f527688d
...@@ -496,12 +496,12 @@ nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range) ...@@ -496,12 +496,12 @@ nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range)
range->start, range->end, range->start, range->end,
PAGE_SHIFT); PAGE_SHIFT);
if (ret) { if (ret) {
up_read(&range->vma->vm_mm->mmap_sem); up_read(&range->hmm->mm->mmap_sem);
return (int)ret; return (int)ret;
} }
if (!hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT)) { if (!hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT)) {
up_read(&range->vma->vm_mm->mmap_sem); up_read(&range->hmm->mm->mmap_sem);
return -EBUSY; return -EBUSY;
} }
...@@ -509,7 +509,7 @@ nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range) ...@@ -509,7 +509,7 @@ nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range)
if (ret <= 0) { if (ret <= 0) {
if (ret == 0) if (ret == 0)
ret = -EBUSY; ret = -EBUSY;
up_read(&range->vma->vm_mm->mmap_sem); up_read(&range->hmm->mm->mmap_sem);
hmm_range_unregister(range); hmm_range_unregister(range);
return ret; return ret;
} }
...@@ -682,7 +682,6 @@ nouveau_svm_fault(struct nvif_notify *notify) ...@@ -682,7 +682,6 @@ nouveau_svm_fault(struct nvif_notify *notify)
args.i.p.addr + args.i.p.size, fn - fi); args.i.p.addr + args.i.p.size, fn - fi);
/* Have HMM fault pages within the fault window to the GPU. */ /* Have HMM fault pages within the fault window to the GPU. */
range.vma = vma;
range.start = args.i.p.addr; range.start = args.i.p.addr;
range.end = args.i.p.addr + args.i.p.size; range.end = args.i.p.addr + args.i.p.size;
range.pfns = args.phys; range.pfns = args.phys;
......
...@@ -164,7 +164,6 @@ enum hmm_pfn_value_e { ...@@ -164,7 +164,6 @@ enum hmm_pfn_value_e {
*/ */
struct hmm_range { struct hmm_range {
struct hmm *hmm; struct hmm *hmm;
struct vm_area_struct *vma;
struct list_head list; struct list_head list;
unsigned long start; unsigned long start;
unsigned long end; unsigned long end;
......
...@@ -1002,7 +1002,6 @@ long hmm_range_fault(struct hmm_range *range, unsigned int flags) ...@@ -1002,7 +1002,6 @@ long hmm_range_fault(struct hmm_range *range, unsigned int flags)
return -EPERM; return -EPERM;
} }
range->vma = vma;
hmm_vma_walk.pgmap = NULL; hmm_vma_walk.pgmap = NULL;
hmm_vma_walk.last = start; hmm_vma_walk.last = start;
hmm_vma_walk.flags = flags; hmm_vma_walk.flags = flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment