All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/selftests: Disable C-states when measuring RPS frequency response
Date: Tue, 21 Apr 2020 17:45:25 +0300	[thread overview]
Message-ID: <871rognbi2.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20200421142236.8614-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Let's isolate the impact of cpu frequency selection on determing the GPU
> throughput in response to selection of RPS frequencies.
>
> For real systems, we do have to be concerned with the impact of
> integrating c-states, p-states and rp-states, but for the sake of
> proving whether or not RPS works, one baby step at a time.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>


> ---
>  drivers/gpu/drm/i915/gt/selftest_rps.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_rps.c b/drivers/gpu/drm/i915/gt/selftest_rps.c
> index 395265121e43..e2afc2003caa 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_rps.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_rps.c
> @@ -3,6 +3,7 @@
>   * Copyright © 2020 Intel Corporation
>   */
>  
> +#include <linux/pm_qos.h>
>  #include <linux/sort.h>
>  
>  #include "intel_engine_pm.h"
> @@ -14,6 +15,9 @@
>  #include "selftests/igt_spinner.h"
>  #include "selftests/librapl.h"
>  
> +/* Try to isolate the impact of cstates from determing frequency response */
> +#define CPU_LATENCY 0 /* -1 to disable pm_qos, 0 to disable cstates */
> +
>  static void dummy_rps_work(struct work_struct *wrk)
>  {
>  }
> @@ -406,6 +410,7 @@ int live_rps_frequency_cs(void *arg)
>  	struct intel_gt *gt = arg;
>  	struct intel_rps *rps = &gt->rps;
>  	struct intel_engine_cs *engine;
> +	struct pm_qos_request qos;
>  	enum intel_engine_id id;
>  	int err = 0;
>  
> @@ -421,6 +426,9 @@ int live_rps_frequency_cs(void *arg)
>  	if (INTEL_GEN(gt->i915) < 8) /* for CS simplicity */
>  		return 0;
>  
> +	if (CPU_LATENCY >= 0)
> +		cpu_latency_qos_add_request(&qos, CPU_LATENCY);
> +
>  	intel_gt_pm_wait_for_idle(gt);
>  	saved_work = rps->work.func;
>  	rps->work.func = dummy_rps_work;
> @@ -527,6 +535,9 @@ int live_rps_frequency_cs(void *arg)
>  	intel_gt_pm_wait_for_idle(gt);
>  	rps->work.func = saved_work;
>  
> +	if (CPU_LATENCY >= 0)
> +		cpu_latency_qos_remove_request(&qos);
> +
>  	return err;
>  }
>  
> @@ -536,6 +547,7 @@ int live_rps_frequency_srm(void *arg)
>  	struct intel_gt *gt = arg;
>  	struct intel_rps *rps = &gt->rps;
>  	struct intel_engine_cs *engine;
> +	struct pm_qos_request qos;
>  	enum intel_engine_id id;
>  	int err = 0;
>  
> @@ -551,6 +563,9 @@ int live_rps_frequency_srm(void *arg)
>  	if (INTEL_GEN(gt->i915) < 8) /* for CS simplicity */
>  		return 0;
>  
> +	if (CPU_LATENCY >= 0)
> +		cpu_latency_qos_add_request(&qos, CPU_LATENCY);
> +
>  	intel_gt_pm_wait_for_idle(gt);
>  	saved_work = rps->work.func;
>  	rps->work.func = dummy_rps_work;
> @@ -656,6 +671,9 @@ int live_rps_frequency_srm(void *arg)
>  	intel_gt_pm_wait_for_idle(gt);
>  	rps->work.func = saved_work;
>  
> +	if (CPU_LATENCY >= 0)
> +		cpu_latency_qos_remove_request(&qos);
> +
>  	return err;
>  }
>  
> -- 
> 2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-04-21 14:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 14:22 [Intel-gfx] [PATCH] drm/i915/selftests: Disable C-states when measuring RPS frequency response Chris Wilson
2020-04-21 14:45 ` Mika Kuoppala [this message]
2020-04-21 15:21 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rognbi2.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.