On Thu, Mar 28, 2019 at 08:56:54PM -0400, Jerome Glisse wrote:
> On Thu, Mar 28, 2019 at 09:12:21AM -0700, Ira Weiny wrote:
> > On Mon, Mar 25, 2019 at 10:40:06AM -0400, Jerome Glisse wrote:
> > > From: Jérôme Glisse <jgli...@redhat.com>
> > > 

[snip]

> > > +/*
> > > + * HMM_RANGE_DEFAULT_TIMEOUT - default timeout (ms) when waiting for a 
> > > range
> > > + *
> > > + * When waiting for mmu notifiers we need some kind of time out 
> > > otherwise we
> > > + * could potentialy wait for ever, 1000ms ie 1s sounds like a long time 
> > > to
> > > + * wait already.
> > > + */
> > > +#define HMM_RANGE_DEFAULT_TIMEOUT 1000
> > > +
> > >  /* This is a temporary helper to avoid merge conflict between trees. */
> > > +static inline bool hmm_vma_range_done(struct hmm_range *range)
> > > +{
> > > + bool ret = hmm_range_valid(range);
> > > +
> > > + hmm_range_unregister(range);
> > > + return ret;
> > > +}
> > > +
> > >  static inline int hmm_vma_fault(struct hmm_range *range, bool block)
> > >  {
> > > - long ret = hmm_range_fault(range, block);
> > > - if (ret == -EBUSY)
> > > -         ret = -EAGAIN;
> > > - else if (ret == -EAGAIN)
> > > -         ret = -EBUSY;
> > > - return ret < 0 ? ret : 0;
> > > + long ret;
> > > +
> > > + ret = hmm_range_register(range, range->vma->vm_mm,
> > > +                          range->start, range->end);
> > > + if (ret)
> > > +         return (int)ret;
> > > +
> > > + if (!hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT)) {
> > > +         up_read(&range->vma->vm_mm->mmap_sem);
> > > +         return -EAGAIN;
> > > + }
> > > +
> > > + ret = hmm_range_fault(range, block);
> > > + if (ret <= 0) {
> > > +         if (ret == -EBUSY || !ret) {
> > > +                 up_read(&range->vma->vm_mm->mmap_sem);
> > > +                 ret = -EBUSY;
> > > +         } else if (ret == -EAGAIN)
> > > +                 ret = -EBUSY;
> > > +         hmm_range_unregister(range);
> > > +         return ret;
> > > + }
> > > + return 0;
> > 
> > Is hmm_vma_fault() also temporary to keep the nouveau driver working?  It 
> > looks
> > like it to me.
> > 
> > This and hmm_vma_range_done() above are part of the old interface which is 
> > in
> > the Documentation correct?  As stated above we should probably change that
> > documentation with this patch to ensure no new users of these 2 functions
> > appear.
> 
> Ok will update the documentation, note that i already posted patches to use
> this new API see the ODP RDMA link in the cover letter.
> 

Thanks,  Sorry for my previous email on this patch.  After looking more I see
that this is the old interface but this was not clear.  And I have not had time
to follow the previous threads.  I'm finding time to do this now...

Sorry,
Ira

Reply via email to