gallium/swr: spin-lock performance improvement
authorTomasz Pyra <tomasz.pyra@intel.com>
Tue, 10 Mar 2020 12:00:03 +0000 (13:00 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 19 Mar 2020 11:11:26 +0000 (11:11 +0000)
commit36ec3cbcf88e9dc4898bbe2319cc4a5a71ba72e1
treec768a91d3a3f15fc4d3931d438dc474b882c3fc0
parentdb5cc6a7ddeddbeb1e360156db520f55a5852b99
gallium/swr: spin-lock performance improvement

Currently, the worker threads are very aggresively
polling for new tasks. If the work is not constantly
fed into the pipeline (which is a case for most of
interactive applications), this creates unnecessary
memory pressure and is using CPU cycles that
could otherwise be used by the applications.
The change implements simple back off mechanism
to help with this problem

Change by Tomasz Pyra (tomasz.pyra@intel.com)

Reviewed-by: Alok Hota <alok.hota@intel.com>
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4226>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4226>
src/gallium/drivers/swr/rasterizer/core/threads.cpp