Commit 96268163 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jason Gunthorpe

mm/hmm: remove the unused HMM_FAULT_ALLOW_RETRY flag

The HMM_FAULT_ALLOW_RETRY isn't used anywhere in the tree.  Remove it and
the weird -EAGAIN handling where handle_mm_fault() drops the mmap_sem.

Link: https://lore.kernel.org/r/20200316135310.899364-3-hch@lst.deSigned-off-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 ddfaed17
...@@ -217,11 +217,6 @@ static inline uint64_t hmm_device_entry_from_pfn(const struct hmm_range *range, ...@@ -217,11 +217,6 @@ static inline uint64_t hmm_device_entry_from_pfn(const struct hmm_range *range,
range->flags[HMM_PFN_VALID]; range->flags[HMM_PFN_VALID];
} }
/*
* Retry fault if non-blocking, drop mmap_sem and return -EAGAIN in that case.
*/
#define HMM_FAULT_ALLOW_RETRY (1 << 0)
/* Don't fault in missing PTEs, just snapshot the current state. */ /* Don't fault in missing PTEs, just snapshot the current state. */
#define HMM_FAULT_SNAPSHOT (1 << 1) #define HMM_FAULT_SNAPSHOT (1 << 1)
......
...@@ -45,16 +45,10 @@ static int hmm_vma_do_fault(struct mm_walk *walk, unsigned long addr, ...@@ -45,16 +45,10 @@ static int hmm_vma_do_fault(struct mm_walk *walk, unsigned long addr,
if (!vma) if (!vma)
goto err; goto err;
if (hmm_vma_walk->flags & HMM_FAULT_ALLOW_RETRY)
flags |= FAULT_FLAG_ALLOW_RETRY;
if (write_fault) if (write_fault)
flags |= FAULT_FLAG_WRITE; flags |= FAULT_FLAG_WRITE;
ret = handle_mm_fault(vma, addr, flags); ret = handle_mm_fault(vma, addr, flags);
if (ret & VM_FAULT_RETRY) {
/* Note, handle_mm_fault did up_read(&mm->mmap_sem)) */
return -EAGAIN;
}
if (ret & VM_FAULT_ERROR) if (ret & VM_FAULT_ERROR)
goto err; goto err;
...@@ -662,7 +656,6 @@ static const struct mm_walk_ops hmm_walk_ops = { ...@@ -662,7 +656,6 @@ static const struct mm_walk_ops hmm_walk_ops = {
* -ENOMEM: Out of memory. * -ENOMEM: Out of memory.
* -EPERM: Invalid permission (e.g., asking for write and range is read * -EPERM: Invalid permission (e.g., asking for write and range is read
* only). * only).
* -EAGAIN: A page fault needs to be retried and mmap_sem was dropped.
* -EBUSY: The range has been invalidated and the caller needs to wait for * -EBUSY: The range has been invalidated and the caller needs to wait for
* the invalidation to finish. * the invalidation to finish.
* -EFAULT: Invalid (i.e., either no valid vma or it is illegal to access * -EFAULT: Invalid (i.e., either no valid vma or it is illegal to access
......
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