STRUCT DRM_GPUSVM_OPS(9)
β¨ struct drm_gpusvm_ops(9) β¨
okay so bestie, this is the manpage for struct drm_gpusvm_ops β it lives in the Kernel API Manual and honestly it's giving "the plug that makes GPU SVM work" energy. it's the ops structure for GPU SVM, and likeβ¦ it's literally the contract between the DRM core and your GPU driver. no cap. π«Ά
πΈ NAME πΈ
struct drm_gpusvm_ops β the operations structure for GPU SVM. that's the whole vibe. π
π SYNOPSIS π
struct drm_gpusvm_ops {
struct drm_gpusvm_notifier *(*notifier_alloc)(void);
void (*notifier_free)(struct drm_gpusvm_notifier *notifier);
struct drm_gpusvm_range *(*range_alloc)(struct drm_gpusvm *gpusvm);
void (*range_free)(struct drm_gpusvm_range *range);
void (*invalidate)(struct drm_gpusvm *gpusvm, struct drm_gpusvm_notifier *notifier, const struct mmu_notifier_range *mmu_range);
};
look at those function pointers. five of them. each one a little baddie with its own job. π
π¦ Members π¦
notifier_allocβ allocate a GPU SVM notifier (optional). literally just allocate a GPU SVM notifier, bestie.
Return: pointer to the allocated GPU SVM notifier on success, NULL on failure. so yeah, always check it. π
notifier_freeβ free a GPU SVM notifier (optional). takes notifier: pointer to the GPU SVM notifier to be freed. free a GPU SVM notifier. that's it. that's the whole function. we love a simple queen. β¨range_allocβ allocate a GPU SVM range (optional). takes gpusvm: pointer to the GPU SVM. allocate a GPU SVM range.
Return: pointer to the allocated GPU SVM range on success, NULL on failure. same deal as above, check your pointers fr fr. π
range_freeβ free a GPU SVM range (optional). takes range: pointer to the GPU SVM range to be freed. free a GPU SVM range. iconic, no notes. πinvalidateβ invalidate the GPU SVM notifier (required β like, you have to have this one, it's not optional, it's the main character). π- gpusvm: pointer to the GPU SVM
- notifier: pointer to the GPU SVM notifier
- mmu_range: pointer to the
mmu_notifier_rangestructure
what it does: invalidate the GPU page tables. and here's the cute part β it can safely walk the notifier range RB tree/list in this function. it's called while holding the notifier lock. π₯
heads up bestie:invalidateis the only one marked required. the other four say (optional). don't be out here leaving itNULL. π
π Description π
this structure defines the operations for GPU Shared Virtual Memory (SVM). these operations are provided by the GPU driver to manage SVM ranges and notifiers. that's the whole thing β it's the driver's side of the handshake, the "you handle the ranges and the notifiers, I'll hold the lock" situation. obsessed. π§
β SEE ALSO β
kernel file ./include/drm/drm_gpusvm.h β plus the whole friend group:
struct drm_gpusvm_notifier(9)struct drm_gpusvm_pages_flags(9)struct drm_gpusvm_pages(9)struct drm_gpusvm_range_flags(9)struct drm_gpusvm_range(9)struct drm_gpusvm(9)struct drm_gpusvm_ctx(9)drm_gpusvm_init_pages(9)enum drm_gpusvm_scan_result(9)drm_gpusvm_driver_set_lock(9)drm_gpusvm_notifier_lock(9)drm_gpusvm_notifier_unlock(9)drm_gpusvm_range_start(9)drm_gpusvm_range_end(9)drm_gpusvm_range_size(9)drm_gpusvm_notifier_start(9)drm_gpusvm_notifier_end(9)drm_gpusvm_notifier_size(9)__drm_gpusvm_range_next(9)drm_gpusvm_for_each_range(9)drm_gpusvm_for_each_range_safe(9)__drm_gpusvm_notifier_next(9)drm_gpusvm_for_each_notifier(9)drm_gpusvm_for_each_notifier_safe(9)
like, read them all. iykyk. π₯
π that's the page!! this one came from<pink>./include/drm</pink>, dated<purple>October 2026</purple>, and it's filed understruct drm_gpusvm_ops(9). go forth and populate your ops struct, bestie β you got this. slay. πβ¨
π¦ 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