STRUCT DRM_SCHED_ENTITY_STATS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct drm_...entity_stats(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” this page is literally all about struct drm_sched_entity_stats, aka the execution stats for an entity. no cap, it's giving "how much GPU time did this entity eat?" energy. πŸ“


✨ NAME ✨

struct drm_sched_entity_stats β€” execution stats for an entity. πŸ’…

🌸 SYNOPSIS 🌸

       struct drm_sched_entity_stats {
           struct kref     kref;
           spinlock_t lock;
           ktime_t runtime;
           ktime_t prev_runtime;
           ktime_t vruntime;
           struct ewma_drm_sched_avgtime   avg_job_us;
        };

πŸ‘― Members πŸ‘―

  • kref β€” reference count for the object. πŸ’–
  • lock β€” lock guarding the runtime updates. πŸ”’
  • runtime β€” time entity spent on the GPU. ⏳
  • prev_runtime β€” previous runtime used to get the runtime delta. πŸŒ€
  • vruntime β€” virtual runtime as accumulated by the fair algorithm. 🧚
  • avg_job_us β€” average job duration. πŸ“Š

πŸ’– Description πŸ’–

okay so here's the whole vibe: jobs and entities have decoupled lifetimes, ie. once the job has been de-queued we literally cannot access the entity anymore. 😭 but we do need know how much GPU time each entity has spent. so we track this in a separate object, and that object is reference counted by both entities and jobs. periodt. 🫢

πŸ”₯ SEE ALSO πŸ”₯


cute little sign-off bestie: this page lives under ./drivers/gpu/drm/scheduler, dated October 2026, and it's all about struct drm_...entity_stats(9). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from