]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe: Convert GT stats to per-cpu counters
authorMatthew Brost <matthew.brost@intel.com>
Tue, 17 Feb 2026 20:05:52 +0000 (12:05 -0800)
committerMatthew Brost <matthew.brost@intel.com>
Wed, 18 Feb 2026 02:12:10 +0000 (18:12 -0800)
commit9ff885ef8b428febbf41f13a511755d74704949e
treec6d36a58ce1ddc4979d66f1619edad5c762e4ea9
parent48eb073c7d95883eca2789447f94e1e8cafbabe5
drm/xe: Convert GT stats to per-cpu counters

Current GT statistics use atomic64_t counters. Atomic operations incur
a global coherency penalty.

Transition to dynamic per-cpu counters using alloc_percpu(). This allows
stats to be incremented via this_cpu_add(), which compiles to a single
non-locking instruction. This approach keeps the hot-path updates local
to the CPU, avoiding expensive cross-core cache invalidation traffic.

Use for_each_possible_cpu() during aggregation and clear operations to
ensure data consistency across CPU hotplug events.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Stuart Summers <stuart.summers@intel.com>
Link: https://patch.msgid.link/20260217200552.596718-1-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_gt.c
drivers/gpu/drm/xe/xe_gt_stats.c
drivers/gpu/drm/xe/xe_gt_stats.h
drivers/gpu/drm/xe/xe_gt_stats_types.h
drivers/gpu/drm/xe/xe_gt_types.h