mesa/src/intel
Chad Versace a5f9e59ce3 anv: Use vma_heap for descriptor pool host allocation
Pre-patch, anv_descriptor_pool used a free list for host allocations
that never merged adjacent free blocks.  If the pool only allocated
fixed-sized blocks, then this would not be a problem. But the pool
allocations are variable-sized, and this caused over half of the pool's
memory to be consumed by unusable free blocks in some workloads, causing
unnecessary memory footprint.

Replacing the free list with util_vma_heap, which does merge adjacent
free blocks, fixes the memory explosion in the target workload.

Disdavantges of util_vma_heap compared to the free list:
  - The heap calls malloc() when a new hole is created.
  - The heap calls free() when a hole disappears or is merged with an
    adjacent hole.
  - The Vulkan spec expects descriptor set creation/destruction to be
    thread-local lockless in the common case. For workloads that
    create/destroy with high frequency, malloc/free may cause overhead.
    Profiling is needed.

Tested with a ChromeOS internal TensorFlow benchmark, provided by
package 'tensorflow', running with its OpenCL backend on clvk.

  cmdline: benchmark_model --graph=mn2.tflite --use_gpu=true --min_secs=60
  gpu: adl
  memory footprint from start of benchmark:
    before: init=132.691MB max=227.684MB
    after:  init=134.988MB max=134.988MB

Reported-by: Romaric Jodin <rjodin@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20289>
2022-12-16 07:18:38 +00:00
..
blorp intel/common/intel_genX_state.h: Add intel_set_ps_dispatch_state() 2022-12-15 00:54:59 -08:00
ci ci: Add intel kbl xfail to flake 2022-11-30 17:24:03 +00:00
common intel/aux_map: Ignore format bits when using tile-4 2022-12-15 11:43:00 -08:00
compiler intel/common/intel_genX_state.h: Add intel_set_ps_dispatch_state() 2022-12-15 00:54:59 -08:00
dev intel/dev: Enable AUX map on MTL 2022-12-15 11:43:00 -08:00
ds intel/ds: trace a couple of more pipe control flags 2022-12-13 19:22:02 +00:00
genxml intel: Hook up RENDER_SURFACE_STATE::DecompressInL3 2022-12-14 03:05:24 +00:00
isl intel/isl: Disable CCS on MTL until B0 (Wa_14017353530) 2022-12-15 11:43:00 -08:00
nullhw-layer utils: Merge util/debug.* into util/u_debug.* and remove util/debug.* 2022-11-02 07:25:39 +00:00
perf intel: add MTL performance metrics 2022-12-09 09:13:02 +00:00
tools intel: Add SUPPORT_INTEL_INTEGRATED_GPUS build argument 2022-11-23 16:57:23 +00:00
vulkan anv: Use vma_heap for descriptor pool host allocation 2022-12-16 07:18:38 +00:00
vulkan_hasvk intel/common/intel_genX_state.h: Add intel_set_ps_dispatch_state() 2022-12-15 00:54:59 -08:00
meson.build intel: Disable SSE2 instruction set if building for non x86 architectures 2022-11-23 16:57:23 +00:00