[Intel-gfx] [PATCH v3 12/14] drm/i915/guc: Preemption! With GuC

Chris Wilson chris at chris-wilson.co.uk
Thu Oct 19 19:14:33 UTC 2017


Quoting MichaƂ Winiarski (2017-10-19 19:36:17)
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index ef14c6d570dc..7d52baf4f3bd 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2904,6 +2904,16 @@ i915_gem_reset_prepare_engine(struct intel_engine_cs *engine)
>         tasklet_kill(&engine->execlists.irq_tasklet);
>         tasklet_disable(&engine->execlists.irq_tasklet);
>  
> +       /*
> +        * We're using worker to queue preemption requests from the tasklet in
> +        * GuC submission mode.
> +        * Even though tasklet was disabled, we may still have a worker queued.
> +        * Let's make sure that all workers scheduled before disabling the
> +        * tasklet are completed before continuing with the reset.
> +        */
> +       if (i915_modparams.enable_guc_submission)

Don't we have engine->i915->guc.preempt_ctx or something a bit more
specific than a modparam?

> +               flush_workqueue(engine->i915->guc.preempt_wq);

Ok, after some thought, this is the preferred order. If we do the flush
early, we may end up a worker queued before we kill the tasklet. Too
late and tasklet_action spins a little; that's better than parallel
writes into the hw.
-Chris


More information about the Intel-gfx mailing list