[Intel-gfx] [PATCH] drm/i915: Try harder to finish the idle-worker

Chris Wilson chris at chris-wilson.co.uk
Tue Sep 5 13:43:14 UTC 2017


Quoting Tejun Heo (2017-09-05 14:36:28)
> On Mon, Sep 04, 2017 at 10:35:49AM +0200, Daniel Vetter wrote:
> > On Fri, Sep 01, 2017 at 03:11:23PM +0100, Chris Wilson wrote:
> > > If a worker requeues itself, it may switch to a different kworker pool,
> > > which flush_work() considers as complete. To be strict, we then need to
> > > keep flushing the work until it is no longer pending.
> > > 
> > > References: https://bugs.freedesktop.org/show_bug.cgi?id=102456
> > > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > > Cc: Mika Kuoppala <mika.kuoppala at intel.com>
> > 
> > Shouldn't this be a thing the workqueue subsystem exposes? Adding Tejun et
> > al.
> > -Daniel
> 
> Can't you use cancel[_delayed]_work_sync()?

We then need a loop like:

	do {
		if (cancel_delayed_work_sync(wrk))
			do_work(wrk);
		else
			break;
	} while (1);

We do want the flush semantics.
-Chris


More information about the Intel-gfx mailing list