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 <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31059>
This commit is contained in:
Daniel Stone 2024-09-06 10:13:58 +01:00 committed by Marge Bot
parent 10bc4cc480
commit a78539e704
5 changed files with 8 additions and 6 deletions

View file

@ -333,5 +333,7 @@ if with_tests
),
suite : ['intel'],
protocol : 'gtest',
is_parallel : false,
timeout : 60,
)
endif

View file

@ -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;

View file

@ -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,

View file

@ -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

View file

@ -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;