drm/xe: Add stats for vma page faults
authorFrancois Dugast <francois.dugast@intel.com>
Thu, 6 Feb 2025 13:45:50 +0000 (14:45 +0100)
committerFrancois Dugast <francois.dugast@intel.com>
Fri, 7 Feb 2025 10:02:44 +0000 (11:02 +0100)
commit5b380838930f1fb74d38f34ca4bff43416db01c3
tree2bcc52786ac884c9404950ef97646bdc2fb0e282
parent01aebfaeff324d21f559a696016e13640f59b297
drm/xe: Add stats for vma page faults

Add new entries in stats for vma page faults. If CONFIG_DEBUG_FS is
enabled, the count and number of bytes can be viewed per GT in the
stat debugfs file. This helps when testing, to confirm page faults
have been triggered as expected. It also helps when looking at the
performance impact of page faults. Data is simply collected when
entering the page fault handler so there is no indication whether
it completed successfully, with or without retries, etc.

Example output:

    cat /sys/kernel/debug/dri/0/gt0/stats
    tlb_inval_count: 129
    vma_pagefault_count: 12
    vma_pagefault_bytes: 98304

v2: Rebase

Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250206134551.1321265-1-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