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

Chris Wilson chris at chris-wilson.co.uk
Thu Jul 4 10:26:31 UTC 2019


Quoting Mika Kuoppala (2019-07-04 11:22:17)
> 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.

Ordering is important here. The problem with drain_workqueue() is that
is forbids us from adding more tasks into the workqueue as it drains, so
before we drain we must plug.

It's just adding more hammers. Eventually it'll break.
-Chris


More information about the Intel-gfx mailing list