Skip to contentSkip to conversation

drm/v3d: Fix calling drm_sched_resubmit_jobs for same sched.

PATCH In review Andrey Grodzovsky 4 participants 8 messages Mar 12, 2019 – Mar 13, 2019 5 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/v3d: Fix calling drm_sched_resubmit_jobs for same sched.

Also stop calling drm_sched_increase_karma multiple times.

---
 drivers/gpu/drm/v3d/v3d_sched.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/v3d/v3d_sched.c +5 -8
index 4704b2d..ce7c737b 100644
@@ -231,20 +231,17 @@ v3d_gpu_reset_for_timeout(struct v3d_dev *v3d, struct drm_sched_job *sched_job)
 	mutex_lock(&v3d->reset_lock);
 
 	/* block scheduler */
-	for (q = 0; q < V3D_MAX_QUEUES; q++) {
-		struct drm_gpu_scheduler *sched = &v3d->queue[q].sched;
-
-		drm_sched_stop(sched);
+	for (q = 0; q < V3D_MAX_QUEUES; q++)
+		drm_sched_stop(&v3d->queue[q].sched);
 
-		if(sched_job)
-			drm_sched_increase_karma(sched_job);
-	}
+	if(sched_job)
+		drm_sched_increase_karma(sched_job);
 
 	/* get the GPU back into the init state */
 	v3d_reset(v3d);
 
 	for (q = 0; q < V3D_MAX_QUEUES; q++)
-		drm_sched_resubmit_jobs(sched_job->sched);
+		drm_sched_resubmit_jobs(&v3d->queue[q].sched);
 
 	/* Unblock schedulers and restart their jobs. */
 	for (q = 0; q < V3D_MAX_QUEUES; q++) {
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1552409822-17230-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

They are not the same, but the guilty job belongs to only one {entity, scheduler} pair and so we mark as guilty only for that particular entity in the context of that scheduler only once.

Andrey

________________________________________
From: Eric Anholt <[email protected]>
Sent: 12 March 2019 13:33:16
To: Grodzovsky, Andrey; [email protected]; [email protected]; [email protected]
Cc: Grodzovsky, Andrey
Subject: Re: [PATCH] drm/v3d: Fix calling drm_sched_resubmit_jobs for same sched.

Quoted 1 line · Andrey Grodzovsky

Also stop calling drm_sched_increase_karma multiple times.

Each v3d->queue[q].sched was initialized with a separate drm_sched_init(). I wouldn't have thought they were all the "same sched".
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CY4PR12MB1446C0DAFA3349227DEB9B0AEA490-rpdhrqHFk070Y0OdeIqGUgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 6 lines · Eric Anholt
Quoted 3 lines · Andrey

They are not the same, but the guilty job belongs to only one {entity, scheduler} pair and so we mark as guilty only for that particular entity in the context of that scheduler only once.

I get it now, sorry. I'll merge this through drm-misc-next.

np, i actually pushed it into our internal branch already so you can do that or wait for our next pull request.

Andrey

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): fc067a25-260f-d056-f22c-10d9aac7a612-5C7GfCeVMHo@public.gmane.org

#10 lore raw
Quoted 10 lines · Andrey
Quoted 6 lines · Eric Anholt
Quoted 3 lines · Andrey

They are not the same, but the guilty job belongs to only one {entity, scheduler} pair and so we mark as guilty only for that particular entity in the context of that scheduler only once.

I get it now, sorry. I'll merge this through drm-misc-next.

np, i actually pushed it into our internal branch already so you can do that or wait for our next pull request.

I also fixed the whitespace in the moved code and added the missing
Fixes: line, so I'd like to get it merged through the proper tree for maintaining v3d.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#11 lore raw

np

Andrey

Quoted 8 lines · Eric Anholt
Quoted 6 lines · Andrey
Quoted 5 lines · Eric Anholt
Quoted 3 lines · Andrey

They are not the same, but the guilty job belongs to only one {entity, scheduler} pair and so we mark as guilty only for that particular entity in the context of that scheduler only once.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I get it now, sorry. I'll merge this through drm-misc-next.

np, i actually pushed it into our internal branch already so you can do that or wait for our next pull request.

I also fixed the whitespace in the moved code and added the missing
Fixes: line, so I'd like to get it merged through the proper tree for maintaining v3d.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
In reply to a message not in the archive

Am 12.03.19 um 17:57 schrieb Andrey Grodzovsky:

Quoted 3 lines

Also stop calling drm_sched_increase_karma multiple times.

Quoted 24 lines
---
  drivers/gpu/drm/v3d/v3d_sched.c | 13 +++++--------
  1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/v3d/v3d_sched.c +4 -7
index 4704b2d..ce7c737b 100644
@@ -231,20 +231,17 @@ v3d_gpu_reset_for_timeout(struct v3d_dev *v3d, struct drm_sched_job *sched_job)
  	mutex_lock(&v3d->reset_lock);
 
  	/* block scheduler */
-	for (q = 0; q < V3D_MAX_QUEUES; q++) {
-		struct drm_gpu_scheduler *sched = &v3d->queue[q].sched;
-
-		drm_sched_stop(sched);
+	for (q = 0; q < V3D_MAX_QUEUES; q++)
+		drm_sched_stop(&v3d->queue[q].sched);
 
-		if(sched_job)
-			drm_sched_increase_karma(sched_job);
-	}
+	if(sched_job)
+		drm_sched_increase_karma(sched_job);

drivers/gpu/drm/v3d/v3d_sched.c v3d_gpu_reset_for_timeout(struct v3d_dev *v3d, struct drm_sched_job *sched_job) · line 247

Quoted 10 lines
drivers/gpu/drm/v3d/v3d_sched.c +1 -1
 
  	/* get the GPU back into the init state */
  	v3d_reset(v3d);
 
  	for (q = 0; q < V3D_MAX_QUEUES; q++)
-		drm_sched_resubmit_jobs(sched_job->sched);
+		drm_sched_resubmit_jobs(&v3d->queue[q].sched);
 
  	/* Unblock schedulers and restart their jobs. */
  	for (q = 0; q < V3D_MAX_QUEUES; q++) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx