Re: [PATCH v4 hmm 12/12] mm/hmm: Fix error flows in hmm_invalidate_range_start

2019-06-27 Thread Jason Gunthorpe
On Wed, Jun 26, 2019 at 11:18:23AM -0700, Ralph Campbell wrote: > > diff --git a/mm/hmm.c b/mm/hmm.c > > index b224ea635a7716..89549eac03d506 100644 > > +++ b/mm/hmm.c > > @@ -64,7 +64,7 @@ static struct hmm *hmm_get_or_create(struct mm_struct *mm) > > init_rwsem(>mirrors_sem); > >

Re: [PATCH v4 hmm 12/12] mm/hmm: Fix error flows in hmm_invalidate_range_start

2019-06-27 Thread Ralph Campbell
On 6/24/19 2:01 PM, Jason Gunthorpe wrote: From: Jason Gunthorpe If the trylock on the hmm->mirrors_sem fails the function will return without decrementing the notifiers that were previously incremented. Since the caller will not call invalidate_range_end() on EAGAIN this will result in

[PATCH v4 hmm 12/12] mm/hmm: Fix error flows in hmm_invalidate_range_start

2019-06-25 Thread Jason Gunthorpe
From: Jason Gunthorpe If the trylock on the hmm->mirrors_sem fails the function will return without decrementing the notifiers that were previously incremented. Since the caller will not call invalidate_range_end() on EAGAIN this will result in notifiers becoming permanently incremented and