drm/xe/gt_pagefault: Change vma_pagefault unit to kilobyte
authorFrancois Dugast <francois.dugast@intel.com>
Tue, 25 Feb 2025 19:57:34 +0000 (20:57 +0100)
committerFrancois Dugast <francois.dugast@intel.com>
Wed, 26 Feb 2025 10:01:00 +0000 (11:01 +0100)
Increase the amount of bytes that can be counted before the counter
overflows, while not losing information as the VMA is not expected
to have sub-kilobyte size.

Suggested-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250225195902.1247100-3-francois.dugast@intel.com
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
drivers/gpu/drm/xe/xe_gt_pagefault.c
drivers/gpu/drm/xe/xe_gt_stats.c
drivers/gpu/drm/xe/xe_gt_stats_types.h

index 46701ca11ce0daa23ecf781e0df13bc0fbbf33eb..17d69039b8666c677534003cd73889d424459b68 100644 (file)
@@ -137,7 +137,7 @@ static int handle_vma_pagefault(struct xe_gt *gt, struct pagefault *pf,
        bool atomic;
 
        xe_gt_stats_incr(gt, XE_GT_STATS_ID_VMA_PAGEFAULT_COUNT, 1);
-       xe_gt_stats_incr(gt, XE_GT_STATS_ID_VMA_PAGEFAULT_BYTES, xe_vma_size(vma));
+       xe_gt_stats_incr(gt, XE_GT_STATS_ID_VMA_PAGEFAULT_KB, xe_vma_size(vma) / 1024);
 
        trace_xe_vma_pagefault(vma);
        atomic = access_is_atomic(pf->access_type);
index af3fd03f665c5770bb7b4c9671aad1a6cb30107d..6155ea3544329d1a69fab2364d212244d6ae2975 100644 (file)
@@ -29,7 +29,7 @@ void xe_gt_stats_incr(struct xe_gt *gt, const enum xe_gt_stats_id id, int incr)
 static const char *const stat_description[__XE_GT_STATS_NUM_IDS] = {
        "tlb_inval_count",
        "vma_pagefault_count",
-       "vma_pagefault_bytes",
+       "vma_pagefault_kb",
 };
 
 /**
index b072bd80c4b975bac48eaa371ad23fd94d90c863..d556771f99d65c6272153c6598d50e735d5e1007 100644 (file)
@@ -9,7 +9,7 @@
 enum xe_gt_stats_id {
        XE_GT_STATS_ID_TLB_INVAL,
        XE_GT_STATS_ID_VMA_PAGEFAULT_COUNT,
-       XE_GT_STATS_ID_VMA_PAGEFAULT_BYTES,
+       XE_GT_STATS_ID_VMA_PAGEFAULT_KB,
        /* must be the last entry */
        __XE_GT_STATS_NUM_IDS,
 };