All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fino Meng <fino.meng@linux.intel.com>
To: Fino Meng <fino.meng@linux.intel.com>
Cc: xenomai@xenomai.org
Subject: Re: [PATCH 2/2] drm/i195: control LLC CLOS for gpu via debugfs interface
Date: Sun, 21 Feb 2021 23:12:28 +0800	[thread overview]
Message-ID: <20210221151227.GA22504@linux.intel.com> (raw)
In-Reply-To: <20210221150136.22456-1-fino.meng@linux.intel.com>


these 2 patches:
"drm/i915/pm: support disable SAGV via debugfs interface" and
"drm/i195: control LLC CLOS for gpu via debugfs interface"
are for deterministic tuning, tested on x86_64's kernel 5.4 branch.

if think them OK for merged into IPIPE patches, I will send 4.19 version
also.

BR/Fino

On Sun, Feb 21, 2021 at 11:01:36PM +0800, Fino Meng via Xenomai wrote:
> On CPU side, the Intel CAT(Cache-Allocation-Technology) can partition the
> LLC (Last-Level-Cache). However, when LLC is shared between CPU and GPU,
> GPU has no notion about the LLC partitions thus can thrash the cache lines.
> By default the graphics device is configured to use as much of cache as
> possible.
> 
> There is a register field to set CLOS(Class of Service) which restrict
> the GPU's LLC usage globally to one of the supported CLOS levels. When
> writes the minimum CLOS (3) to this debugfs file, the cache usage
> for both render and non-render targets will be restricted to the top
> 1/16th way of the cache (for 16 way cache).
> 
> CAUTION: this patch is a work around operation, formal solution is not
> merged into Linux upstream yet. The allocation of certain LLC ways to
> different class of service settings is a project dependent decision
> and listed in the Bspec.
> 
> Ref:
> https://01.org/sites/default/files/documentation/
> intel-gfx-prm-osrc-kbl-vol05-memory_views.pdf
> https://lists.freedesktop.org/archives/intel-gfx/2019-October/216196.html
> 
> [Fino: original patch was from Reinette Chatre]
> Signed-off-by: Fino Meng <fino.meng@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index eefeb3994d1d..0e28b499fd5a 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -3684,7 +3684,7 @@ i915_cache_sharing_get(void *data, u64 *val)
>  	intel_wakeref_t wakeref;
>  	u32 snpcr = 0;
>  
> -	if (!(IS_GEN_RANGE(dev_priv, 6, 7)))
> +	if (!(IS_GEN_RANGE(dev_priv, 6, 12)))
>  		return -ENODEV;
>  
>  	with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref)
> @@ -3701,7 +3701,7 @@ i915_cache_sharing_set(void *data, u64 val)
>  	struct drm_i915_private *dev_priv = data;
>  	intel_wakeref_t wakeref;
>  
> -	if (!(IS_GEN_RANGE(dev_priv, 6, 7)))
> +	if (!(IS_GEN_RANGE(dev_priv, 6, 12)))
>  		return -ENODEV;
>  
>  	if (val > 3)
> @@ -3716,6 +3716,7 @@ i915_cache_sharing_set(void *data, u64 val)
>  		snpcr &= ~GEN6_MBC_SNPCR_MASK;
>  		snpcr |= val << GEN6_MBC_SNPCR_SHIFT;
>  		I915_WRITE(GEN6_MBCUNIT_SNPCR, snpcr);
> +		I915_WRITE(HSW_IDICR, I915_READ(HSW_IDICR) | IDIHASHMSK(0xf) | val << 22);
>  	}
>  
>  	return 0;
> -- 
> 2.20.1
> 
> 


  reply	other threads:[~2021-02-21 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 15:01 [PATCH 2/2] drm/i195: control LLC CLOS for gpu via debugfs interface Fino Meng
2021-02-21 15:12 ` Fino Meng [this message]
2021-02-23  7:32   ` Jan Kiszka

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=20210221151227.GA22504@linux.intel.com \
    --to=fino.meng@linux.intel.com \
    --cc=xenomai@xenomai.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.