[Intel-gfx] [PATCH] drm/i915: Always kick the execlists tasklet after reset

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 15 10:14:42 UTC 2019


Quoting Mika Kuoppala (2019-03-15 10:10:20)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> > +static inline bool __tasklet_enable(struct tasklet_struct *t)
> > +{
> > +     return atomic_dec_and_test(&t->count);
> > +}
> > +
> >  #endif /* __I915_GEM_H__ */
> > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> > index dc3de09c7586..b2d0e16645c7 100644
> > --- a/drivers/gpu/drm/i915/intel_lrc.c
> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > @@ -2030,7 +2030,8 @@ static void execlists_reset_finish(struct intel_engine_cs *engine)
> >       if (!RB_EMPTY_ROOT(&execlists->queue.rb_root))
> >               execlists->tasklet.func(execlists->tasklet.data);
> >  
> > -     tasklet_enable(&execlists->tasklet);
> > +     if (__tasklet_enable(&execlists->tasklet))
> > +             tasklet_hi_schedule(&execlists->tasklet);
> 
> Why not just go fully unconditional, enable and schedule?

If we schedule before we finish the reset, the tasklet busyspins, get's
kicked to ksoftirqd, which then busyspins for its timeslice and gets
bumped around by the scheduler until finally ready.
-Chris


More information about the Intel-gfx mailing list