STRUCT XE_FILE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct xe_file β€” the file handle for the Xe driver ✨

okay so real talk, this page lives in the Kernel API Manual, it's struct xe_file(9), and it's basically the little passport every open Xe file gets. Let's get into it 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

struct xe_file {
    struct xe_device *xe;
    struct drm_file *drm;
    struct {
      struct xarray xa;
      struct mutex lock;
    } vm;
    struct {
      struct xarray xa;
      struct mutex lock;
      atomic_t pending_removal;
    } exec_queue;
    u64 run_ticks[XE_ENGINE_CLASS_MAX];
    struct xe_drm_client *client;
    char *process_name;
    pid_t pid;
    struct kref refcount;
 };

πŸŽ€ MEMBERS πŸŽ€

  • xe β€” type xe DEVICE *. The Xe device this whole thing hangs off of, the main character fr πŸ‘‘
  • drm β€” the base DRM file. Like, the DRM-layer file that underpins this whole handle πŸ’…
  • vm β€” the VM state for this file 🌸
    • vm.xa β€” the xarray that stores the VMs πŸ—‚οΈ
    • vm.lock β€” protects VM lookup + reference and removal from the file xarray. And listen: this is not intended to be an outer lock that does things while being held. Nope. Not that vibe πŸ™ˆ
  • exec_queue β€” the submission exec queue state for this file πŸš€
    • exec_queue.xa β€” the xarray that stores the exec queues πŸ“¦
    • exec_queue.lock β€” protects exec queue lookup + reference and removal from the file xarray. Same rule as above, no cap: it is not intended to be an outer lock that does things while being held ⚠️
    • exec_queue.pending_removal β€” items pending to be removed, so that the GPU state update stays in sync with an ongoing query πŸ”„
  • run_ticks β€” hw engine class run time in ticks for this drm client. Literally the u64 run_ticks[XE_ENGINE_CLASS_MAX], one per engine class ⏱️
  • client β€” the drm client πŸ’œ
  • process_name β€” process name for the file handle, used to safely output during error situations where the xe file can outlive the process 😭 like, the process is gone but we still gotta print something nice
  • pid β€” pid for the file handle, used to safely output during error situations where the xe file can outlive the process 🫢 same energy, different field
  • refcount β€” ref count of this xe file. Keep it alive, bestie πŸ”₯

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/gpu/drm/xe/xe_device_types.h enum
  • xe_wedged_mode(9)
  • enum xe_page_size_alloc_ctrl_mode(9)
  • struct xe_device(9)

aaaand that's the whole page πŸ’€ go read those SEE ALSOs, iykyk 🧚

this one's from ./drivers/gpu/drm/xe, dated October 2026, page struct xe_file(9) β€” mwah, slay, periodt πŸ’…πŸ’–

πŸ“¦ where this page comes from