STRUCT DRM_GPUSVM_CTX(9)
π struct drm_gpusvm_ctx(9) β DRM GPU SVM context π
okay bestie, welcome to the Kernel API Manual β yes we're in the kernel today, and yes you're gonna slay it. this page is literally all about struct drm_gpusvm_ctx, the DRM GPU SVM context. it's giving "user arguments but make it a struct." let's get into it π¦
β¨ NAME β¨
struct drm_gpusvm_ctx β the DRM GPU SVM context, periodt. no cap, that's the whole vibe π
π«Ά SYNOPSIS π«Ά
here's the struct in all its iconic glory β copy it exactly, don't you dare touch a single space:
struct drm_gpusvm_ctx {
void *device_private_page_owner;
unsigned long check_pages_threshold;
unsigned long timeslice_ms;
unsigned int in_notifier :1;
unsigned int read_only :1;
unsigned int devmem_possible :1;
unsigned int devmem_only :1;
unsigned int allow_mixed :1;
};
look at those bitfields. chef's kiss π§
πΈ Members πΈ
device_private_page_ownerβ the device-private page owner you're rolling with for this operation. it's the main character of this field, fr fr πcheck_pages_thresholdβ check CPU pages for present if the chunk is less than or equal to this threshold. and if it's not present? reduce the chunk size. simple as that πtimeslice_msβ the timesliceMS, which is the minimum time a piece of memory remains with either exclusive GPU or CPU access. like a custody arrangement but for memory πin_notifierβ entering from a MMU notifier π¦read_onlyβ operating on read-only memory. hands off π₯devmem_possibleβ possible to use device memory β¨devmem_onlyβ use only device memory. no mixing, no sharing, we're exclusive πallow_mixedβ allow mixed mappings in get pages. mixing between system and singledpagemapis supported, but mixing between multipledpagemapis unsupported. so like, know the difference, iykyk π
β Description β
this is the context that DRM GPUSVM is operating in β basically, it's the user arguments. the whole vibe check of "what are we even doing here." π
π SEE ALSO π
go read these next, bestie, they're all linked:
- kernel file
./include/drm/drm_gpusvm.h struct drm_gpusvm_ops(9)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)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)
bestie reminder: this page lives in ./include/drm and it's dated October 2026 β yes, the future. we stay ahead π
okay that's the whole page, you ate that π mwah, go read the range and notifier pages next, ily! πβ¨π
π¦ 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