drm_mm_for_each_node_safe(9)
β¨ drm_mm_for_each_node_safe β¨
okay bestie, so this is a page from the Kernel API Manual (yes, the kernel has its own manual, she's iconic) and it's all about drm_mm_for_each_node_safe β the iterator that walks over all allocated nodes π
πΈ NAME πΈ
drm_mm_for_each_node_safe β an iterator to walk over all allocated nodes π¦
π SYNOPSIS π
drm_mm_for_each_node_safe (entry , next , mm );
π ARGUMENTS π
entryβ astruct drm_mm_nodethat gets assigned to on every iteration step. this is literally your main character, the node you're looking at rn πnextβ astruct drm_mm_nodewhere the next step gets stored. it's holding the next look for you, no cap π«Άmmβ thedrm_mmallocator you're walking through. the whole vibe check happens in here β¨
π₯ DESCRIPTION π₯
so the way that this works: this iterator walks over all the nodes in the range allocator. that's it, that's the function π
it's implemented with list_for_each_safe, which means it is safe against removal of elements β so you can delete stuff mid-walk and it won't fall apart on you. slay. π
ngl, that "safe" in the name is doing real work here β that's the whole reason next exists as its own argument. π§
π SEE ALSO π
Kernel file ./include/drm/drm_mm.h, plus the whole friend group:
enum drm_mm_insert_mode(9)struct drm_mm_node(9)struct drm_mm(9)struct drm_mm_scan(9)drm_mm_node_allocated(9)drm_mm_initialized(9)drm_mm_hole_follows(9)drm_mm_hole_node_start(9)drm_mm_hole_node_end(9)drm_mm_nodes(9)drm_mm_for_each_node(9)drm_mm_for_each_hole(9)drm_mm_insert_node_generic(9)drm_mm_insert_node(9)drm_mm_clean(9)drm_mm_for_each_node_in_range(9)drm_mm_scan_init(9)
β ok that's the page!! this one shipped from ./include/drm in October 2026 β so go forth and iterate safely, bestie, you've got this πππ¦
π¦ 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