public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Make contexts non-snooped on non-LLC platforms
@ 2014-03-31 15:09 ville.syrjala
  2014-03-31 15:39 ` Chris Wilson
  2014-04-04 13:36 ` [PATCH v2] " ville.syrjala
  0 siblings, 2 replies; 8+ messages in thread
From: ville.syrjala @ 2014-03-31 15:09 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We don't do CPU access to GPU contexts so making the GPU access snoop
the CPU caches seems silly, and potentially expensive.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 6043062..746fb23 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -240,7 +240,7 @@ __create_hw_context(struct drm_device *dev,
 		return ERR_PTR(-ENOMEM);
 	}
 
-	if (INTEL_INFO(dev)->gen >= 7) {
+	if (INTEL_INFO(dev)->gen >= 7 && HAS_LLC(dev)) {
 		ret = i915_gem_object_set_cache_level(ctx->obj,
 						      I915_CACHE_L3_LLC);
 		/* Failure shouldn't ever happen this early */
-- 
1.8.3.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Make contexts non-snooped on non-LLC platforms
  2014-03-31 15:09 [PATCH] drm/i915: Make contexts non-snooped on non-LLC platforms ville.syrjala
@ 2014-03-31 15:39 ` Chris Wilson
  2014-04-01 10:11   ` Ville Syrjälä
  2014-04-04 13:36 ` [PATCH v2] " ville.syrjala
  1 sibling, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2014-03-31 15:39 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

On Mon, Mar 31, 2014 at 06:09:49PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> We don't do CPU access to GPU contexts so making the GPU access snoop
> the CPU caches seems silly, and potentially expensive.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Maybe define a macro to be HAS_L3_CACHE?

The root cause is that our singular enum is not flexible enough to
account for all platform variations.

Otherwise, lgtm.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Make contexts non-snooped on non-LLC platforms
  2014-03-31 15:39 ` Chris Wilson
@ 2014-04-01 10:11   ` Ville Syrjälä
  2014-04-01 10:19     ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Ville Syrjälä @ 2014-04-01 10:11 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Mon, Mar 31, 2014 at 04:39:37PM +0100, Chris Wilson wrote:
> On Mon, Mar 31, 2014 at 06:09:49PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > We don't do CPU access to GPU contexts so making the GPU access snoop
> > the CPU caches seems silly, and potentially expensive.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Maybe define a macro to be HAS_L3_CACHE?

What should I do with such a macro?

> 
> The root cause is that our singular enum is not flexible enough to
> account for all platform variations.
> 
> Otherwise, lgtm.
> -Chris
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Make contexts non-snooped on non-LLC platforms
  2014-04-01 10:11   ` Ville Syrjälä
@ 2014-04-01 10:19     ` Chris Wilson
  2014-04-01 10:37       ` Ville Syrjälä
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2014-04-01 10:19 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

On Tue, Apr 01, 2014 at 01:11:02PM +0300, Ville Syrjälä wrote:
> On Mon, Mar 31, 2014 at 04:39:37PM +0100, Chris Wilson wrote:
> > On Mon, Mar 31, 2014 at 06:09:49PM +0300, ville.syrjala@linux.intel.com wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > We don't do CPU access to GPU contexts so making the GPU access snoop
> > > the CPU caches seems silly, and potentially expensive.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Maybe define a macro to be HAS_L3_CACHE?
> 
> What should I do with such a macro?

I am trying to express what exactly we are testing for here. It is not
exactly LLC we care about, but L3 to hide the context switch latency.
Even though Ben thinks that's a waste of our limited resources.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Make contexts non-snooped on non-LLC platforms
  2014-04-01 10:19     ` Chris Wilson
@ 2014-04-01 10:37       ` Ville Syrjälä
  0 siblings, 0 replies; 8+ messages in thread
From: Ville Syrjälä @ 2014-04-01 10:37 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Tue, Apr 01, 2014 at 11:19:19AM +0100, Chris Wilson wrote:
> On Tue, Apr 01, 2014 at 01:11:02PM +0300, Ville Syrjälä wrote:
> > On Mon, Mar 31, 2014 at 04:39:37PM +0100, Chris Wilson wrote:
> > > On Mon, Mar 31, 2014 at 06:09:49PM +0300, ville.syrjala@linux.intel.com wrote:
> > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > 
> > > > We don't do CPU access to GPU contexts so making the GPU access snoop
> > > > the CPU caches seems silly, and potentially expensive.
> > > > 
> > > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > Maybe define a macro to be HAS_L3_CACHE?
> > 
> > What should I do with such a macro?
> 
> I am trying to express what exactly we are testing for here. It is not
> exactly LLC we care about, but L3 to hide the context switch latency.
> Even though Ben thinks that's a waste of our limited resources.

VLV has L3 too, but we can't control it via the PTEs.

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] drm/i915: Make contexts non-snooped on non-LLC platforms
  2014-03-31 15:09 [PATCH] drm/i915: Make contexts non-snooped on non-LLC platforms ville.syrjala
  2014-03-31 15:39 ` Chris Wilson
@ 2014-04-04 13:36 ` ville.syrjala
  2014-04-04 13:41   ` Chris Wilson
  1 sibling, 1 reply; 8+ messages in thread
From: ville.syrjala @ 2014-04-04 13:36 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We don't do CPU access to GPU contexts so making the GPU access snoop
the CPU caches seems silly, and potentially expensive.

v2: Use !IS_VALLEYVIEW instead of HAS_LLC as this is really
    about what the PTEs can represent.
    Add a comment clarifying the situation.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 8827892..30b355a 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -240,7 +240,15 @@ __create_hw_context(struct drm_device *dev,
 		return ERR_PTR(-ENOMEM);
 	}
 
-	if (INTEL_INFO(dev)->gen >= 7) {
+	/*
+	 * Try to make the context utilize L3 as well as LLC.
+	 *
+	 * On VLV we don't have L3 controls in the PTEs so we
+	 * shouldn't touch the cache level, especially as that
+	 * would make the object snooped which might have a
+	 * negative performance impact.
+	 */
+	if (INTEL_INFO(dev)->gen >= 7 && !IS_VALLEYVIEW(dev)) {
 		ret = i915_gem_object_set_cache_level(ctx->obj,
 						      I915_CACHE_L3_LLC);
 		/* Failure shouldn't ever happen this early */
-- 
1.8.3.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] drm/i915: Make contexts non-snooped on non-LLC platforms
  2014-04-04 13:36 ` [PATCH v2] " ville.syrjala
@ 2014-04-04 13:41   ` Chris Wilson
  2014-04-04 16:00     ` Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2014-04-04 13:41 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

On Fri, Apr 04, 2014 at 04:36:10PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> We don't do CPU access to GPU contexts so making the GPU access snoop
> the CPU caches seems silly, and potentially expensive.
> 
> v2: Use !IS_VALLEYVIEW instead of HAS_LLC as this is really
>     about what the PTEs can represent.
>     Add a comment clarifying the situation.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] drm/i915: Make contexts non-snooped on non-LLC platforms
  2014-04-04 13:41   ` Chris Wilson
@ 2014-04-04 16:00     ` Daniel Vetter
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2014-04-04 16:00 UTC (permalink / raw)
  To: Chris Wilson, ville.syrjala, intel-gfx

On Fri, Apr 04, 2014 at 02:41:00PM +0100, Chris Wilson wrote:
> On Fri, Apr 04, 2014 at 04:36:10PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > We don't do CPU access to GPU contexts so making the GPU access snoop
> > the CPU caches seems silly, and potentially expensive.
> > 
> > v2: Use !IS_VALLEYVIEW instead of HAS_LLC as this is really
> >     about what the PTEs can represent.
> >     Add a comment clarifying the situation.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-04-04 16:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 15:09 [PATCH] drm/i915: Make contexts non-snooped on non-LLC platforms ville.syrjala
2014-03-31 15:39 ` Chris Wilson
2014-04-01 10:11   ` Ville Syrjälä
2014-04-01 10:19     ` Chris Wilson
2014-04-01 10:37       ` Ville Syrjälä
2014-04-04 13:36 ` [PATCH v2] " ville.syrjala
2014-04-04 13:41   ` Chris Wilson
2014-04-04 16:00     ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox