[Intel-gfx] [PATCH 2/2] drm/i915: Serialise userptr gup with mmu-notifier

Chris Wilson chris at chris-wilson.co.uk
Thu Jul 10 11:32:35 CEST 2014


On Thu, Jul 10, 2014 at 10:21:44AM +0100, Chris Wilson wrote:
> Jerome Glisse pointed out that get_user_pages() does not synchronize
> with concurrent invalidations of the VMA. As such if the backing vma is
> changed whilst the pages for the object are being grabbed for use by the
> GPU, we may end up with a random mixture of page references being held.
> Worse still as the mmu-notifier will believe that the VMA invalidation
> was complete and the old page references dropped.
> 
> In order to serialise gup with mmu-notifier, we use a seqlock to detect
> when an invalidation has occurred in parallel to our gup and if so cancel
> the gup. The detection is a little coarse, but hopefully we never see
> contention here!

Hmm. This is bogus. I thought the gup_fast path was racy, but is
serialised correctly with invalidate-range.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list