All of lore.kernel.org
 help / color / mirror / Atom feed
* [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu()
@ 2016-08-09  7:37 Chris Wilson
  2016-08-09  7:37 ` [CI 2/3] drm/i915: Wrap the protected active RCU dereference in a helper Chris Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Chris Wilson @ 2016-08-09  7:37 UTC (permalink / raw)
  To: intel-gfx

This was originally introduced to be used by the busy-ioctl, but in the
end busy ioctl performed a different dance. Since there are no users,
and no likely users, remove an unwanted chunk of the API.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem_request.h | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
index 3496e28785e7..583e237b98d1 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.h
+++ b/drivers/gpu/drm/i915/i915_gem_request.h
@@ -381,27 +381,6 @@ i915_gem_active_peek(const struct i915_gem_active *active, struct mutex *mutex)
 }
 
 /**
- * i915_gem_active_peek_rcu - report the active request being monitored
- * @active - the active tracker
- *
- * i915_gem_active_peek_rcu() returns the current request being tracked if
- * still active, or NULL. It does not obtain a reference on the request
- * for the caller, and inspection of the request is only valid under
- * the RCU lock.
- */
-static inline struct drm_i915_gem_request *
-i915_gem_active_peek_rcu(const struct i915_gem_active *active)
-{
-	struct drm_i915_gem_request *request;
-
-	request = rcu_dereference(active->request);
-	if (!request || i915_gem_request_completed(request))
-		return NULL;
-
-	return request;
-}
-
-/**
  * i915_gem_active_get - return a reference to the active request
  * @active - the active tracker
  *
-- 
2.8.1

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

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

* [CI 2/3] drm/i915: Wrap the protected active RCU dereference in a helper
  2016-08-09  7:37 [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Chris Wilson
@ 2016-08-09  7:37 ` Chris Wilson
  2016-08-09  7:37 ` [CI 3/3] drm/i915: Don't check for idleness before retiring after a GPU hang Chris Wilson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2016-08-09  7:37 UTC (permalink / raw)
  To: intel-gfx

As we do the lockdep protected RCU lookup in a couple of places,
refactor that code to a common helper i915_gem_active_raw().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem_request.h | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
index 583e237b98d1..f6661f31a348 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.h
+++ b/drivers/gpu/drm/i915/i915_gem_request.h
@@ -360,6 +360,21 @@ __i915_gem_active_peek(const struct i915_gem_active *active)
 }
 
 /**
+ * i915_gem_active_raw - return the active request
+ * @active - the active tracker
+ *
+ * i915_gem_active_raw() returns the current request being tracked, or NULL.
+ * It does not obtain a reference on the request for the caller, so the caller
+ * must hold struct_mutex.
+ */
+static inline struct drm_i915_gem_request *
+i915_gem_active_raw(const struct i915_gem_active *active, struct mutex *mutex)
+{
+	return rcu_dereference_protected(active->request,
+					 lockdep_is_held(mutex));
+}
+
+/**
  * i915_gem_active_peek - report the active request being monitored
  * @active - the active tracker
  *
@@ -372,8 +387,7 @@ i915_gem_active_peek(const struct i915_gem_active *active, struct mutex *mutex)
 {
 	struct drm_i915_gem_request *request;
 
-	request = rcu_dereference_protected(active->request,
-					    lockdep_is_held(mutex));
+	request = i915_gem_active_raw(active, mutex);
 	if (!request || i915_gem_request_completed(request))
 		return NULL;
 
@@ -614,8 +628,7 @@ i915_gem_active_retire(struct i915_gem_active *active,
 	struct drm_i915_gem_request *request;
 	int ret;
 
-	request = rcu_dereference_protected(active->request,
-					    lockdep_is_held(mutex));
+	request = i915_gem_active_raw(active, mutex);
 	if (!request)
 		return 0;
 
-- 
2.8.1

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

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

* [CI 3/3] drm/i915: Don't check for idleness before retiring after a GPU hang
  2016-08-09  7:37 [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Chris Wilson
  2016-08-09  7:37 ` [CI 2/3] drm/i915: Wrap the protected active RCU dereference in a helper Chris Wilson
@ 2016-08-09  7:37 ` Chris Wilson
  2016-08-09  8:05 ` ✓ Ro.CI.BAT: success for series starting with [CI,1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Patchwork
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2016-08-09  7:37 UTC (permalink / raw)
  To: intel-gfx

When we force the cleanup after a GPU hang, we want to retire all
requests, or else we may leak them if truly wedged (and the GPU never
advances again). Converting to the active request helpers had the issue
of doing the check against busyness before reporting the request, so if
we claim the GPU had hung but this engine hadn't we could potential skip
the request cleanup - triggering the self-check BUG.

Fixes: dcff85c8443e ("drm/i915: Enable i915_gem_wait_for_idle() ...")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f4f8eaa90f2a..cd5229301aae 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2423,15 +2423,11 @@ static void i915_gem_reset_engine_cleanup(struct intel_engine_cs *engine)
 	struct drm_i915_gem_request *request;
 	struct intel_ring *ring;
 
-	request = i915_gem_active_peek(&engine->last_request,
-				       &engine->i915->drm.struct_mutex);
-
 	/* Mark all pending requests as complete so that any concurrent
 	 * (lockless) lookup doesn't try and wait upon the request as we
 	 * reset it.
 	 */
-	if (request)
-		intel_engine_init_seqno(engine, request->fence.seqno);
+	intel_engine_init_seqno(engine, engine->last_submitted_seqno);
 
 	/*
 	 * Clear the execlists queue up before freeing the requests, as those
@@ -2453,6 +2449,8 @@ static void i915_gem_reset_engine_cleanup(struct intel_engine_cs *engine)
 	 * implicit references on things like e.g. ppgtt address spaces through
 	 * the request.
 	 */
+	request = i915_gem_active_raw(&engine->last_request,
+				      &engine->i915->drm.struct_mutex);
 	if (request)
 		i915_gem_request_retire_upto(request);
 	GEM_BUG_ON(intel_engine_is_active(engine));
-- 
2.8.1

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

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

* ✓ Ro.CI.BAT: success for series starting with [CI,1/3] drm/i915: Remove unused i915_gem_active_peek_rcu()
  2016-08-09  7:37 [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Chris Wilson
  2016-08-09  7:37 ` [CI 2/3] drm/i915: Wrap the protected active RCU dereference in a helper Chris Wilson
  2016-08-09  7:37 ` [CI 3/3] drm/i915: Don't check for idleness before retiring after a GPU hang Chris Wilson
@ 2016-08-09  8:05 ` Patchwork
  2016-08-10  5:44 ` ✗ Ro.CI.BAT: failure " Patchwork
  2016-08-10 10:22 ` [CI 1/3] " Daniel Vetter
  4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2016-08-09  8:05 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [CI,1/3] drm/i915: Remove unused i915_gem_active_peek_rcu()
URL   : https://patchwork.freedesktop.org/series/10826/
State : success

== Summary ==

Series 10826v1 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/10826/revisions/1/mbox

Test kms_cursor_legacy:
        Subgroup basic-flip-vs-cursor-legacy:
                fail       -> PASS       (ro-byt-n2820)

fi-hsw-i7-4770k  total:107  pass:91   dwarn:0   dfail:0   fail:0   skip:15 
fi-kbl-qkkr      total:107  pass:83   dwarn:1   dfail:0   fail:0   skip:22 
fi-skl-i5-6260u  total:107  pass:98   dwarn:0   dfail:0   fail:0   skip:8  
fi-skl-i7-6700k  total:107  pass:84   dwarn:0   dfail:0   fail:0   skip:22 
fi-snb-i7-2600   total:107  pass:77   dwarn:0   dfail:0   fail:0   skip:29 
ro-bdw-i5-5250u  total:107  pass:97   dwarn:0   dfail:0   fail:0   skip:9  
ro-bdw-i7-5557U  total:107  pass:97   dwarn:0   dfail:0   fail:0   skip:9  
ro-bdw-i7-5600u  total:107  pass:79   dwarn:0   dfail:0   fail:0   skip:27 
ro-bsw-n3050     total:240  pass:194  dwarn:0   dfail:0   fail:4   skip:42 
ro-byt-n2820     total:240  pass:198  dwarn:0   dfail:0   fail:2   skip:40 
ro-hsw-i3-4010u  total:107  pass:87   dwarn:0   dfail:0   fail:0   skip:19 
ro-ilk1-i5-650   total:235  pass:173  dwarn:0   dfail:0   fail:2   skip:60 
ro-ivb-i7-3770   total:107  pass:80   dwarn:0   dfail:0   fail:0   skip:26 
ro-skl3-i5-6260u total:107  pass:98   dwarn:0   dfail:0   fail:0   skip:8  
ro-hsw-i7-4770r failed to connect after reboot
ro-ivb2-i7-3770 failed to connect after reboot

Results at /archive/results/CI_IGT_test/RO_Patchwork_1773/

5df4316 drm-intel-nightly: 2016y-08m-08d-18h-35m-22s UTC integration manifest
923d0d2 drm/i915: Don't check for idleness before retiring after a GPU hang
362e270 drm/i915: Wrap the protected active RCU dereference in a helper
033b877 drm/i915: Remove unused i915_gem_active_peek_rcu()

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

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

* ✗ Ro.CI.BAT: failure for series starting with [CI,1/3] drm/i915: Remove unused i915_gem_active_peek_rcu()
  2016-08-09  7:37 [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Chris Wilson
                   ` (2 preceding siblings ...)
  2016-08-09  8:05 ` ✓ Ro.CI.BAT: success for series starting with [CI,1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Patchwork
@ 2016-08-10  5:44 ` Patchwork
  2016-08-10 10:22 ` [CI 1/3] " Daniel Vetter
  4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2016-08-10  5:44 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [CI,1/3] drm/i915: Remove unused i915_gem_active_peek_rcu()
URL   : https://patchwork.freedesktop.org/series/10826/
State : failure

== Summary ==

Applying: drm/i915: Remove unused i915_gem_active_peek_rcu()
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/i915/i915_gem_request.h
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/i915_gem_request.h
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_gem_request.h
error: Failed to merge in the changes.
Patch failed at 0001 drm/i915: Remove unused i915_gem_active_peek_rcu()
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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

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

* Re: [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu()
  2016-08-09  7:37 [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Chris Wilson
                   ` (3 preceding siblings ...)
  2016-08-10  5:44 ` ✗ Ro.CI.BAT: failure " Patchwork
@ 2016-08-10 10:22 ` Daniel Vetter
  2016-08-10 10:27   ` Chris Wilson
  4 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2016-08-10 10:22 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Tue, Aug 09, 2016 at 08:37:00AM +0100, Chris Wilson wrote:
> This was originally introduced to be used by the busy-ioctl, but in the
> end busy ioctl performed a different dance. Since there are no users,
> and no likely users, remove an unwanted chunk of the API.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

I thought I rubber-stamped this already ...

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/i915_gem_request.h | 21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
> index 3496e28785e7..583e237b98d1 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.h
> +++ b/drivers/gpu/drm/i915/i915_gem_request.h
> @@ -381,27 +381,6 @@ i915_gem_active_peek(const struct i915_gem_active *active, struct mutex *mutex)
>  }
>  
>  /**
> - * i915_gem_active_peek_rcu - report the active request being monitored
> - * @active - the active tracker
> - *
> - * i915_gem_active_peek_rcu() returns the current request being tracked if
> - * still active, or NULL. It does not obtain a reference on the request
> - * for the caller, and inspection of the request is only valid under
> - * the RCU lock.
> - */
> -static inline struct drm_i915_gem_request *
> -i915_gem_active_peek_rcu(const struct i915_gem_active *active)
> -{
> -	struct drm_i915_gem_request *request;
> -
> -	request = rcu_dereference(active->request);
> -	if (!request || i915_gem_request_completed(request))
> -		return NULL;
> -
> -	return request;
> -}
> -
> -/**
>   * i915_gem_active_get - return a reference to the active request
>   * @active - the active tracker
>   *
> -- 
> 2.8.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu()
  2016-08-10 10:22 ` [CI 1/3] " Daniel Vetter
@ 2016-08-10 10:27   ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2016-08-10 10:27 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

On Wed, Aug 10, 2016 at 12:22:35PM +0200, Daniel Vetter wrote:
> On Tue, Aug 09, 2016 at 08:37:00AM +0100, Chris Wilson wrote:
> > This was originally introduced to be used by the busy-ioctl, but in the
> > end busy ioctl performed a different dance. Since there are no users,
> > and no likely users, remove an unwanted chunk of the API.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> I thought I rubber-stamped this already ...

Yes, this was sent before so that I could get your r-b at the same time
as getting the CI result.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-08-10 10:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09  7:37 [CI 1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Chris Wilson
2016-08-09  7:37 ` [CI 2/3] drm/i915: Wrap the protected active RCU dereference in a helper Chris Wilson
2016-08-09  7:37 ` [CI 3/3] drm/i915: Don't check for idleness before retiring after a GPU hang Chris Wilson
2016-08-09  8:05 ` ✓ Ro.CI.BAT: success for series starting with [CI,1/3] drm/i915: Remove unused i915_gem_active_peek_rcu() Patchwork
2016-08-10  5:44 ` ✗ Ro.CI.BAT: failure " Patchwork
2016-08-10 10:22 ` [CI 1/3] " Daniel Vetter
2016-08-10 10:27   ` Chris Wilson

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.