[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190325144011.10560-4-jglisse@redhat.com>
Date: Mon, 25 Mar 2019 10:40:03 -0400
From: jglisse@...hat.com
To: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org,
Jérôme Glisse <jglisse@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>
Subject: [PATCH v2 03/11] mm/hmm: do not erase snapshot when a range is invalidated
From: Jérôme Glisse <jglisse@...hat.com>
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.
Signed-off-by: Jérôme Glisse <jglisse@...hat.com>
Reviewed-by: Ralph Campbell <rcampbell@...dia.com>
Reviewed-by: John Hubbard <jhubbard@...dia.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Dan Williams <dan.j.williams@...el.com>
---
mm/hmm.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/mm/hmm.c b/mm/hmm.c
index 306e57f7cded..213b0beee8d3 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -170,16 +170,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);
--
2.17.2
Powered by blists - more mailing lists