]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdkfd: Adjust dequeue latencies and timeouts
authorFelix Kuehling <Felix.Kuehling@amd.com>
Wed, 20 Sep 2017 22:10:16 +0000 (18:10 -0400)
committerOded Gabbay <oded.gabbay@gmail.com>
Wed, 20 Sep 2017 22:10:16 +0000 (18:10 -0400)
Adjust latencies and timeouts for dequeueing with HWS and consolidate
them in one place. Make them longer to allow long running waves to
complete without causing a timeout. The timeout is twice as long as the
latency plus some buffer to make sure we don't detect a timeout
prematurely.

Change timeouts for dequeueing HQDs without HWS. KFD_UNMAP_LATENCY is
more consistent with what the HWS does for user queues.

Signed-off-by: Yong Zhao <yong.zhao@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h

index 87961fe669e14dddaa0202762129cabfc78403e4..dd60c6eec962687f53bc5479cab0d672653d34a7 100644 (file)
@@ -323,7 +323,7 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm,
 
        retval = mqd->destroy_mqd(mqd, q->mqd,
                                KFD_PREEMPT_TYPE_WAVEFRONT_RESET,
-                               QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS,
+                               KFD_UNMAP_LATENCY_MS,
                                q->pipe, q->queue);
 
        if (retval)
index faf820a06400061491d42b985edf79fb9e10b57d..99e23053f59d69b12ffe2237e3782da701d066fc 100644 (file)
@@ -29,7 +29,9 @@
 #include "kfd_priv.h"
 #include "kfd_mqd_manager.h"
 
-#define QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS       (500)
+#define KFD_UNMAP_LATENCY_MS                   (4000)
+#define QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS (2 * KFD_UNMAP_LATENCY_MS + 1000)
+
 #define CIK_VMID_NUM                           (8)
 #define KFD_VMID_START_OFFSET                  (8)
 #define VMID_PER_DEVICE                                CIK_VMID_NUM
index ed71ad40e8f797ca3c7b7d4f129f5e9fda382d27..d53d32a91a16c9fde2974509ae30762eb161ea8b 100644 (file)
@@ -185,7 +185,7 @@ static void uninitialize(struct kernel_queue *kq)
                kq->mqd->destroy_mqd(kq->mqd,
                                        kq->queue->mqd,
                                        KFD_PREEMPT_TYPE_WAVEFRONT_RESET,
-                                       QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS,
+                                       KFD_UNMAP_LATENCY_MS,
                                        kq->queue->pipe,
                                        kq->queue->queue);
        else if (kq->queue->properties.type == KFD_QUEUE_TYPE_DIQ)
index 1d312603de9fbb1624a98fbfac9a3d240490bf4b..9eda884d8d4866ba0ff94aca834a38fff8445442 100644 (file)
@@ -376,7 +376,7 @@ int pm_send_set_resources(struct packet_manager *pm,
        packet->bitfields2.queue_type =
                        queue_type__mes_set_resources__hsa_interface_queue_hiq;
        packet->bitfields2.vmid_mask = res->vmid_mask;
-       packet->bitfields2.unmap_latency = KFD_UNMAP_LATENCY;
+       packet->bitfields2.unmap_latency = KFD_UNMAP_LATENCY_MS / 100;
        packet->bitfields7.oac_mask = res->oac_mask;
        packet->bitfields8.gds_heap_base = res->gds_heap_base;
        packet->bitfields8.gds_heap_size = res->gds_heap_size;
index f37fbfd0e917e149b6e673793d086c0dd33f1de8..8883416634d39a1474450e5c581f77346a6ee51d 100644 (file)
@@ -676,11 +676,8 @@ int amdkfd_fence_wait_timeout(unsigned int *fence_addr,
 
 /* Packet Manager */
 
-#define KFD_HIQ_TIMEOUT (500)
-
 #define KFD_FENCE_COMPLETED (100)
 #define KFD_FENCE_INIT   (10)
-#define KFD_UNMAP_LATENCY (150)
 
 struct packet_manager {
        struct device_queue_manager *dqm;