drm/xe/gt_stats: Use atomic64_t for counters
authorFrancois Dugast <francois.dugast@intel.com>
Tue, 25 Feb 2025 19:57:33 +0000 (20:57 +0100)
committerFrancois Dugast <francois.dugast@intel.com>
Wed, 26 Feb 2025 10:01:00 +0000 (11:01 +0100)
commit4f109b061c12d63b332338ce9192593842fa09a4
treebade5b0bcf3be9c90cbc5fefe6280d6888afb0e7
parent18fbd567e75f9b97b699b2ab4f1fa76b7cf268f6
drm/xe/gt_stats: Use atomic64_t for counters

The stats counters are now used for things like counting the VMA
bytes during page faults. During workload execution, the counter
value can grow fast and easily reach the atomic int limit, in
which case it overflows. To make this less likely to happen, push
the limit by switching to 64b atomic to store the counter value.
Overhead is very small as there are only 3 stat entries per GT as
of now, and stats are only enabled with CONFIG_DEBUG_FS.

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-2-francois.dugast@intel.com
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
drivers/gpu/drm/xe/xe_gt_stats.c
drivers/gpu/drm/xe/xe_gt_types.h