aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Glisse <[email protected]>2019-05-13 17:19:52 -0700
committerLinus Torvalds <[email protected]>2019-05-14 09:47:48 -0700
commit9f454612f602d02204b1f6e86b6bec2bfb368c4b (patch)
tree5ffd615b4ed473f76e411e59f6e3e24ca07f4c37
parent704f3f2cf63cdb76925ac2ff432182c73574b20b (diff)
mm/hmm: do not erase snapshot when a range is invalidated
Users of HMM might be using the snapshot information to do preparatory step like dma mapping pages to a device before checking for invalidation through hmm_vma_range_done() so do not erase that information and assume users will do the right thing. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jérôme Glisse <[email protected]> Reviewed-by: Ralph Campbell <[email protected]> Reviewed-by: John Hubbard <[email protected]> Cc: Dan Williams <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Ira Weiny <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Souptick Joarder <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/hmm.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/mm/hmm.c b/mm/hmm.c
index 919d78fd21c5..84e0577a912a 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -174,16 +174,10 @@ static int hmm_invalidate_range(struct hmm *hmm, bool device,
spin_lock(&hmm->lock);
list_for_each_entry(range, &hmm->ranges, list) {
- unsigned long addr, idx, npages;
-
if (update->end < range->start || update->start >= range->end)
continue;
range->valid = false;
- addr = max(update->start, range->start);
- idx = (addr - range->start) >> PAGE_SHIFT;
- npages = (min(range->end, update->end) - addr) >> PAGE_SHIFT;
- memset(&range->pfns[idx], 0, sizeof(*range->pfns) * npages);
}
spin_unlock(&hmm->lock);