[PATCH] drm/amdgpu: set sched_hw_submission higher for KIQ

Xie, AlexBin AlexBin.Xie at amd.com
Tue Aug 22 21:02:14 UTC 2017


Hi Alex,


See below comment about coding style of 80 characters per line.


Thanks,

Alex Bin Xie

________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Alex Deucher <alexdeucher at gmail.com>
Sent: Tuesday, August 22, 2017 4:49 PM
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander
Subject: [PATCH] drm/amdgpu: set sched_hw_submission higher for KIQ

KIQ doesn't really use the GPU scheduler.  The base
drivers generally use the KIQ ring directly rather than
submitting IBs.  However, amdgpu_sched_hw_submission
(which defaults to 2) limits the number of outstanding
fences to 2.  KFD uses the KIQ for TLB flushes and the
2 fence limit hurts performance when there are several KFD
processes running.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 6c5646b..f39b851 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -170,6 +170,16 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
                      unsigned irq_type)
 {
         int r;
+       int sched_hw_submission = amdgpu_sched_hw_submission;
+
+       /* Set the hw submission limit higher for KIQ because
+        * it's used for a number of gfx/compute tasks by both
+        * KFD and KGD which may have outstanding fences and
+        * it doesn't really use the gpu scheduler anyway;
+        * KIQ tasks get submitted directly to the ring.
+        */
+       if (ring->funcs->type == AMDGPU_RING_TYPE_KIQ)
+               sched_hw_submission *= 2;

         if (ring->adev == NULL) {
                 if (adev->num_rings >= AMDGPU_MAX_RINGS)
@@ -179,7 +189,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
                 ring->idx = adev->num_rings++;
                 adev->rings[ring->idx] = ring;
                 r = amdgpu_fence_driver_init_ring(ring,
-                       amdgpu_sched_hw_submission);
+                                                 sched_hw_submission);

Alex Bin Xie: With shorter variable name, there is no need to wrap into a new line of code.

                 if (r)
                         return r;
         }
@@ -219,7 +229,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
         }

         ring->ring_size = roundup_pow_of_two(max_dw * 4 *
-                                            amdgpu_sched_hw_submission);
+                                            sched_hw_submission);

Alex Bin Xie: With shorter variable name, there is no need to wrap into a new line of code.


         ring->buf_mask = (ring->ring_size / 4) - 1;
         ring->ptr_mask = ring->funcs->support_64bit_ptrs ?
--
2.5.5

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of ...


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20170822/9addc59e/attachment-0001.html>


More information about the amd-gfx mailing list