From 22ed6c35823c5038ca70f66297b75e22be375aaf Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 13 Oct 2025 22:11:25 -0700 Subject: [PATCH] panvk: improve big_bo_pool bo utilization Better not cap at slab_size, otherwise the bo cache is purely wasting memory as it could only be used for up to slab_size upon re-use. This change unlocks the pool alloc limit to the actual bo size. Dropped the redundant pair of parentheses to stay in one line. Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/vulkan/panvk_mempool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/panvk_mempool.c b/src/panfrost/vulkan/panvk_mempool.c index 2d2a3bbf27b..db9f020d72f 100644 --- a/src/panfrost/vulkan/panvk_mempool.c +++ b/src/panfrost/vulkan/panvk_mempool.c @@ -149,7 +149,7 @@ panvk_pool_alloc_mem(struct panvk_pool *pool, struct panvk_pool_alloc_info info) unsigned offset = ALIGN_POT(pool->transient_offset, info.alignment); /* If we don't fit, allocate a new backing */ - if (unlikely(bo == NULL || (offset + info.size) > pool->base.slab_size)) { + if (unlikely(bo == NULL || offset + info.size > pan_kmod_bo_size(bo->bo))) { bo = panvk_pool_alloc_backing(pool, info.size); offset = 0; }