summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_pipe.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-05-27 12:13:34 +0200
committerMarek Olšák <[email protected]>2017-06-07 18:43:42 +0200
commit6f2947fa79f9480934b17cc913a8bcdfbe9ffe45 (patch)
tree40d56df94c73bd0abb6d7bcd8e52ee08175e8270 /src/gallium/drivers/radeonsi/si_pipe.c
parent38bd468a78b149c2cb1d105715231e7241d1dc5c (diff)
radeonsi: decrease the number of compiler threads to num CPUs - 1
Reserve one core for other things (like draw calls). Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index bbb5ea660d6..0c2f6b37dba 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -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",