forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm/hmm: do not write the output pfn array when faulting
The pfn array is an input/output value. If it is written to then hmm_vma_walk->last must be updated so that the next go around the loop does not read a value that is output. hmm_vma_walk_hole_() has a confusing dual purpose, on some of its flows it will destroy the input pfns and return EBUSY. The only case where it is called with a potentially 0 required_fault is in hmm_vma_walk_hole(), so move the fill of HMM_PFN_NONE directly there, and simplify hmm_vma_walk_hole_() into a function with clear purpose: hmm_vma_fault() which always tries to fault and always causes an EBUSY return back to the main loop. The call tree for hmm_vma_fault() now always has a vma (as we can't fault without one), so simplify the flow. All the callbacks besides hmm_vma_walk_hole() have the vma guaranteed by the page walker code. Fixes: 2aee09d ("mm/hmm: change hmm_vma_fault() to allow write fault on page basis") Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
- Loading branch information
1 parent
4048f7f
commit 078e10c
Showing
1 changed file
with
48 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters