drm_mm_scan_remove_block(9)
π drm_mm_scan_remove_block(9) β a Kernel API Manual moment
okay bestie, welcome to the Kernel API Manual page for drm_mm_scan_remove_block and honestly? she's a lil diva with rules. let's get into it β¨
πΈ NAME πΈ
drm_mm_scan_remove_block β remove a node from the scan list π
π¦ SYNOPSIS π¦
bool drm_mm_scan_remove_block (struct drm_mm_scan *scan , struct
drm_mm_node *node );
yes she returns a bool, yes she takes two structs, no we are not scared π
β¨ ARGUMENTS β¨
scanβ the activedrm_mmscanner, aka the main character doing the scanning πnodeβ thedrm_mm_nodeyou're removing, bye babe π«Ά
π₯ DESCRIPTION π₯
okay so this is the part where you HAVE to listen, fr fr. Nodes must be removed in exactly the reverse order from the scan list as they have been added β like, for example, using list_add as they're added and then list_for_each over that eviction list to remove them. If you don't do it in that reverse order? the internal state of the memory manager will be corrupted. not cute at all, no cap π so please respect the stack energy, it's giving LIFO and that is the vibe.
when the scan list is empty, the selected memory nodes can be freed π and here's the slay: an immediately following drm_mm_insert_node_in_range_generic, or one of the simpler versions of that function with !DRM_MM_SEARCH_BEST, will then return the just freed block β because it's sitting right at the top of the free_stack list. iconic behavior honestly π
β οΈ reminder: reverse order only. corrupting the memory manager's internal state is not a personality trait, bestie π
β RETURN β
True if this block should be evicted, false otherwise. and when no hole has been found? it will always return false. no hole, no eviction, no drama π
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_mm.cOverview(9) DECLARE_NEXT_HOLE_ADDR(9)drm_mm_reserve_node(9)drm_mm_insert_node_in_range(9)drm_mm_remove_node(9)- lru scan roster(9)
drm_mm_scan_init_with_range(9)drm_mm_scan_add_block(9)drm_mm_scan_color_evict(9)drm_mm_init(9)drm_mm_takedown(9)drm_mm_print(9)
go read them all, iykyk π
and that's the whole page, bestie π§ from ./drivers/gpu/drm, dated October 2026 β drm_mm_scan_remove_block(9), signing off π
β¨
π¦ 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