Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdkfd: Differentiate logging message for driver oversubscription

To have user better understand the causes triggering runlist oversubscription.
No function change.

Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com>
Reviewed-by: Harish Kasiviswanathan <harish.kasiviswanathan@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Xiaogang Chen and committed by
Alex Deucher
9aa879da 9b995d1a

+25 -13
+25 -13
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
··· 28 28 #include "kfd_kernel_queue.h" 29 29 #include "kfd_priv.h" 30 30 31 + #define OVER_SUBSCRIPTION_PROCESS_COUNT (1 << 0) 32 + #define OVER_SUBSCRIPTION_COMPUTE_QUEUE_COUNT (1 << 1) 33 + #define OVER_SUBSCRIPTION_GWS_QUEUE_COUNT (1 << 2) 34 + 31 35 static inline void inc_wptr(unsigned int *wptr, unsigned int increment_bytes, 32 36 unsigned int buffer_size_bytes) 33 37 { ··· 44 40 45 41 static void pm_calc_rlib_size(struct packet_manager *pm, 46 42 unsigned int *rlib_size, 47 - bool *over_subscription) 43 + int *over_subscription) 48 44 { 49 45 unsigned int process_count, queue_count, compute_queue_count, gws_queue_count; 50 46 unsigned int map_queue_size; ··· 62 58 * hws_max_conc_proc has been done in 63 59 * kgd2kfd_device_init(). 64 60 */ 65 - *over_subscription = false; 61 + *over_subscription = 0; 66 62 67 63 if (node->max_proc_per_quantum > 1) 68 64 max_proc_per_quantum = node->max_proc_per_quantum; 69 65 70 - if ((process_count > max_proc_per_quantum) || 71 - compute_queue_count > get_cp_queues_num(pm->dqm) || 72 - gws_queue_count > 1) { 73 - *over_subscription = true; 66 + if (process_count > max_proc_per_quantum) 67 + *over_subscription |= OVER_SUBSCRIPTION_PROCESS_COUNT; 68 + if (compute_queue_count > get_cp_queues_num(pm->dqm)) 69 + *over_subscription |= OVER_SUBSCRIPTION_COMPUTE_QUEUE_COUNT; 70 + if (gws_queue_count > 1) 71 + *over_subscription |= OVER_SUBSCRIPTION_GWS_QUEUE_COUNT; 72 + 73 + if (*over_subscription) 74 74 dev_dbg(dev, "Over subscribed runlist\n"); 75 - } 76 75 77 76 map_queue_size = pm->pmf->map_queues_size; 78 77 /* calculate run list ib allocation size */ ··· 96 89 unsigned int **rl_buffer, 97 90 uint64_t *rl_gpu_buffer, 98 91 unsigned int *rl_buffer_size, 99 - bool *is_over_subscription) 92 + int *is_over_subscription) 100 93 { 101 94 struct kfd_node *node = pm->dqm->dev; 102 95 struct device *dev = node->adev->dev; ··· 141 134 struct qcm_process_device *qpd; 142 135 struct queue *q; 143 136 struct kernel_queue *kq; 144 - bool is_over_subscription; 137 + int is_over_subscription; 145 138 146 139 rl_wptr = retval = processes_mapped = 0; 147 140 ··· 220 213 221 214 if (is_over_subscription) { 222 215 if (!pm->is_over_subscription) 223 - dev_warn( 224 - dev, 225 - "Runlist is getting oversubscribed. Expect reduced ROCm performance.\n"); 216 + dev_warn(dev, "Runlist is getting oversubscribed due to%s%s%s. Expect reduced ROCm performance.\n", 217 + is_over_subscription & OVER_SUBSCRIPTION_PROCESS_COUNT ? 218 + " too many processes." : "", 219 + is_over_subscription & OVER_SUBSCRIPTION_COMPUTE_QUEUE_COUNT ? 220 + " too many queues." : "", 221 + is_over_subscription & OVER_SUBSCRIPTION_GWS_QUEUE_COUNT ? 222 + " multiple processes using cooperative launch." : ""); 223 + 226 224 retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr], 227 225 *rl_gpu_addr, 228 226 alloc_size_bytes / sizeof(uint32_t), 229 227 true); 230 228 } 231 - pm->is_over_subscription = is_over_subscription; 229 + pm->is_over_subscription = !!is_over_subscription; 232 230 233 231 for (i = 0; i < alloc_size_bytes / sizeof(uint32_t); i++) 234 232 pr_debug("0x%2X ", rl_buffer[i]);