mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: Compute reasonable max order for allocator
Compute a reasonable maximum order for buddy allocators that are created with a max_order of 0. Previously the max_order was just left as 0. Change-Id: I5c2f878fcd390610a4c02ac65189138ec7db30c8 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1169763 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
Terje Bergstrom
parent
2c04ddcdf6
commit
df1ff34809
@@ -90,6 +90,11 @@ static void balloc_compute_max_order(struct gk20a_allocator *a)
|
||||
{
|
||||
u64 true_max_order = ilog2(a->blks);
|
||||
|
||||
if (a->max_order == 0) {
|
||||
a->max_order = true_max_order;
|
||||
return;
|
||||
}
|
||||
|
||||
if (a->max_order > true_max_order)
|
||||
a->max_order = true_max_order;
|
||||
if (a->max_order > GPU_BALLOC_MAX_ORDER)
|
||||
|
||||
Reference in New Issue
Block a user