All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Add a warning on shutdown if signal threads still active
@ 2016-11-21  9:40 Chris Wilson
  2016-11-21 10:16 ` ✓ Fi.CI.BAT: success for " Patchwork
  2016-11-21 10:42 ` [PATCH] " Tvrtko Ursulin
  0 siblings, 2 replies; 5+ messages in thread
From: Chris Wilson @ 2016-11-21  9:40 UTC (permalink / raw)
  To: intel-gfx

When unloading the module, it is expected that we have finished
executing all requests and so the signal threads should be idle. Add a
warning in case there are any residual requests in the signaler rbtrees
at that point.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
index c9c46a538edb..b7006e90a167 100644
--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
@@ -623,6 +623,8 @@ void intel_engine_fini_breadcrumbs(struct intel_engine_cs *engine)
 {
 	struct intel_breadcrumbs *b = &engine->breadcrumbs;
 
+	WARN_ON(READ_ONCE(b->first_signal));
+	WARN_ON(!RB_EMPTY_ROOT(&b->signals));
 	if (!IS_ERR_OR_NULL(b->signaler))
 		kthread_stop(b->signaler);
 
-- 
2.10.2

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Add a warning on shutdown if signal threads still active
  2016-11-21  9:40 [PATCH] drm/i915: Add a warning on shutdown if signal threads still active Chris Wilson
@ 2016-11-21 10:16 ` Patchwork
  2016-11-21 10:42 ` [PATCH] " Tvrtko Ursulin
  1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2016-11-21 10:16 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Add a warning on shutdown if signal threads still active
URL   : https://patchwork.freedesktop.org/series/15641/
State : success

== Summary ==

Series 15641v1 drm/i915: Add a warning on shutdown if signal threads still active
https://patchwork.freedesktop.org/api/1.0/series/15641/revisions/1/mbox/


fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40 
fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-j1900     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6700k     total:244  pass:222  dwarn:1   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33 

accd56d36a298219042d84ba9ee1b7bd66d1936c drm-intel-nightly: 2016y-11m-18d-22h-35m-31s UTC integration manifest
9122fd0 drm/i915: Add a warning on shutdown if signal threads still active

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3065/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Add a warning on shutdown if signal threads still active
  2016-11-21  9:40 [PATCH] drm/i915: Add a warning on shutdown if signal threads still active Chris Wilson
  2016-11-21 10:16 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2016-11-21 10:42 ` Tvrtko Ursulin
  2016-11-21 10:48   ` Chris Wilson
  1 sibling, 1 reply; 5+ messages in thread
From: Tvrtko Ursulin @ 2016-11-21 10:42 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 21/11/2016 09:40, Chris Wilson wrote:
> When unloading the module, it is expected that we have finished
> executing all requests and so the signal threads should be idle. Add a
> warning in case there are any residual requests in the signaler rbtrees
> at that point.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_breadcrumbs.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> index c9c46a538edb..b7006e90a167 100644
> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> @@ -623,6 +623,8 @@ void intel_engine_fini_breadcrumbs(struct intel_engine_cs *engine)
>  {
>  	struct intel_breadcrumbs *b = &engine->breadcrumbs;
>
> +	WARN_ON(READ_ONCE(b->first_signal));
> +	WARN_ON(!RB_EMPTY_ROOT(&b->signals));
>  	if (!IS_ERR_OR_NULL(b->signaler))
>  		kthread_stop(b->signaler);
>
>

Not sure if you are just testing out theories on the CI, but in any case 
looks to me it wouldn't harm to have this in.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

* Re: [PATCH] drm/i915: Add a warning on shutdown if signal threads still active
  2016-11-21 10:42 ` [PATCH] " Tvrtko Ursulin
@ 2016-11-21 10:48   ` Chris Wilson
  2016-11-21 10:53     ` Tvrtko Ursulin
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2016-11-21 10:48 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

On Mon, Nov 21, 2016 at 10:42:37AM +0000, Tvrtko Ursulin wrote:
> 
> On 21/11/2016 09:40, Chris Wilson wrote:
> >When unloading the module, it is expected that we have finished
> >executing all requests and so the signal threads should be idle. Add a
> >warning in case there are any residual requests in the signaler rbtrees
> >at that point.
> >
> >Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >---
> > drivers/gpu/drm/i915/intel_breadcrumbs.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> >diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> >index c9c46a538edb..b7006e90a167 100644
> >--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> >+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> >@@ -623,6 +623,8 @@ void intel_engine_fini_breadcrumbs(struct intel_engine_cs *engine)
> > {
> > 	struct intel_breadcrumbs *b = &engine->breadcrumbs;
> >
> >+	WARN_ON(READ_ONCE(b->first_signal));
> >+	WARN_ON(!RB_EMPTY_ROOT(&b->signals));
> > 	if (!IS_ERR_OR_NULL(b->signaler))
> > 		kthread_stop(b->signaler);
> >
> >
> 
> Not sure if you are just testing out theories on the CI, but in any
> case looks to me it wouldn't harm to have this in.

Only staring at the impossible, ruling out the unlikely. A leak here
would be caught by the request kmem_cache, but being explicit might help
in future.
 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Imagine if I added a 

WARN_ON(READ_ONCE(b->first_waiter));
WARN_ON(!RB_EMPTY_ROOT(&b->waiters));

as well? Still r-b or go with a second patch for the afterthought?
-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] 5+ messages in thread

* Re: [PATCH] drm/i915: Add a warning on shutdown if signal threads still active
  2016-11-21 10:48   ` Chris Wilson
@ 2016-11-21 10:53     ` Tvrtko Ursulin
  0 siblings, 0 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2016-11-21 10:53 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 21/11/2016 10:48, Chris Wilson wrote:
> On Mon, Nov 21, 2016 at 10:42:37AM +0000, Tvrtko Ursulin wrote:
>>
>> On 21/11/2016 09:40, Chris Wilson wrote:
>>> When unloading the module, it is expected that we have finished
>>> executing all requests and so the signal threads should be idle. Add a
>>> warning in case there are any residual requests in the signaler rbtrees
>>> at that point.
>>>
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> ---
>>> drivers/gpu/drm/i915/intel_breadcrumbs.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
>>> index c9c46a538edb..b7006e90a167 100644
>>> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
>>> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
>>> @@ -623,6 +623,8 @@ void intel_engine_fini_breadcrumbs(struct intel_engine_cs *engine)
>>> {
>>> 	struct intel_breadcrumbs *b = &engine->breadcrumbs;
>>>
>>> +	WARN_ON(READ_ONCE(b->first_signal));
>>> +	WARN_ON(!RB_EMPTY_ROOT(&b->signals));
>>> 	if (!IS_ERR_OR_NULL(b->signaler))
>>> 		kthread_stop(b->signaler);
>>>
>>>
>>
>> Not sure if you are just testing out theories on the CI, but in any
>> case looks to me it wouldn't harm to have this in.
>
> Only staring at the impossible, ruling out the unlikely. A leak here
> would be caught by the request kmem_cache, but being explicit might help
> in future.
>
>> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Imagine if I added a
>
> WARN_ON(READ_ONCE(b->first_waiter));
> WARN_ON(!RB_EMPTY_ROOT(&b->waiters));
>
> as well? Still r-b or go with a second patch for the afterthought?

It's the same thing conceptually so can expand and keep the r-b for what 
I am concerned.

Regards,

Tvrtko


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

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

end of thread, other threads:[~2016-11-21 10:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-21  9:40 [PATCH] drm/i915: Add a warning on shutdown if signal threads still active Chris Wilson
2016-11-21 10:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-11-21 10:42 ` [PATCH] " Tvrtko Ursulin
2016-11-21 10:48   ` Chris Wilson
2016-11-21 10:53     ` Tvrtko Ursulin

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.