Hi Christian,

On 9/10/2025 7:52 PM, Christian König wrote:
In drm_buddy_fini(), force_merge() is called to ensure all blocks are merged 
before tearing down the allocator. This guarantees that all
mm->roots are freed and not held by the driver at shutdown. If any blocks 
remain allocated, drm_buddy_fini() will issue a warning.

In drm_buddy_reset_clear(), which is invoked at device suspend/resume, it is an 
ideal place to call force_merge(). This ensures that all
possible blocks are merged before resetting the clear state, thereby reducing 
fragmentation and improving allocation efficiency after resume.
That's where rbtree_postorder_for_each_entry_safe() should be used.
Sure, I have replaced with the existing rbtree_postorder_for_each_entry_safe() macro in places where the traversal order is not important such as debug print
and reset clear functions.

Thanks,
Arun.


Reply via email to