mesa/src
Pierre-Eric Pelloux-Prayer 0fd152dab3 disk_cache: use UTIL_QUEUE_INIT_SCALE_THREADS
Instead of spawning 4 threads when the cache is created,
spawn 1 and let u_queue grow the number of threads if
needed.

I wrote this patch because when running piglit's quick_shader
profile I had lots of samples in disk cache threads - mostly
in native_queued_spin_lock_slowpath kernel function.

Since these tests shouldn't really stress the cache, I assumed
it was caused only by thread creations.

After writing the patch and redoing the measurement, I got an
improvement but I still more hits in the same function for
shader_runner:$disk0 thread so something was wrong.

After digging more, I found out that my shader cache index was
corrupted: the on-disk size was 29MB but the index reported it
was way more than 1GB. So each disk cache thread was spending
a lot of time trying to evict files. Given that my cache had
a really low count of files, the LRU method based on randomly
generating subfolder names failed, so evicting was very slow.

Now that my cache index is fixed, the disk cache threads are
mostly idle but I still think it makes sense to grow the
number of threads instead of spawning 4 at the program start.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11296>
2021-06-17 09:11:59 +02:00
..
amd radv: fix build errors after commit 8b7ff784 2021-06-16 19:55:48 +00:00
android_stub egl/android: refactor to use the legit vndk/window.h header 2021-06-09 21:07:54 +00:00
asahi nir, nir/algebraic: add byte/word insertion instructions 2021-06-08 08:57:42 +00:00
broadcom v3dv: remove sRGB blending workaround 2021-06-16 11:05:03 +00:00
compiler compiler/glsl: Use mutex lock while freeing up mem_ctx 2021-06-16 23:14:23 +00:00
drm-shim
egl egl/android: add aosp_nougat system/window.h back for back compat 2021-06-11 02:33:57 +00:00
etnaviv
freedreno ir3/ra: Fix array parallelcopy confusion 2021-06-16 22:45:13 +00:00
gallium radeonsi: delay sample_pos_buffer creation until first use 2021-06-17 09:10:29 +02:00
gbm gbm: list to stderr all the missing extension 2021-05-24 16:17:47 +00:00
getopt
glx glx: create DRI screen for display GPU incase of prime 2021-06-03 09:12:32 +00:00
gtest
hgl
imgui
intel anv: Fix dynamic primitive topology for tess on Gfx7.x too 2021-06-17 02:00:32 +00:00
loader crocus: initial gallium driver for Intel gfx 4-7 2021-06-14 06:34:05 +10:00
mapi glthread: change when glFlush flushes asynchronously 2021-06-17 02:24:22 +00:00
mesa vbo: delay vbo_exec_vtx_map call 2021-06-17 09:10:29 +02:00
microsoft nir: Move workgroup_size and workgroup_variable_size into common shader_info 2021-06-08 09:23:55 -07:00
nouveau
panfrost pan/bi: Fuse abs into FCMP/FMIN/FMAX.v2f16 2021-06-15 20:27:22 +00:00
tool
util disk_cache: use UTIL_QUEUE_INIT_SCALE_THREADS 2021-06-17 09:11:59 +02:00
virtio venus: remove workarounds for multi-planar format interop 2021-06-16 20:31:32 +00:00
vulkan zink: Fix win32 build 2021-06-14 19:48:36 +00:00
meson.build