From: Arunpravin Paneer Selvam <arunpravin.paneerselvam@amd.com>
To: "Christian König" <christian.koenig@amd.com>,
"Peter Zijlstra" <peterz@infradead.org>
Cc: matthew.auld@intel.com, jani.nikula@linux.intel.com,
samuel.pitoiset@gmail.com, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-xe@lists.freedesktop.org, alexander.deucher@amd.com,
stable@vger.kernel.org
Subject: Re: [PATCH v5 1/3] drm/buddy: Optimize free block management with RB tree
Date: Tue, 23 Sep 2025 14:53:07 +0530 [thread overview]
Message-ID: <6ead49fb-9420-4831-a1ab-96594ab399d3@amd.com> (raw)
In-Reply-To: <12f56eda-a6a5-47bf-b89e-0cfa8443a439@amd.com>
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]
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.
>
>
[-- Attachment #2: Type: text/html, Size: 1742 bytes --]
next prev parent reply other threads:[~2025-09-23 9:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 9:56 [PATCH v5 1/3] drm/buddy: Optimize free block management with RB tree Arunpravin Paneer Selvam
2025-09-09 10:20 ` Arunpravin Paneer Selvam
2025-09-09 12:04 ` Christian König
2025-09-09 14:05 ` Peter Zijlstra
2025-09-09 16:25 ` Christian König
2025-09-10 12:37 ` Arunpravin Paneer Selvam
2025-09-10 14:22 ` Christian König
2025-09-23 9:23 ` Arunpravin Paneer Selvam [this message]
2025-09-23 8:54 ` Arunpravin Paneer Selvam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ead49fb-9420-4831-a1ab-96594ab399d3@amd.com \
--to=arunpravin.paneerselvam@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=matthew.auld@intel.com \
--cc=peterz@infradead.org \
--cc=samuel.pitoiset@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox