drm_gpusvm_scan_mm(9)
β¨ drm_gpusvm_scan_mm(9) β the Kernel API Manual, bestie edition β¨
okay so you're looking at drm_gpusvm_scan_mm, straight out of the Kernel API Manual, and honestly? she's a little vibe-checker for your GPU SVM ranges π«Ά
πΈ NAME πΈ
drm_gpusvm_scan_mm β check the migration state of a drm_gpusvm_range π
β SYNOPSIS β
enum drm_gpusvm_scan_result drm_gpusvm_scan_mm (struct drm_gpusvm_range
*range , void *dev_private_owner , const struct dev_pagemap *pagemap );
like, that's the whole signature, no cap π
π ARGUMENTS π
rangeβ pointer to thestruct drm_gpusvm_rangeyou wanna check, bestie. that's the one we're scanning, periodt.dev_private_ownerβ thestruct dev_private_owneryou use to figure out which device-private pages are compatible. it's giving "who's allowed in the club" energy.pagemapβ thestruct dev_pagemappointer used for pagemap-specific checks. yes, specific checks. she's thorough. β¨
π¦ DESCRIPTION π¦
So what she does is scan the CPU address space that corresponds to range and hand you back the current migration state. Simple, iconic, done. π
β οΈ But hear me out: the result may be invalid as soon as the function returns. It's an advisory check, not a promise. lowkey important, don't @ me.
TODO: bail early and call hmm_range_fault for subranges. (not me leaving a TODO in the docs, it's literally in the source π)
π₯ RETURN π₯
See enum drm_gpusvm_scan_result. that's it, that's the return. iykyk β
π SEE ALSO π
Kernel file ./drivers/gpu/drm/drm_gpusvm.c and honestly the whole friend group:
Overview(9)Locking(9)Partial Unmapping of Ranges(9)Examples(9)npages_in_range(9)drm_gpusvm_notifier_find(9)drm_gpusvm_range_find(9)drm_gpusvm_notifier_invalidate(9)drm_gpusvm_init(9)to_drm_gpusvm_notifier(9)drm_gpusvm_notifier_insert(9)drm_gpusvm_notifier_remove(9)drm_gpusvm_fini(9)drm_gpusvm_notifier_alloc(9)drm_gpusvm_notifier_free(9)to_drm_gpusvm_range(9)drm_gpusvm_range_insert(9)__drm_gpusvm_range_remove(9)drm_gpusvm_range_alloc(9)drm_gpusvm_hmm_pfn_to_order(9)drm_gpusvm_check_pages(9)drm_gpusvm_range_chunk_size(9)drm_gpusvm_driver_lock_held(9)drm_gpusvm_find_vma_start(9)drm_gpusvm_range_find_or_insert(9)__drm_gpusvm_unmap_pages(9)__drm_gpusvm_free_pages(9)drm_gpusvm_free_pages(9)drm_gpusvm_range_remove(9)drm_gpusvm_range_get(9)drm_gpusvm_range_destroy(9)drm_gpusvm_range_put(9)drm_gpusvm_pages_valid(9)drm_gpusvm_pages_valid_unlocked(9)drm_gpusvm_get_pages(9)drm_gpusvm_unmap_pages(9)drm_gpusvm_range_evict(9)drm_gpusvm_has_mapping(9)drm_gpusvm_range_set_unmapped(9)
and that's the page!! π sourced from ./drivers/gpu/drm, dated October 2026, and yes she ate. go read the kernel file bestie, ily, bye π
ππ¦
π¦ 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