glthread: determine global locking once every 64 batches to fix get_time perf
authorMarek Olšák <marek.olsak@amd.com>
Sat, 15 Jul 2023 12:22:37 +0000 (08:22 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 17 Jul 2023 13:16:47 +0000 (13:16 +0000)
commit6cda08416b10e43b0a75b4d0a649f8bf29a24a8a
tree7dacbdc6a70a646f670a268316df4dabbc38bc31
parentd4b211bf1b9db21d8bd2d01a3ea4a7c9c4d10caf
glthread: determine global locking once every 64 batches to fix get_time perf

This mitigates a large perf degradation when the clock source is HPET instead of TSC.
Just call get_time less frequently.

Fixes: 3ed141e9 - glthread: add a heuristic to stop locking global mutexes with multiple contexts
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8910

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24168>
src/mesa/main/glthread.c
src/mesa/main/glthread.h