[Intel-gfx] [PATCH 3/3] drm/i915/userptr: Probe vma range before gup
Chris Wilson
chris at chris-wilson.co.uk
Tue Jan 15 10:41:28 UTC 2019
Quoting Tvrtko Ursulin (2019-01-15 10:27:02)
>
> On 14/01/2019 21:17, Chris Wilson wrote:
> > + if (err)
> > + goto err_unlock;
> > +
> > + err = __i915_gem_userptr_get_pages_schedule(obj);
> > + if (err == -EAGAIN)
> > __i915_gem_userptr_set_active(obj, true);
> >
> > - if (IS_ERR(pages))
> > - release_pages(pvec, pinned);
> > - kvfree(pvec);
> > +err_unlock:
> > + up_read(&mm->mmap_sem);
>
> May be safer to drop the lock earlier, immediately after probe. I don't
> see holding it while queuing the worker and doing internal book-keeping
> is useful and might just create more lock chain dependencies.
Hmm, I thought we need to cover up to set-active (probe + queue + insert
into rbtree) as I thought the mmu-invalidate was under the mmap_sem wlock.
-Chris
More information about the Intel-gfx
mailing list