[4/8] drm/i915/gt: Delay release of engine-pm after last retirement
diff mbox series

Message ID 20200323092841.22240-4-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [1/8] drm/i915/gt: Mark timeline->cacheline as destroyed after rcu grace period
Related show

Commit Message

Chris Wilson March 23, 2020, 9:28 a.m. UTC
Keep the engine-pm awake until the next jiffie, to avoid immediate
ping-pong under moderate load. (Forcing the idle barrier excerbates the
moderate load, dramatically increasing the driver overhead.) On the
other hand, delaying the idle-barrier slightly incurs longer rc6-off
and so more power consumption.

Closes: https://gitlab.freedesktop.org/drm/intel/issues/848
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_context.c | 2 +-
 drivers/gpu/drm/i915/i915_active.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Tvrtko Ursulin March 23, 2020, 10:14 a.m. UTC | #1
On 23/03/2020 09:28, Chris Wilson wrote:
> Keep the engine-pm awake until the next jiffie, to avoid immediate
> ping-pong under moderate load. (Forcing the idle barrier excerbates the
> moderate load, dramatically increasing the driver overhead.) On the
> other hand, delaying the idle-barrier slightly incurs longer rc6-off
> and so more power consumption.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/issues/848
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/gt/intel_context.c | 2 +-
>   drivers/gpu/drm/i915/i915_active.c      | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
> index e4aece20bc80..622ff425fce9 100644
> --- a/drivers/gpu/drm/i915/gt/intel_context.c
> +++ b/drivers/gpu/drm/i915/gt/intel_context.c
> @@ -350,7 +350,7 @@ void intel_context_enter_engine(struct intel_context *ce)
>   void intel_context_exit_engine(struct intel_context *ce)
>   {
>   	intel_timeline_exit(ce->timeline);
> -	intel_engine_pm_put(ce->engine);
> +	intel_engine_pm_put_delay(ce->engine, 1);
>   }
>   
>   int intel_context_prepare_remote_request(struct intel_context *ce,
> diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c
> index c4048628188a..a0d31f7bfb42 100644
> --- a/drivers/gpu/drm/i915/i915_active.c
> +++ b/drivers/gpu/drm/i915/i915_active.c
> @@ -818,7 +818,7 @@ void i915_active_acquire_barrier(struct i915_active *ref)
>   
>   		GEM_BUG_ON(!intel_engine_pm_is_awake(engine));
>   		llist_add(barrier_to_ll(node), &engine->barrier_tasks);
> -		intel_engine_pm_put(engine);
> +		intel_engine_pm_put_delay(engine, 1);
>   	}
>   }
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
index e4aece20bc80..622ff425fce9 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.c
+++ b/drivers/gpu/drm/i915/gt/intel_context.c
@@ -350,7 +350,7 @@  void intel_context_enter_engine(struct intel_context *ce)
 void intel_context_exit_engine(struct intel_context *ce)
 {
 	intel_timeline_exit(ce->timeline);
-	intel_engine_pm_put(ce->engine);
+	intel_engine_pm_put_delay(ce->engine, 1);
 }
 
 int intel_context_prepare_remote_request(struct intel_context *ce,
diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c
index c4048628188a..a0d31f7bfb42 100644
--- a/drivers/gpu/drm/i915/i915_active.c
+++ b/drivers/gpu/drm/i915/i915_active.c
@@ -818,7 +818,7 @@  void i915_active_acquire_barrier(struct i915_active *ref)
 
 		GEM_BUG_ON(!intel_engine_pm_is_awake(engine));
 		llist_add(barrier_to_ll(node), &engine->barrier_tasks);
-		intel_engine_pm_put(engine);
+		intel_engine_pm_put_delay(engine, 1);
 	}
 }