radeonsi: decrease the number of compiler threads to num CPUs - 1
authorMarek Olšák <marek.olsak@amd.com>
Sat, 27 May 2017 10:13:34 +0000 (12:13 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jun 2017 16:43:42 +0000 (18:43 +0200)
Reserve one core for other things (like draw calls).

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c

index bbb5ea6..0c2f6b3 100644 (file)
@@ -882,8 +882,11 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
                return NULL;
        }
 
-       /* Only enable as many threads as we have target machines and CPUs. */
+       /* Only enable as many threads as we have target machines, but at most
+        * the number of CPUs - 1 if there is more than one.
+        */
        num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
+       num_cpus = MAX2(1, num_cpus - 1);
        num_compiler_threads = MIN2(num_cpus, ARRAY_SIZE(sscreen->tm));
 
        if (!util_queue_init(&sscreen->shader_compiler_queue, "si_shader",