mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
drm/xe: Add new SVM copy GT stats per size
Breakdown the GT stats for copy to host and copy to device per size (4K, 64K 2M) to make it easier for user space to track memory migrations. This is helpful to verify allocation alignment is correct when porting applications to SVM. Cc: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260325160152.1057556-1-francois.dugast@intel.com
This commit is contained in:
parent
50c577eab0
commit
4e966014ce
|
|
@ -85,7 +85,13 @@ static const char *const stat_description[__XE_GT_STATS_NUM_IDS] = {
|
|||
DEF_STAT_STR(SVM_64K_CPU_COPY_US, "svm_64K_cpu_copy_us"),
|
||||
DEF_STAT_STR(SVM_2M_CPU_COPY_US, "svm_2M_cpu_copy_us"),
|
||||
DEF_STAT_STR(SVM_DEVICE_COPY_KB, "svm_device_copy_kb"),
|
||||
DEF_STAT_STR(SVM_4K_DEVICE_COPY_KB, "svm_4K_device_copy_kb"),
|
||||
DEF_STAT_STR(SVM_64K_DEVICE_COPY_KB, "svm_64K_device_copy_kb"),
|
||||
DEF_STAT_STR(SVM_2M_DEVICE_COPY_KB, "svm_2M_device_copy_kb"),
|
||||
DEF_STAT_STR(SVM_CPU_COPY_KB, "svm_cpu_copy_kb"),
|
||||
DEF_STAT_STR(SVM_4K_CPU_COPY_KB, "svm_4K_cpu_copy_kb"),
|
||||
DEF_STAT_STR(SVM_64K_CPU_COPY_KB, "svm_64K_cpu_copy_kb"),
|
||||
DEF_STAT_STR(SVM_2M_CPU_COPY_KB, "svm_2M_cpu_copy_kb"),
|
||||
DEF_STAT_STR(SVM_4K_GET_PAGES_US, "svm_4K_get_pages_us"),
|
||||
DEF_STAT_STR(SVM_64K_GET_PAGES_US, "svm_64K_get_pages_us"),
|
||||
DEF_STAT_STR(SVM_2M_GET_PAGES_US, "svm_2M_get_pages_us"),
|
||||
|
|
|
|||
|
|
@ -40,7 +40,13 @@ enum xe_gt_stats_id {
|
|||
XE_GT_STATS_ID_SVM_64K_CPU_COPY_US,
|
||||
XE_GT_STATS_ID_SVM_2M_CPU_COPY_US,
|
||||
XE_GT_STATS_ID_SVM_DEVICE_COPY_KB,
|
||||
XE_GT_STATS_ID_SVM_4K_DEVICE_COPY_KB,
|
||||
XE_GT_STATS_ID_SVM_64K_DEVICE_COPY_KB,
|
||||
XE_GT_STATS_ID_SVM_2M_DEVICE_COPY_KB,
|
||||
XE_GT_STATS_ID_SVM_CPU_COPY_KB,
|
||||
XE_GT_STATS_ID_SVM_4K_CPU_COPY_KB,
|
||||
XE_GT_STATS_ID_SVM_64K_CPU_COPY_KB,
|
||||
XE_GT_STATS_ID_SVM_2M_CPU_COPY_KB,
|
||||
XE_GT_STATS_ID_SVM_4K_GET_PAGES_US,
|
||||
XE_GT_STATS_ID_SVM_64K_GET_PAGES_US,
|
||||
XE_GT_STATS_ID_SVM_2M_GET_PAGES_US,
|
||||
|
|
|
|||
|
|
@ -485,10 +485,33 @@ static void xe_svm_copy_kb_stats_incr(struct xe_gt *gt,
|
|||
const enum xe_svm_copy_dir dir,
|
||||
int kb)
|
||||
{
|
||||
if (dir == XE_SVM_COPY_TO_VRAM)
|
||||
if (dir == XE_SVM_COPY_TO_VRAM) {
|
||||
switch (kb) {
|
||||
case 4:
|
||||
xe_gt_stats_incr(gt, XE_GT_STATS_ID_SVM_4K_DEVICE_COPY_KB, kb);
|
||||
break;
|
||||
case 64:
|
||||
xe_gt_stats_incr(gt, XE_GT_STATS_ID_SVM_64K_DEVICE_COPY_KB, kb);
|
||||
break;
|
||||
case 2048:
|
||||
xe_gt_stats_incr(gt, XE_GT_STATS_ID_SVM_2M_DEVICE_COPY_KB, kb);
|
||||
break;
|
||||
}
|
||||
xe_gt_stats_incr(gt, XE_GT_STATS_ID_SVM_DEVICE_COPY_KB, kb);
|
||||
else
|
||||
} else {
|
||||
switch (kb) {
|
||||
case 4:
|
||||
xe_gt_stats_incr(gt, XE_GT_STATS_ID_SVM_4K_CPU_COPY_KB, kb);
|
||||
break;
|
||||
case 64:
|
||||
xe_gt_stats_incr(gt, XE_GT_STATS_ID_SVM_64K_CPU_COPY_KB, kb);
|
||||
break;
|
||||
case 2048:
|
||||
xe_gt_stats_incr(gt, XE_GT_STATS_ID_SVM_2M_CPU_COPY_KB, kb);
|
||||
break;
|
||||
}
|
||||
xe_gt_stats_incr(gt, XE_GT_STATS_ID_SVM_CPU_COPY_KB, kb);
|
||||
}
|
||||
}
|
||||
|
||||
static void xe_svm_copy_us_stats_incr(struct xe_gt *gt,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user