From a78539e7043a1bbca3a04127d5c60b68bb985c8b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 6 Sep 2024 10:13:58 +0100 Subject: [PATCH] intel/tests: Reduce load from anv_tests anv_tests tries to create a large number of threads, all of which wait to be able to execute simultaneously, then launch a reasonable-size workload. Under load, cloning each of the 16 threads takes 15ms serially, for a delay of 240ms before the tests start running; running the test 64 times gives us 15.36s for a single testcase in isolation, assuming that the bits which aren't forking are free. To give it the best shot at completing in time, mark it as a non-parallelisable test (since Meson will also try to parallelise it out), and also halve the number of runs it attempts. And then give it a longer timeout so it doesn't fail even in extremis. Signed-off-by: Daniel Stone Part-of: --- src/intel/vulkan/meson.build | 2 ++ src/intel/vulkan/tests/block_pool_no_free.c | 4 ++-- src/intel/vulkan/tests/state_pool.c | 2 +- src/intel/vulkan/tests/state_pool_max_size.c | 2 +- src/intel/vulkan/tests/state_pool_no_free.c | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build index 8e8c8fba700..0f40bcb1091 100644 --- a/src/intel/vulkan/meson.build +++ b/src/intel/vulkan/meson.build @@ -333,5 +333,7 @@ if with_tests ), suite : ['intel'], protocol : 'gtest', + is_parallel : false, + timeout : 60, ) endif diff --git a/src/intel/vulkan/tests/block_pool_no_free.c b/src/intel/vulkan/tests/block_pool_no_free.c index 7c9c8951361..b0afc44e703 100644 --- a/src/intel/vulkan/tests/block_pool_no_free.c +++ b/src/intel/vulkan/tests/block_pool_no_free.c @@ -26,9 +26,9 @@ #include "anv_private.h" #include "test_common.h" -#define NUM_THREADS 16 +#define NUM_THREADS 8 #define BLOCKS_PER_THREAD 1024 -#define NUM_RUNS 64 +#define NUM_RUNS 32 static struct job { pthread_t thread; diff --git a/src/intel/vulkan/tests/state_pool.c b/src/intel/vulkan/tests/state_pool.c index 20eb2a34750..0b46e6d126b 100644 --- a/src/intel/vulkan/tests/state_pool.c +++ b/src/intel/vulkan/tests/state_pool.c @@ -45,7 +45,7 @@ void state_pool_test(void) pthread_mutex_init(&device.mutex, NULL); anv_bo_cache_init(&device.bo_cache, &device); - const unsigned num_runs = 64; + const unsigned num_runs = 32; const uint32_t _1Gb = 1024 * 1024 * 1024; for (unsigned i = 0; i < num_runs; i++) { anv_state_pool_init(&state_pool, &device, diff --git a/src/intel/vulkan/tests/state_pool_max_size.c b/src/intel/vulkan/tests/state_pool_max_size.c index 4b7cb962b4e..2793da272e1 100644 --- a/src/intel/vulkan/tests/state_pool_max_size.c +++ b/src/intel/vulkan/tests/state_pool_max_size.c @@ -26,7 +26,7 @@ #include "anv_private.h" #include "test_common.h" -#define NUM_THREADS 16 +#define NUM_THREADS 8 #define STATES_PER_THREAD 1024 #define NUM_RUNS 1 diff --git a/src/intel/vulkan/tests/state_pool_no_free.c b/src/intel/vulkan/tests/state_pool_no_free.c index 07df9b1847c..4b5e1115611 100644 --- a/src/intel/vulkan/tests/state_pool_no_free.c +++ b/src/intel/vulkan/tests/state_pool_no_free.c @@ -26,9 +26,9 @@ #include "anv_private.h" #include "test_common.h" -#define NUM_THREADS 16 +#define NUM_THREADS 8 #define STATES_PER_THREAD 1024 -#define NUM_RUNS 64 +#define NUM_RUNS 32 static struct job { pthread_t thread;