[2/2] drm/i915/gt: Leave rps->cur_freq on unpark
diff mbox series

Message ID 20200322163225.28791-2-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [1/2] drm/i915/gt: Treat idling as a RPS downclock event
Related show

Commit Message

Chris Wilson March 22, 2020, 4:32 p.m. UTC
Don't override our previous frequency we used after parking, and avoid
continually spiking back to the efficient frequency for mostly idle
workloads. Trust our ability to autotune across a workload switch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Lyude Paul <lyude@redhat.com>
---
 drivers/gpu/drm/i915/gt/intel_rps.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Andi Shyti March 22, 2020, 8:37 p.m. UTC | #1
Hi Chris,

On Sun, Mar 22, 2020 at 04:32:25PM +0000, Chris Wilson wrote:
> Don't override our previous frequency we used after parking, and avoid
> continually spiking back to the efficient frequency for mostly idle
> workloads. Trust our ability to autotune across a workload switch.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Andi Shyti <andi.shyti@intel.com>
> Cc: Lyude Paul <lyude@redhat.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_rps.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c
> index 50884aeac49c..487c89593125 100644
> --- a/drivers/gpu/drm/i915/gt/intel_rps.c
> +++ b/drivers/gpu/drm/i915/gt/intel_rps.c
> @@ -187,10 +187,8 @@ static void gen5_rps_init(struct intel_rps *rps)
>  		fmax, fmin, fstart);
>  
>  	rps->min_freq = fmax;
> +	rps->efficient_freq = fstart;
>  	rps->max_freq = fmin;
> -
> -	rps->idle_freq = rps->min_freq;
> -	rps->cur_freq = rps->idle_freq;
>  }
>  
>  static unsigned long
> @@ -726,7 +724,6 @@ void intel_rps_unpark(struct intel_rps *rps)
>  
>  	WRITE_ONCE(rps->active, true);
>  
> -	freq = max(rps->cur_freq, rps->efficient_freq),
>  	freq = clamp(freq, rps->min_freq_softlimit, rps->max_freq_softlimit);
>  	intel_rps_set(rps, freq);
>  
> @@ -1672,7 +1669,7 @@ void intel_rps_init(struct intel_rps *rps)
>  	/* Finally allow us to boost to max by default */
>  	rps->boost_freq = rps->max_freq;
>  	rps->idle_freq = rps->min_freq;
> -	rps->cur_freq = rps->idle_freq;
> +	rps->cur_freq = rps->efficient_freq; /* start in the middle */

right... thank you!

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

Thanks,
Andi

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c
index 50884aeac49c..487c89593125 100644
--- a/drivers/gpu/drm/i915/gt/intel_rps.c
+++ b/drivers/gpu/drm/i915/gt/intel_rps.c
@@ -187,10 +187,8 @@  static void gen5_rps_init(struct intel_rps *rps)
 		fmax, fmin, fstart);
 
 	rps->min_freq = fmax;
+	rps->efficient_freq = fstart;
 	rps->max_freq = fmin;
-
-	rps->idle_freq = rps->min_freq;
-	rps->cur_freq = rps->idle_freq;
 }
 
 static unsigned long
@@ -726,7 +724,6 @@  void intel_rps_unpark(struct intel_rps *rps)
 
 	WRITE_ONCE(rps->active, true);
 
-	freq = max(rps->cur_freq, rps->efficient_freq),
 	freq = clamp(freq, rps->min_freq_softlimit, rps->max_freq_softlimit);
 	intel_rps_set(rps, freq);
 
@@ -1672,7 +1669,7 @@  void intel_rps_init(struct intel_rps *rps)
 	/* Finally allow us to boost to max by default */
 	rps->boost_freq = rps->max_freq;
 	rps->idle_freq = rps->min_freq;
-	rps->cur_freq = rps->idle_freq;
+	rps->cur_freq = rps->efficient_freq; /* start in the middle */
 
 	rps->pm_intrmsk_mbz = 0;