On Mon, Feb 06, 2017 at 03:57:47PM +0200, Mika Kuoppala wrote: > Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes: > > > In commit 86aa7e760a67 ("drm/i915: Assert that the context-switch > > completion matches our context") I added a read to the irq tasklet > > handler that compared the on-chip status with that of our sw tracking, > > using an unguarded read of the request pointer to get the context and > > beyond. Whilst we hold a reference to the request, we do not hold > > anything on the context and if we are unlucky it may be reaped from a > > second thread retiring the request (since it may retire the request as > > soon as the breadcrumb is complete, even before we finish processing the > > context switch) as we try to read from the context pointer. > > > > Please add warning of the possibility of context vanishing beneath > our feet. Perhaps a good spot is when we store a bug on variable > context_id. I prefer it in ctx-switch, since that is where we are in a softirq section trying to operate under the minimal of locking. -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx