[Intel-gfx] [PATCH 3/3] drm/i915: Flush the workqueue before draining

Mika Kuoppala mika.kuoppala at linux.intel.com
Thu Jul 4 10:22:17 UTC 2019


Chris Wilson <chris at chris-wilson.co.uk> writes:

> Trying to drain a workqueue while we may still be adding to it from
> background tasks is, according to kernel/workqueue.c, verboten. So, add
> a flush_workqueue() at the start of our cleanup procedure.

I don't get it. drain_workqueue does it's own flushing.
-Mika

>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_drv.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 9d132c9d17b0..d2f9af3a16dc 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2472,6 +2472,7 @@ static inline void i915_gem_drain_workqueue(struct drm_i915_private *i915)
>  	 */
>  	int pass = 3;
>  	do {
> +		flush_workqueue(i915->wq);
>  		rcu_barrier();
>  		i915_gem_drain_freed_objects(i915);
>  	} while (--pass);
> -- 
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list