diff options
author | Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com> | 2023-09-09 09:09:00 -0700 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2023-09-11 20:18:00 +0200 |
commit | 0a1844bf0b532d84324453374ad6845f64066c28 (patch) | |
tree | de60b3dac8a0c7e7450c20439231aa7de0555985 /drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | |
parent | 6ae9f693ed4ff54f4bb0bd41e20da10733c49c0c (diff) | |
download | linux-0a1844bf0b532d84324453374ad6845f64066c28.tar.gz linux-0a1844bf0b532d84324453374ad6845f64066c28.tar.bz2 linux-0a1844bf0b532d84324453374ad6845f64066c28.zip |
drm/buddy: Improve contiguous memory allocation
Problem statement: The current method roundup_power_of_two()
to allocate contiguous address triggers -ENOSPC in some cases
even though we have enough free spaces and so to help with
that we introduce a try harder mechanism.
In case of -ENOSPC, the new try harder mechanism rounddown the
original size to power of 2 and iterating over the round down
sized freelist blocks to allocate the required size traversing
RHS and LHS.
As part of the above new method implementation we moved
contiguous/alignment size computation part and trim function
to the drm buddy file.
v2: Modify the alloc_range() function to return total allocated size
on -ENOSPC err and traverse RHS/LHS to allocate the required
size (Matthew).
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230909160902.15644-1-Arunpravin.PaneerSelvam@amd.com
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c')
0 files changed, 0 insertions, 0 deletions