mesa/src
hwandy ffbe6470a2 anv: fix a memory leak in slab allocator.
An example when the memory leak happens: requested_size = 4 and alignment = 65536 in anv_slab_bo_alloc:

The alloc_size = 65536 and requested = 4 in this case.

The group to allocate the entry is the group of size 65536 based on the entry size,
while the group to reclaim the entry is the group of size 4 due to the bo->size is
registered as the requested_size=4 and used in anv_slab_bo_free.

That means, the entry is allocated in group[order of size 65535]->free,
moved from group[order of size 65535]->free to the user, and then moved
to group[order of size 4]->reclaim, so the entries is accumulated in
group[order of size 4]->reclaim and group[order of size 65535] keeps
allocating new entries and leading to OOM.

The solution is to use `bo->actual_size` to get the group in pb_slab_bo_free using the allocation size.

Fixes: dabb012423 ("anv: Implement anv_slab_bo and enable memory pool")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14396
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: hwandy <hwandy@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38989>
2025-12-18 18:25:54 +00:00
..
amd ac/descriptors: account for num_storage_samples for gfx10 2025-12-18 10:45:49 +00:00
android_stub android_stub: fix missing prototypes issues 2025-12-02 20:03:02 +00:00
asahi nir: Drop the mode argument of nir_lower_vars_to_scratch(). 2025-12-17 19:50:28 +00:00
broadcom broadcom/ci: set testgroup size for asan 2025-12-18 16:42:30 +00:00
c11 c11/threads: fix build on c23 2025-11-10 07:01:50 +10:00
compiler nir: Introduce nir_lower_vars_to_scratch_global(). 2025-12-17 19:50:28 +00:00
drm-shim drm-shim: handle DRM_CAP_ADDFB2_MODIFIERS 2025-11-24 12:34:08 +00:00
egl egl/x11: Fix memory leak when querying translated coord. 2025-12-11 14:58:59 +00:00
etnaviv Uprev Piglit to 2842979ebe03b99c33c3e49af5960c69be6c6d46 2025-12-12 21:45:24 +00:00
freedreno ir3/bisect: fix off-by-one issues while bisecting 2025-12-18 04:43:16 +00:00
gallium hud: add new 'dev' pseudo-graph 2025-12-18 10:45:49 +00:00
gbm mesa: replace most occurrences of getenv() with os_get_option() 2025-11-06 04:36:13 +00:00
getopt
gfxstream meson: Remove VK_ICD_FILENAMES totally from source tree. 2025-12-10 14:46:11 +00:00
glx driconf: add a way to override GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 2025-12-17 23:35:24 +00:00
gtest
imagination nir: Drop the mode argument of nir_lower_vars_to_scratch(). 2025-12-17 19:50:28 +00:00
imgui imgui: Silence build warnings for imgui 2025-09-16 06:16:19 +00:00
intel anv: fix a memory leak in slab allocator. 2025-12-18 18:25:54 +00:00
kosmickrisp nir: Drop the mode argument of nir_lower_vars_to_scratch(). 2025-12-17 19:50:28 +00:00
loader loader: Wrap nouveau_zink_predicate with HAVE_LIBDRM 2025-11-20 18:39:19 +00:00
mesa mesa: consider Attrib.MinLayer in do_blit_framebuffer 2025-12-18 10:45:49 +00:00
microsoft treewide: use BITSET_*_COUNT 2025-12-16 17:42:10 +00:00
nouveau nvk: Disable compression for image import/export 2025-12-18 12:13:05 -05:00
panfrost panvk: Fix set_compute_sysval() 2025-12-18 08:14:14 +01:00
poly nir: remove nir_io_add_const_offset_to_base 2025-11-29 00:16:38 +00:00
tool pps/meson: minor refactor for pps_deps 2025-11-08 18:39:00 -08:00
util util/driconf: add workaround for Interstellar Rift 2025-12-17 23:35:25 +00:00
virtio treewide: Use wsi_common_is_swapchain_image() helper 2025-12-11 20:20:39 +00:00
vulkan vulkan: update ALLOWED_ANDROID_VERSION for api level 36 2025-12-17 19:22:47 +00:00
x11 treewide: strip unneeded inc_gallium inc_gallium_aux 2025-11-13 22:01:43 +00:00
.clang-format util: Add sparse bitset data structure 2025-11-06 21:34:33 +00:00
meson.build kk: Add KosmicKrisp 2025-10-20 17:46:38 +00:00