PARTIAL UNMAPPING OF RANGES(9)
π Partial Unmapping of Ranges β¨
okay bestie, welcome to the Kernel API Manual entry for Partial Unmapping of Ranges β and honestly itβs giving βtiny unmap, big feelingsβ ππ
Partial unmapping of ranges (like, for real, when 1M out of 2M is unmapped by CPU, resulting in an MMU_NOTIFY_UNMAP event) presents several challenges π«Ά The main one is that a subset of the range still has CPU and GPU mappings.
If the backing store for the range is in device memory, a subset of the backing store has references. One option would be to split the range and device memory backing store, but the implementation for this would be quite complicated. Given that partial unmappings are rare and driver-defined range sizes are relatively small, GPU SVM does not support splitting of ranges π
With no support for range splitting, upon partial unmapping of a range, the driver is expected to invalidate and destroy the entire range. If the range has device memory as its backing, the driver is also expected to migrate any remaining pages back to RAM πβ¨
π SEE ALSO
Kernel file ./drivers/gpu/drm/drm_gpusvm.c β and the whole squad is here, no cap:
Overview(9)Locking(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_scan_mm(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)
Thatβs the whole vibe, bestie π This one came from ./drivers/gpu/drm, dated October 2026, and the manual name is Partial Unmapping of Ranges(9) β¨ππ¦
π¦ 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