Commit graph

2 commits

Author SHA1 Message Date
Marek Olšák
787ddadf73 util: add mesa_pin_threads environment variable that sets a static affinity mask
This is required for deterministic benchmark results.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27247>
2024-01-29 19:40:46 +00:00
Marek Olšák
d230434ae3 mesa,gallium: move the thread scheduler to src/util
The only change in behavior is that setting the affinity mask is skipped
when it has no effect, which happens when the app thread hasn't been moved
under a different L3 cache by the kernel (the sched_state variable tracks
that). This improves performance because setting the affinity mask incurs
measurable CPU overhead even if it has no effect.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27247>
2024-01-29 19:40:46 +00:00