STRUCT DRM_GPUSVM(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct drm_gpusvm β€” NAME

okay so, struct drm_gpusvm β€” literally just the GPU SVM structure, bestie. that's the whole name. that's it. that's the vibe. ✨

This is page struct drm_gpusvm(9) from the Kernel API Manual, and we're gonna get into it.


🌸 SYNOPSIS

struct drm_gpusvm {
    const char *name;
    struct mm_struct *mm;
    unsigned long mm_start;
    unsigned long mm_range;
    unsigned long notifier_size;
    const struct drm_gpusvm_ops *ops;
    const unsigned long *chunk_sizes;
    int num_chunks;
    struct rw_semaphore notifier_lock;
    struct rb_root_cached root;
    struct list_head notifier_list;
  #ifdef CONFIG_LOCKDEP;
    struct lockdep_map *lock_dep_map;
  #endif;
 };

look at her. iconic. no notes. 🫢


πŸŽ€ Members

  • name β€” the name of the GPU SVM. yeah she has a name, she's that girl πŸ’…
  • mm β€” pointer to the mm_struct for the address space. your link to the actual memory map, iykyk 🌈
  • mm_start β€” the start address of the GPU SVM. where the party begins πŸŽ‰
  • mm_range β€” the range of the GPU SVM. how far the party goes πŸ“
  • notifier_size β€” the size of individual notifiers. one size, per notifier, that's it ✨
  • ops β€” pointer to the operations structure for GPU SVM. the callback squad, the real MVPs πŸ‘‘
  • chunk_sizes β€” pointer to the array of chunk sizes used in range allocation. important: entries should be powers of 2 in descending order. not me stressing about the ordering 😭 it's powers of 2, descending, periodt 🧚
  • num_chunks β€” number of chunks. the headcount for your chunk party πŸ¦‹
  • notifier_lock β€” a read-write semaphore for protecting notifier operations. security for the notifiers, no cap πŸ”₯
  • root β€” the cached root node of the Red-Black tree containing GPU SVM notifiers. yes, an RB tree, yes it's still serving 🌳
  • notifier_list β€” a list head containing the notifiers in the same order they appear in the interval tree. this is useful to keep iterating notifiers while doing modifications to RB tree. honestly? a lifesaver. you can keep walking the list while the tree is getting rearranged, lowkey genius πŸ’–
  • lock_dep_map β€” annotates drm_gpusvm_range_find_or_insert and drm_gpusvm_range_remove with a driver provided lock. yes this one's inside the lockdep ifdef, hi <kbd> no wait β€” it's under #ifdef CONFIG_LOCKDEP; babes πŸ”’

πŸ’« Description

okay so here's the tea: this structure represents a GPU SVM (Shared Virtual Memory) used for tracking memory ranges mapped in a DRM (Direct Rendering Manager) device. 🌸

and this is the important bit, so listen up: no reference counting is provided, as this is expected to be embedded in the driver VM structure along with the struct drm_gpuvm, which handles reference counting. so don't come for her for not counting refs β€” that's drm_gpuvm's job, and she said what she said πŸ’€

🌟 SEE ALSO


that's the whole page, bestie, you ate it up πŸ’…βœ¨

sign-off time: this one lives in ./include/drm, dated October 2026, and it's struct drm_gpusvm(9) β€” slay, go read the header, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from