freedreno/ir3: Reduce compiler thread pool size
authorRob Clark <robdclark@chromium.org>
Mon, 31 Oct 2022 14:59:32 +0000 (07:59 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 8 Nov 2022 23:36:51 +0000 (23:36 +0000)
With the current scheme, looking at game startup which should be the
worst case (most heavily loaded) time for the compiler threads, and they
seem to be ~10% busy.  Furthermore we typically have a mix of "big" and
"LITTLE" cores.. with about half being "big".  So sizing the thread pool
to the half the # of CPU cores seems reasonable.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19387>

src/gallium/drivers/freedreno/ir3/ir3_gallium.c

index f2a574a..7b406ac 100644 (file)
@@ -556,7 +556,7 @@ ir3_screen_init(struct pipe_screen *pscreen)
     * big cores.  OTOH if they are sitting idle, maybe it is useful to
     * use them?
     */
-   unsigned num_threads = sysconf(_SC_NPROCESSORS_ONLN) - 1;
+   unsigned num_threads = sysconf(_SC_NPROCESSORS_ONLN) / 2;
 
    /* Create at least one thread - even on single core CPU systems. */
    num_threads = MAX2(1, num_threads);