diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2020-03-11 21:03:33 +0100 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2020-03-26 18:33:37 +0100 |
commit | 24cee8ab41eec51ea4cabd19c311719038084648 (patch) | |
tree | 1dc883b8ec8c9a807304fdb76ccaf15937fdc47c /mm/hmm.c | |
parent | mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL handling (diff) | |
download | linux-24cee8ab41eec51ea4cabd19c311719038084648.tar.xz linux-24cee8ab41eec51ea4cabd19c311719038084648.zip |
mm/hmm: do not check pmd_protnone twice in hmm_vma_handle_pmd()
pmd_to_hmm_pfn_flags() already checks it and makes the cpu flags 0. If no
fault is requested then the pfns should be returned with the not valid
flags.
It should not unconditionally fault if faulting is not requested.
Fixes: 2aee09d8c116 ("mm/hmm: change hmm_vma_fault() to allow write fault on page basis")
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'mm/hmm.c')
-rw-r--r-- | mm/hmm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -226,7 +226,7 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, hmm_range_need_fault(hmm_vma_walk, pfns, npages, cpu_flags, &fault, &write_fault); - if (pmd_protnone(pmd) || fault || write_fault) + if (fault || write_fault) return hmm_vma_walk_hole_(addr, end, fault, write_fault, walk); pfn = pmd_pfn(pmd) + ((addr & ~PMD_MASK) >> PAGE_SHIFT); |