Skip to contentSkip to conversation

drm/amdkfd: Print a warning when the runlist becomes oversubscribed

PATCH In review Kuehling, Felix 2 participants 4 messages Jun 20, 2019 – Jul 2, 2019 2 messages not in the archive

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

PATCH 1/1 drm/amdkfd: Print a warning when the runlist becomes oversubscribed

Oversubscription of queues or processes results in poor performance mostly because HWS blinbly schedules busy and idle queues, resulting in poor occupancy if many queues are idle.

Let users know with a warning message when transitioning from a non-oversubscribed to an oversubscribed runlist.

---
 drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 6 +++++-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h           | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +5 -1
index c72c8f5fd54c..ccf6b2310316 100644
@@ -203,11 +203,15 @@ static int pm_create_runlist_ib(struct packet_manager *pm,
 
 	pr_debug("Finished map process and queues to runlist\n");
 
-	if (is_over_subscription)
+	if (is_over_subscription) {
+		if (!pm->is_over_subscription)
+			pr_warn("Runlist is getting oversubscribed. Expect reduced ROCm performance.\n");
 		retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr],
 					*rl_gpu_addr,
 					alloc_size_bytes / sizeof(uint32_t),
 					true);
+	}
+	pm->is_over_subscription = is_over_subscription;
 
 	for (i = 0; i < alloc_size_bytes / sizeof(uint32_t); i++)
 		pr_debug("0x%2X ", rl_buffer[i]);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
index 4070e6d24ef7..d4bba0124d29 100644
@@ -937,6 +937,7 @@ struct packet_manager {
 	bool allocated;
 	struct kfd_mem_obj *ib_buffer_obj;
 	unsigned int ib_size_bytes;
+	bool is_over_subscription;
 
 	const struct packet_manager_funcs *pmf;
 };
Signature · 6 lines
2.17.1

_______________________________________________
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): 20190620194309.11148-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org

Reviewed-by Oak Zeng
#2 lore raw

Regards,
Oak

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Kuehling, Felix
Sent: Thursday, June 20, 2019 3:43 PM
To: [email protected]
Cc: Kuehling, Felix <[email protected]>
Subject: [PATCH 1/1] drm/amdkfd: Print a warning when the runlist becomes oversubscribed

Oversubscription of queues or processes results in poor performance mostly because HWS blinbly schedules busy and idle queues, resulting in poor occupancy if many queues are idle.

Let users know with a warning message when transitioning from a non-oversubscribed to an oversubscribed runlist.

---
 drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 6 +++++-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h           | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +6 -1
index c72c8f5fd54c..ccf6b2310316 100644
@@ -203,11 +203,15 @@ static int pm_create_runlist_ib(struct packet_manager *pm,
 
 	pr_debug("Finished map process and queues to runlist\n");
 
-	if (is_over_subscription)
+	if (is_over_subscription) {
+		if (!pm->is_over_subscription)
+			pr_warn("Runlist is getting oversubscribed. Expect reduced ROCm 
+performance.\n");
 		retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr],
 					*rl_gpu_addr,
 					alloc_size_bytes / sizeof(uint32_t),
 					true);
+	}
+	pm->is_over_subscription = is_over_subscription;
 
 	for (i = 0; i < alloc_size_bytes / sizeof(uint32_t); i++)

pr_debug("0x%2X ", rl_buffer[i]);

drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -1
index 4070e6d24ef7..d4bba0124d29 100644
@@ -937,6 +937,7 @@ struct packet_manager {
 	bool allocated;
 	struct kfd_mem_obj *ib_buffer_obj;
 	unsigned int ib_size_bytes;
+	bool is_over_subscription;
 
 	const struct packet_manager_funcs *pmf;  };
--

2.17.1

_______________________________________________
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

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

Ping.

Shaoyun, do you mind reviewing this patch?

Thanks,
  Felix

Quoted 39 lines · Felix

Oversubscription of queues or processes results in poor performance mostly because HWS blinbly schedules busy and idle queues, resulting in poor occupancy if many queues are idle.

Let users know with a warning message when transitioning from a non-oversubscribed to an oversubscribed runlist.

---
  drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 6 +++++-
  drivers/gpu/drm/amd/amdkfd/kfd_priv.h           | 1 +
  2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +5 -1
index c72c8f5fd54c..ccf6b2310316 100644
@@ -203,11 +203,15 @@ static int pm_create_runlist_ib(struct packet_manager *pm,
 
  	pr_debug("Finished map process and queues to runlist\n");
 
-	if (is_over_subscription)
+	if (is_over_subscription) {
+		if (!pm->is_over_subscription)
+			pr_warn("Runlist is getting oversubscribed. Expect reduced ROCm performance.\n");
  		retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr],
  					*rl_gpu_addr,
  					alloc_size_bytes / sizeof(uint32_t),
  					true);
+	}
+	pm->is_over_subscription = is_over_subscription;
 
  	for (i = 0; i < alloc_size_bytes / sizeof(uint32_t); i++)
  		pr_debug("0x%2X ", rl_buffer[i]);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +0 -0
index 4070e6d24ef7..d4bba0124d29 100644

drivers/gpu/drm/amd/amdkfd/kfd_priv.h struct packet_manager { · line 943

Quoted 7 lines
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
@@ -937,6 +937,7 @@ struct packet_manager {
  	bool allocated;
  	struct kfd_mem_obj *ib_buffer_obj;
  	unsigned int ib_size_bytes;
+	bool is_over_subscription;
 
  	const struct packet_manager_funcs *pmf;
  };

_______________________________________________
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): 62b2f458-0b8e-f069-5ac2-2a56bcf5674d-5C7GfCeVMHo@public.gmane.org

#5 lore raw
Quoted 3 lines · Felix

Ping.

Shaoyun, do you mind reviewing this patch?

Sorry, never mind. I missed that Oak already reviewed it.

Thank you Oak!

Quoted 49 lines

Thanks,
  Felix

Quoted 44 lines · Felix

Oversubscription of queues or processes results in poor performance mostly because HWS blinbly schedules busy and idle queues, resulting in poor occupancy if many queues are idle.

Let users know with a warning message when transitioning from a non-oversubscribed to an oversubscribed runlist.

---
   drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 6 +++++-
   drivers/gpu/drm/amd/amdkfd/kfd_priv.h           | 1 +
   2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +5 -1
index c72c8f5fd54c..ccf6b2310316 100644
@@ -203,11 +203,15 @@ static int pm_create_runlist_ib(struct packet_manager *pm,
 
   	pr_debug("Finished map process and queues to runlist\n");
 
-	if (is_over_subscription)
+	if (is_over_subscription) {
+		if (!pm->is_over_subscription)
+			pr_warn("Runlist is getting oversubscribed. Expect reduced ROCm performance.\n");
   		retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr],
   					*rl_gpu_addr,
   					alloc_size_bytes / sizeof(uint32_t),
   					true);
+	}
+	pm->is_over_subscription = is_over_subscription;
 
   	for (i = 0; i < alloc_size_bytes / sizeof(uint32_t); i++)
   		pr_debug("0x%2X ", rl_buffer[i]);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
index 4070e6d24ef7..d4bba0124d29 100644
@@ -937,6 +937,7 @@ struct packet_manager {
   	bool allocated;
   	struct kfd_mem_obj *ib_buffer_obj;
   	unsigned int ib_size_bytes;
+	bool is_over_subscription;
 
Quoted 6 lines

drivers/gpu/drm/amd/amdkfd/kfd_priv.h struct packet_manager { · line 943

Quoted 2 lines
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +0 -0
   	const struct packet_manager_funcs *pmf;
   };

_______________________________________________
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