AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/sched: Always trace the dependencies we wait on, to fix a race.
@ 2018-12-07 19:16 Eric Anholt
  2018-12-07 19:46 ` Koenig, Christian
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Anholt @ 2018-12-07 19:16 UTC (permalink / raw)
  To: dri-devel, amd-gfx, christian.koenig; +Cc: linux-kernel, Eric Anholt

The entity->dependency can go away completely once we've called
drm_sched_entity_add_dependency_cb() (if the cb is called before we
get around to tracing).  The tracepoint is more useful if we trace
every dependency instead of just ones that get callbacks installed,
anyway, so just do that.

Fixes any easy-to-produce OOPS when tracing the scheduler on V3D with
"perf record -a -e gpu_scheduler:.\* glxgears" and DEBUG_SLAB enabled.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 drivers/gpu/drm/scheduler/sched_entity.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index 4463d3826ecb..e2942c9a11a7 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -440,13 +440,10 @@ struct drm_sched_job *drm_sched_entity_pop_job(struct drm_sched_entity *entity)
 
 	while ((entity->dependency =
 			sched->ops->dependency(sched_job, entity))) {
+		trace_drm_sched_job_wait_dep(sched_job, entity->dependency);
 
-		if (drm_sched_entity_add_dependency_cb(entity)) {
-
-			trace_drm_sched_job_wait_dep(sched_job,
-						     entity->dependency);
+		if (drm_sched_entity_add_dependency_cb(entity))
 			return NULL;
-		}
 	}
 
 	/* skip jobs from entity that marked guilty */
-- 
2.20.0.rc1

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

* Re: [PATCH] drm/sched: Always trace the dependencies we wait on, to fix a race.
  2018-12-07 19:16 [PATCH] drm/sched: Always trace the dependencies we wait on, to fix a race Eric Anholt
@ 2018-12-07 19:46 ` Koenig, Christian
  2019-02-07 23:10   ` Eric Anholt
  0 siblings, 1 reply; 4+ messages in thread
From: Koenig, Christian @ 2018-12-07 19:46 UTC (permalink / raw)
  To: Eric Anholt, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
  Cc: linux-kernel@vger.kernel.org

Am 07.12.18 um 20:16 schrieb Eric Anholt:
> The entity->dependency can go away completely once we've called
> drm_sched_entity_add_dependency_cb() (if the cb is called before we
> get around to tracing).  The tracepoint is more useful if we trace
> every dependency instead of just ones that get callbacks installed,
> anyway, so just do that.
>
> Fixes any easy-to-produce OOPS when tracing the scheduler on V3D with
> "perf record -a -e gpu_scheduler:.\* glxgears" and DEBUG_SLAB enabled.
>
> Signed-off-by: Eric Anholt <eric@anholt.net>

Reviewed-by: Christian König <christian.koenig@amd.com>

Going to pick that up for upstream and will add with a CC: stable.

Thanks,
Christian.

> ---
>   drivers/gpu/drm/scheduler/sched_entity.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
> index 4463d3826ecb..e2942c9a11a7 100644
> --- a/drivers/gpu/drm/scheduler/sched_entity.c
> +++ b/drivers/gpu/drm/scheduler/sched_entity.c
> @@ -440,13 +440,10 @@ struct drm_sched_job *drm_sched_entity_pop_job(struct drm_sched_entity *entity)
>   
>   	while ((entity->dependency =
>   			sched->ops->dependency(sched_job, entity))) {
> +		trace_drm_sched_job_wait_dep(sched_job, entity->dependency);
>   
> -		if (drm_sched_entity_add_dependency_cb(entity)) {
> -
> -			trace_drm_sched_job_wait_dep(sched_job,
> -						     entity->dependency);
> +		if (drm_sched_entity_add_dependency_cb(entity))
>   			return NULL;
> -		}
>   	}
>   
>   	/* skip jobs from entity that marked guilty */


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

* Re: [PATCH] drm/sched: Always trace the dependencies we wait on, to fix a race.
  2018-12-07 19:46 ` Koenig, Christian
@ 2019-02-07 23:10   ` Eric Anholt
  2019-02-08  8:43     ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Anholt @ 2019-02-07 23:10 UTC (permalink / raw)
  To: Koenig, Christian, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
  Cc: linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

"Koenig, Christian" <Christian.Koenig@amd.com> writes:

> Am 07.12.18 um 20:16 schrieb Eric Anholt:
>> The entity->dependency can go away completely once we've called
>> drm_sched_entity_add_dependency_cb() (if the cb is called before we
>> get around to tracing).  The tracepoint is more useful if we trace
>> every dependency instead of just ones that get callbacks installed,
>> anyway, so just do that.
>>
>> Fixes any easy-to-produce OOPS when tracing the scheduler on V3D with
>> "perf record -a -e gpu_scheduler:.\* glxgears" and DEBUG_SLAB enabled.
>>
>> Signed-off-by: Eric Anholt <eric@anholt.net>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> Going to pick that up for upstream and will add with a CC: stable.

Looks like this got misplaced.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH] drm/sched: Always trace the dependencies we wait on, to fix a race.
  2019-02-07 23:10   ` Eric Anholt
@ 2019-02-08  8:43     ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2019-02-08  8:43 UTC (permalink / raw)
  To: Eric Anholt, Koenig, Christian, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
  Cc: linux-kernel@vger.kernel.org


[-- Attachment #1.1: Type: text/plain, Size: 1082 bytes --]

Am 08.02.19 um 00:10 schrieb Eric Anholt:
> "Koenig, Christian" <Christian.Koenig@amd.com> writes:
>
>> Am 07.12.18 um 20:16 schrieb Eric Anholt:
>>> The entity->dependency can go away completely once we've called
>>> drm_sched_entity_add_dependency_cb() (if the cb is called before we
>>> get around to tracing).  The tracepoint is more useful if we trace
>>> every dependency instead of just ones that get callbacks installed,
>>> anyway, so just do that.
>>>
>>> Fixes any easy-to-produce OOPS when tracing the scheduler on V3D with
>>> "perf record -a -e gpu_scheduler:.\* glxgears" and DEBUG_SLAB enabled.
>>>
>>> Signed-off-by: Eric Anholt <eric@anholt.net>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>> Going to pick that up for upstream and will add with a CC: stable.
> Looks like this got misplaced.

My fault, pushed to our internal branch now with a CC: stable tag on it.

Christian.

>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 2338 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-02-08  8:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-07 19:16 [PATCH] drm/sched: Always trace the dependencies we wait on, to fix a race Eric Anholt
2018-12-07 19:46 ` Koenig, Christian
2019-02-07 23:10   ` Eric Anholt
2019-02-08  8:43     ` Christian König

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