Re: [PATCH 2/2] mm/hmm: make full use of walk_page_range()

2019-07-24 Thread Ralph Campbell
On 7/24/19 4:53 AM, Jason Gunthorpe wrote: On Wed, Jul 24, 2019 at 08:51:46AM +0200, Christoph Hellwig wrote: On Tue, Jul 23, 2019 at 04:30:16PM -0700, Ralph Campbell wrote: hmm_range_snapshot() and hmm_range_fault() both call find_vma() and walk_page_range() in a loop. This is unnecessary

Re: [PATCH 2/2] mm/hmm: make full use of walk_page_range()

2019-07-24 Thread Jason Gunthorpe
On Wed, Jul 24, 2019 at 08:51:46AM +0200, Christoph Hellwig wrote: > On Tue, Jul 23, 2019 at 04:30:16PM -0700, Ralph Campbell wrote: > > hmm_range_snapshot() and hmm_range_fault() both call find_vma() and > > walk_page_range() in a loop. This is unnecessary duplication since > > walk_page_range()

Re: [PATCH 2/2] mm/hmm: make full use of walk_page_range()

2019-07-24 Thread Christoph Hellwig
On Tue, Jul 23, 2019 at 04:30:16PM -0700, Ralph Campbell wrote: > hmm_range_snapshot() and hmm_range_fault() both call find_vma() and > walk_page_range() in a loop. This is unnecessary duplication since > walk_page_range() calls find_vma() in a loop already. > Simplify hmm_range_snapshot() and

[PATCH 2/2] mm/hmm: make full use of walk_page_range()

2019-07-23 Thread Ralph Campbell
hmm_range_snapshot() and hmm_range_fault() both call find_vma() and walk_page_range() in a loop. This is unnecessary duplication since walk_page_range() calls find_vma() in a loop already. Simplify hmm_range_snapshot() and hmm_range_fault() by defining a walk_test() callback function to filter