STRUCT XE_GT_STATS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 by enum xe_gt_stats_id. yes bestie, the enum is doing the indexing, she's the main character here, counters is 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 the this_cpu_add macro. 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_add or 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