Skip to contentSkip to conversation

drm/amdgpu:no gpu scheduler for KIQ

PATCH In review Trigger Huang 3 participants 4 messages Nov 2, 2016 – Nov 3, 2016 2 messages not in the archive

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

PATCH v2 1/1 drm/amdgpu:no gpu scheduler for KIQ

KIQ is used for interaction between driver and CP, and not exposed to outside client, as such it doesn't need to be handled by GPU scheduler.

Changes in v2:
- According to Alex's suggestion, wrapping the scheduler setup conditionally instead of returning early.
- Use another simple method to check if is a KIQ ring.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 39 +++++++++++++++++--------------
 1 file changed, 21 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +21 -18
index 77b34ec..5772ef2 100644
@@ -382,24 +382,27 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
 	if (!ring->fence_drv.fences)
 		return -ENOMEM;
 
-	timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
-	if (timeout == 0) {
-		/*
-		 * FIXME:
-		 * Delayed workqueue cannot use it directly,
-		 * so the scheduler will not use delayed workqueue if
-		 * MAX_SCHEDULE_TIMEOUT is set.
-		 * Currently keep it simple and silly.
-		 */
-		timeout = MAX_SCHEDULE_TIMEOUT;
-	}
-	r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,
-			   num_hw_submission,
-			   timeout, ring->name);
-	if (r) {
-		DRM_ERROR("Failed to create scheduler on ring %s.\n",
-			  ring->name);
-		return r;
+	/* No need to setup the GPU scheduler for KIQ ring */
+	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
+		timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
+		if (timeout == 0) {
+			/*
+			 * FIXME:
+			 * Delayed workqueue cannot use it directly,
+			 * so the scheduler will not use delayed workqueue if
+			 * MAX_SCHEDULE_TIMEOUT is set.
+			 * Currently keep it simple and silly.
+			 */
+			timeout = MAX_SCHEDULE_TIMEOUT;
+		}
+		r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,
+				   num_hw_submission,
+				   timeout, ring->name);
+		if (r) {
+			DRM_ERROR("Failed to create scheduler on ring %s.\n",
+				  ring->name);
+			return r;
+		}
 	}
 
 	return 0;
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): 1478087284-30345-1-git-send-email-trigger.huang-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 02.11.2016 um 12:48 schrieb Trigger Huang:

Quoted 7 lines

KIQ is used for interaction between driver and CP, and not exposed to outside client, as such it doesn't need to be handled by GPU scheduler.

Even if you only fix a small mistake it is usually good practice to increase the version number of the patch, e.g. you would use v3 in this case and write a one liner what was wrong in the commit message.

But that's only a nit pick, so patch is Reviewed-by: Christian König <[email protected]> anyway.

Regards,
Christian.

Quoted 50 lines

Changes in v2:
- According to Alex's suggestion, wrapping the scheduler setup conditionally instead of returning early.
- Use another simple method to check if is a KIQ ring.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 39 +++++++++++++++++--------------
  1 file changed, 21 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +14 -18
index 77b34ec..5772ef2 100644
@@ -382,24 +382,27 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
  	if (!ring->fence_drv.fences)
  		return -ENOMEM;
 
-	timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
-	if (timeout == 0) {
-		/*
-		 * FIXME:
-		 * Delayed workqueue cannot use it directly,
-		 * so the scheduler will not use delayed workqueue if
-		 * MAX_SCHEDULE_TIMEOUT is set.
-		 * Currently keep it simple and silly.
-		 */
-		timeout = MAX_SCHEDULE_TIMEOUT;
-	}
-	r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,
-			   num_hw_submission,
-			   timeout, ring->name);
-	if (r) {
-		DRM_ERROR("Failed to create scheduler on ring %s.\n",
-			  ring->name);
-		return r;
+	/* No need to setup the GPU scheduler for KIQ ring */
+	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
+		timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
+		if (timeout == 0) {
+			/*
+			 * FIXME:
+			 * Delayed workqueue cannot use it directly,
+			 * so the scheduler will not use delayed workqueue if
+			 * MAX_SCHEDULE_TIMEOUT is set.
+			 * Currently keep it simple and silly.
+			 */
+			timeout = MAX_SCHEDULE_TIMEOUT;
+		}
+		r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, · line 408

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +7 -0
+				   num_hw_submission,
+				   timeout, ring->name);
+		if (r) {
+			DRM_ERROR("Failed to create scheduler on ring %s.\n",
+				  ring->name);
+			return r;
+		}
  	}
 
  	return 0;

_______________________________________________
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): 668c3770-240f-7ee5-8fa6-4d0533f0e064-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#4 lore raw

Hi Christian,
OK, I got it, thanks for your detailed suggestion.

Thanks & Best Wishes,
Trigger Huang

-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Wednesday, November 02, 2016 8:24 PM
To: Huang, Trigger <[email protected]>; [email protected]
Cc: Yu, Xiangliang <[email protected]>; Liu, Monk <[email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:no gpu scheduler for KIQ

Am 02.11.2016 um 12:48 schrieb Trigger Huang:

Quoted 7 lines

KIQ is used for interaction between driver and CP, and not exposed to outside client, as such it doesn't need to be handled by GPU scheduler.

Even if you only fix a small mistake it is usually good practice to increase the version number of the patch, e.g. you would use v3 in this case and write a one liner what was wrong in the commit message.

But that's only a nit pick, so patch is Reviewed-by: Christian König <[email protected]> anyway.

Regards,
Christian.

Quoted 51 lines

Changes in v2:
- According to Alex's suggestion, wrapping the scheduler setup conditionally instead of returning early.
- Use another simple method to check if is a KIQ ring.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 39 +++++++++++++++++--------------
  1 file changed, 21 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +14 -18
index 77b34ec..5772ef2 100644
@@ -382,24 +382,27 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
  	if (!ring->fence_drv.fences)
  		return -ENOMEM;
 
-	timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
-	if (timeout == 0) {
-		/*
-		 * FIXME:
-		 * Delayed workqueue cannot use it directly,
-		 * so the scheduler will not use delayed workqueue if
-		 * MAX_SCHEDULE_TIMEOUT is set.
-		 * Currently keep it simple and silly.
-		 */
-		timeout = MAX_SCHEDULE_TIMEOUT;
-	}
-	r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,
-			   num_hw_submission,
-			   timeout, ring->name);
-	if (r) {
-		DRM_ERROR("Failed to create scheduler on ring %s.\n",
-			  ring->name);
-		return r;
+	/* No need to setup the GPU scheduler for KIQ ring */
+	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
+		timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
+		if (timeout == 0) {
+			/*
+			 * FIXME:
+			 * Delayed workqueue cannot use it directly,
+			 * so the scheduler will not use delayed workqueue if
+			 * MAX_SCHEDULE_TIMEOUT is set.
+			 * Currently keep it simple and silly.
+			 */
+			timeout = MAX_SCHEDULE_TIMEOUT;
+		}
+		r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, · line 408

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +7 -0
+				   num_hw_submission,
+				   timeout, ring->name);
+		if (r) {
+			DRM_ERROR("Failed to create scheduler on ring %s.\n",
+				  ring->name);
+			return r;
+		}
  	}
 
  	return 0;

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

Reviewed-by Alex Deucher
#5 lore raw
In reply to a message not in the archive
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Trigger Huang
Sent: Wednesday, November 02, 2016 7:48 AM
To: [email protected]
Cc: Yu, Xiangliang; Liu, Monk; Huang, Trigger
Subject: [PATCH v2] drm/amdgpu:no gpu scheduler for KIQ

Quoted 7 lines

KIQ is used for interaction between driver and CP, and not exposed to outside client, as such it doesn't need to be handled by GPU scheduler.

Quoted 63 lines

Changes in v2:
- According to Alex's suggestion, wrapping the scheduler setup conditionally instead of returning early.
- Use another simple method to check if is a KIQ ring.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 39
+++++++++++++++++--------------
 1 file changed, 21 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +21 -18
index 77b34ec..5772ef2 100644
@@ -382,24 +382,27 @@ int amdgpu_fence_driver_init_ring(struct
 amdgpu_ring *ring,
 	if (!ring->fence_drv.fences)
 		return -ENOMEM;
 
-	timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
-	if (timeout == 0) {
-		/*
-		 * FIXME:
-		 * Delayed workqueue cannot use it directly,
-		 * so the scheduler will not use delayed workqueue if
-		 * MAX_SCHEDULE_TIMEOUT is set.
-		 * Currently keep it simple and silly.
-		 */
-		timeout = MAX_SCHEDULE_TIMEOUT;
-	}
-	r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,
-			   num_hw_submission,
-			   timeout, ring->name);
-	if (r) {
-		DRM_ERROR("Failed to create scheduler on ring %s.\n",
-			  ring->name);
-		return r;
+	/* No need to setup the GPU scheduler for KIQ ring */
+	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
+		timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
+		if (timeout == 0) {
+			/*
+			 * FIXME:
+			 * Delayed workqueue cannot use it directly,
+			 * so the scheduler will not use delayed workqueue if
+			 * MAX_SCHEDULE_TIMEOUT is set.
+			 * Currently keep it simple and silly.
+			 */
+			timeout = MAX_SCHEDULE_TIMEOUT;
+		}
+		r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,
+				   num_hw_submission,
+				   timeout, ring->name);
+		if (r) {
+			DRM_ERROR("Failed to create scheduler on ring
 %s.\n",
+				  ring->name);
+			return r;
+		}
 	}
Quoted 8 lines

return 0;
--
2.7.4

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

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