Re: [Intel-gfx] [PATCH] drm/i915/execlists: Remove incorrect BUG_ON for schedule-out

2019-09-09 Thread Chris Wilson
Quoting Tvrtko Ursulin (2019-09-09 11:23:56)
> 
> On 07/09/2019 11:50, Chris Wilson wrote:
> > As we may unwind incomplete requests (for preemption) prior to
> > processing the CSB and the schedule-out events, we may update rq->engine
> > (resetting it to point back to the parent virtual engine) prior to
> > calling execlists_schedule_out(), invalidating the assertion that the
> > request still points to the inflight engine. (The likelihood of this is
> > increased if the CSB interrupt processing is pushed to the ksoftirqd for
> > being too slow and direct submission overtakes it.)
> > 
> > Reported-by: Vinay Belgaumkar 
> > Fixes: df403069029d ("drm/i915/execlists: Lift process_csb() out of the 
> > irq-off spinlock")
> > Signed-off-by: Chris Wilson 
> > Cc: Mika Kuoppala 
> > Cc: Tvrtko Ursulin 
> > Cc: Vinay Belgaumkar 
> > ---
> >   drivers/gpu/drm/i915/gt/intel_lrc.c | 1 -
> >   1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c 
> > b/drivers/gpu/drm/i915/gt/intel_lrc.c
> > index 3aad35b570d4..16f226349525 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> > @@ -631,7 +631,6 @@ execlists_schedule_out(struct i915_request *rq)
> >   struct intel_engine_cs *cur, *old;
> >   
> >   trace_i915_request_out(rq);
> > - GEM_BUG_ON(intel_context_inflight(ce) != rq->engine);
> >   
> >   old = READ_ONCE(ce->inflight);
> >   do
> > 
> 
> So unwind from direct submission resets rq->engine and races with 
> process_csb from the tasklet which notices request has actually 
> completed?

Yup. That's nice and succinct compared to my waffle.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH] drm/i915/execlists: Remove incorrect BUG_ON for schedule-out

2019-09-09 Thread Tvrtko Ursulin


On 07/09/2019 11:50, Chris Wilson wrote:

As we may unwind incomplete requests (for preemption) prior to
processing the CSB and the schedule-out events, we may update rq->engine
(resetting it to point back to the parent virtual engine) prior to
calling execlists_schedule_out(), invalidating the assertion that the
request still points to the inflight engine. (The likelihood of this is
increased if the CSB interrupt processing is pushed to the ksoftirqd for
being too slow and direct submission overtakes it.)

Reported-by: Vinay Belgaumkar 
Fixes: df403069029d ("drm/i915/execlists: Lift process_csb() out of the irq-off 
spinlock")
Signed-off-by: Chris Wilson 
Cc: Mika Kuoppala 
Cc: Tvrtko Ursulin 
Cc: Vinay Belgaumkar 
---
  drivers/gpu/drm/i915/gt/intel_lrc.c | 1 -
  1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c 
b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 3aad35b570d4..16f226349525 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -631,7 +631,6 @@ execlists_schedule_out(struct i915_request *rq)
struct intel_engine_cs *cur, *old;
  
  	trace_i915_request_out(rq);

-   GEM_BUG_ON(intel_context_inflight(ce) != rq->engine);
  
  	old = READ_ONCE(ce->inflight);

do



So unwind from direct submission resets rq->engine and races with 
process_csb from the tasklet which notices request has actually 
completed? Seems to hold true in code.


Reviewed-by: Tvrtko Ursulin 

Regards,

Tvrtko
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx