diff mbox

[02/62] drm/i915: Do not keep postponing the idle-work

Message ID 1464971847-15809-3-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson June 3, 2016, 4:36 p.m. UTC
Rather than persistently postponing the idle-work everytime somebody
calls i915_gem_retire_requests() (potentially ensuring that we never
reach the idle state), queue the work the first time we detect all
requests are complete. Then if in 100ms, more requests have been queued,
we will abort the idle-worker and wait again until all the new requests
have been completed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Joonas Lahtinen June 7, 2016, 11:34 a.m. UTC | #1
On pe, 2016-06-03 at 17:36 +0100, Chris Wilson wrote:
> Rather than persistently postponing the idle-work everytime somebody
> calls i915_gem_retire_requests() (potentially ensuring that we never
> reach the idle state), queue the work the first time we detect all
> requests are complete. Then if in 100ms, more requests have been queued,
> we will abort the idle-worker and wait again until all the new requests
> have been completed.
> 

This does depend on the previous patch, might be worth rewording to
bring that up. But it makes much more sense to me.

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 5a7131b749a2..e27c9331b84b 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3000,9 +3000,9 @@ void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
>  	}
>  
>  	if (dev_priv->gt.active_engines == 0)
> -		mod_delayed_work(dev_priv->wq,
> -				 &dev_priv->gt.idle_work,
> -				 msecs_to_jiffies(100));
> +		queue_delayed_work(dev_priv->wq,
> +				   &dev_priv->gt.idle_work,
> +				   msecs_to_jiffies(100));
>  }
>  
>  static void
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5a7131b749a2..e27c9331b84b 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3000,9 +3000,9 @@  void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
 	}
 
 	if (dev_priv->gt.active_engines == 0)
-		mod_delayed_work(dev_priv->wq,
-				 &dev_priv->gt.idle_work,
-				 msecs_to_jiffies(100));
+		queue_delayed_work(dev_priv->wq,
+				   &dev_priv->gt.idle_work,
+				   msecs_to_jiffies(100));
 }
 
 static void