diff options
| author | Jason Gunthorpe <[email protected]> | 2019-07-24 08:52:58 +0200 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2019-07-25 16:14:40 -0300 |
| commit | e709accc7670a07b2e5186449f0640c2416662ec (patch) | |
| tree | e110126f0ec2ba46b4712d2556b19545400e4f67 | |
| parent | f32471e2cf87112b8f5dc10469b27c39c1a41722 (diff) | |
mm/hmm: comment on VM_FAULT_RETRY semantics in handle_mm_fault
The magic dropping of mmap_sem when handle_mm_fault returns VM_FAULT_RETRY
is rather subtile. Add a comment explaining it.
Link: https://lore.kernel.org/r/[email protected]
Tested-by: Ralph Campbell <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
[hch: wrote a changelog]
Signed-off-by: Christoph Hellwig <[email protected]>
| -rw-r--r-- | mm/hmm.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -301,8 +301,10 @@ static int hmm_vma_do_fault(struct mm_walk *walk, unsigned long addr, flags |= hmm_vma_walk->block ? 0 : FAULT_FLAG_ALLOW_RETRY; flags |= write_fault ? FAULT_FLAG_WRITE : 0; ret = handle_mm_fault(vma, addr, flags); - if (ret & VM_FAULT_RETRY) + if (ret & VM_FAULT_RETRY) { + /* Note, handle_mm_fault did up_read(&mm->mmap_sem)) */ return -EAGAIN; + } if (ret & VM_FAULT_ERROR) { *pfn = range->values[HMM_PFN_ERROR]; return -EFAULT; |