drm_gem_for_...puvm_bo_safe(9)
π drm_gem_for_each_gpuvm_bo_safe(9) β the kernel API manual, bestie edition π
okay so first things first: this is a page from the Kernel API Manual, and the function we're obsessing over today is drm_gem_for_each_gpuvm_bo_safe. Yes, the title up top is literally drm_gem_for_...puvm_bo_safe(9) because kernel manpage headers love to abbreviate, but we know her full name now. π
β¨ NAME β¨
drm_gem_for_each_gpuvm_bo_safe β an iterator that safely walks over a list of &drm_gpuvm_bo. No cap, "safe" is the whole personality here. π¦
πΈ SYNOPSIS πΈ
drm_gem_for_each_gpuvm_bo_safe (entry__ , next__ , obj__ );
Three args, all vibing in a row. Let's meet them π
π ARGUMENTS π
entry__β thedrm_gpuvm_bostructure you assign to on every single iteration step. She's the main character of each loop pass. πnext__β stores the nextdrm_gpuvm_boso you've always got the next step queued up. Girl is literally holding your place in line. πobj__β thedrm_gem_objectthat thedrm_gpuvm_bos you're walking are associated with. It's giving "these are my friends, actually." π«Ά
π DESCRIPTION π
So here's the tea: this iterator walks over all the drm_gpuvm_bo structures associated with the drm_gem_object. All of them. Every last one. π₯
And the way it does that? It's implemented with list_for_each_entry_safe β which, yeah, is why she's got "safe" right there in the name. That means it is safe against removal of elements. So go ahead and unlink stuff mid-walk, she's not gonna melt down over it. ππ
fr fr though, "safe" here means safe against removal β that's the specific promise. Don't go reading extra superpowers into it. β¨
π SEE ALSO π
Kernel file ./include/drm/drm_gem.h, plus the whole friend group:
enum drm_gem_object_status(9)struct drm_gem_object_funcs(9)struct drm_gem_lru(9)struct drm_gem_object(9)DRM_GEM_FOPS(9)DEFINE_DRM_GEM_FOPS(9)drm_gem_get_huge_mnt(9)drm_gem_object_get(9)drm_gem_object_put(9)drm_gem_object_is_shared_for_memory_stats(9)drm_gem_is_imported(9)drm_gem_gpuva_init(9)drm_gem_for_each_gpuvm_bo(9)
and that's the page, bestie π§π she lives in ./include/drm, the source/version stamp on this one is October 2026, and the footer still reads drm_gem_for_...puvm_bo_safe(9) because the header never lets go of her β¨ iconic β¨ abbreviated name. slay, go read the header file, periodt. πβ
π¦ 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