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

2017-09-05 Thread Tejun Heo
Hello, On Tue, Sep 05, 2017 at 02:43:14PM +0100, Chris Wilson wrote: > > 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 >

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

2017-09-05 Thread Chris Wilson
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

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

2017-09-05 Thread Tejun Heo
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 th

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

2017-09-04 Thread Chris Wilson
Quoting Daniel Vetter (2017-09-04 09:35:49) > 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

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

2017-09-04 Thread Chris Wilson
Quoting Mika Kuoppala (2017-09-04 11:19:09) > Chris Wilson writes: > > +/* > > + * Wait until the work is finally complete, even if it tries to postpone > > + * by requeueing itself. Note, that if the worker never cancels itself, > > + * we will spin forever. > > + */ > > +static inline void drain

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

2017-09-04 Thread Mika Kuoppala
Chris Wilson writes: > 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 > Si

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

2017-09-04 Thread Daniel Vetter
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.fre

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

2017-09-01 Thread Chris Wilson
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 Cc: Mik