STRUCT XE_GT_STATS(9)
π struct xe_gt_stats(9) π
okay so bestie, welcome to the Kernel API Manual β this is the tea on struct xe_gt_stats, and honestly? she's serving per-CPU GT statistics counters and I'm obsessed. β¨
πΈ NAME πΈ
struct xe_gt_stats β Per-CPU GT statistics counters. that's it, that's the whole vibe. counters. per-CPU. slay. π
β¨ SYNOPSIS β¨
struct xe_gt_stats {
u64 counters[__XE_GT_STATS_NUM_IDS];
};
like, look at her. simple. elegant. u64 array, no drama, no cap. π
π¦ Members π¦
countersβ an array of 64-bit counters, indexed byenum xe_gt_stats_id. yes bestie, the enum is doing the indexing, she's the main character here,countersis just living her best life in the array. π₯
π Description π
okay so here's the lore. π§ this structure is used for high-frequency, per-CPU statistics collection in the Xe driver. high-frequency. she's busy. she's booked and blessed. π
the way that it works is so smart ngl β by using a per-CPU allocation and making sure the structure is cache-line aligned, we dodge all the performance-heavy atomics and the cache coherency traffic. like, we simply do not have the time for that overhead, and honestly? iconic. β¨
π real talk though: updates to these counters should be performed using thethis_cpu_addmacro. that's the rule, bestie β that's the only way you keep them atomic with respect to local interrupts and preemption-safe without the overhead of explicit locking.this_cpu_addor it didn't happen. periodt. π«Ά
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/xe/xe_gt_stats_types.h - enum
xe_gt_stats_id(9)
and that's the whole page, babes π β officially coming at you from ./drivers/gpu/drm/xe, dated October 2026, going out as struct xe_gt_stats(9). mwah, go forth and count your stats per-CPU, ily, bye πππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms