[Intel-gfx] [PATCH] drm/i915: Take reference for signaling the request from hardirq

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 3 14:59:05 UTC 2017


On Fri, Mar 03, 2017 at 04:52:52PM +0200, Mika Kuoppala wrote:
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> 
> > Being inside a spinlock signaling that the hardware just completed a
> > request doesn't prevent a second thread already spotting that the
> > request is complete, freeing it and reallocating it! The code currently
> > tries to prevent this using RCU -- but that only prevents the request
> > from being freed, it doesn't prevent us from reallocating it - that
> > requires us to take a reference.
> 
> How can it be reallocated if it was never freed in the first place?

We use a slab-cache. The pages of the slab themselves are guarded by
RCU, but we reallocate from the freelist immediately.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list