[igt-dev] [PATCH i-g-t] i915/gem_ppgtt: Convert stress test to run for a fixed duration

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Fri Jan 11 13:40:36 UTC 2019


On 08/01/2019 14:50, Chris Wilson wrote:
> Currently blt-vs-render runs for a fixed loop count, and exceeds 360s
> on a slow Skylake-y. It really doesn't tell us anything useful about low
> likelihood events after the first few seconds it takes to fill memory,
> so limit it to 30s (and hope that repeated runs in CI is enough to
> exercise the even rarer corner cases).
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108039
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>   tests/i915/gem_ppgtt.c | 55 ++++++++++++++++++++++++++++++------------
>   1 file changed, 39 insertions(+), 16 deletions(-)
> 
> diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
> index c2e4ca679..11ca31e74 100644
> --- a/tests/i915/gem_ppgtt.c
> +++ b/tests/i915/gem_ppgtt.c
> @@ -85,7 +85,9 @@ static void scratch_buf_fini(struct igt_buf *buf)
>   	memset(buf, 0, sizeof(*buf));
>   }
>   
> -static void fork_rcs_copy(int target, drm_intel_bo **dst, int count, unsigned flags)
> +static void fork_rcs_copy(int timeout, uint32_t final,
> +			  drm_intel_bo **dst, int count,
> +			  unsigned flags)
>   #define CREATE_CONTEXT 0x1
>   {
>   	igt_render_copyfunc_t render_copy;
> @@ -117,6 +119,8 @@ static void fork_rcs_copy(int target, drm_intel_bo **dst, int count, unsigned fl
>   	igt_fork(child, count) {
>   		struct intel_batchbuffer *batch;
>   		struct igt_buf buf = {};
> +		struct igt_buf src;
> +		unsigned long i;
>   
>   		batch = intel_batchbuffer_alloc(dst[child]->bufmgr,
>   						devid);
> @@ -135,23 +139,29 @@ static void fork_rcs_copy(int target, drm_intel_bo **dst, int count, unsigned fl
>   		buf.size = SIZE;
>   		buf.bpp = 32;
>   
> -		for (int i = 0; i <= target; i++) {
> -			struct igt_buf src;
> -
> +		i = 0;
> +		igt_until_timeout(timeout) {
>   			scratch_buf_init(&src, dst[child]->bufmgr,
> -					 i | child << 16);
> -
> +					 i++ | child << 16);
>   			render_copy(batch, NULL,
>   				    &src, 0, 0,
>   				    WIDTH, HEIGHT,
>   				    &buf, 0, 0);
> -
>   			scratch_buf_fini(&src);
>   		}
> +
> +		scratch_buf_init(&src, dst[child]->bufmgr,
> +				 final | child << 16);
> +		render_copy(batch, NULL,
> +			    &src, 0, 0,
> +			    WIDTH, HEIGHT,
> +			    &buf, 0, 0);
> +		scratch_buf_fini(&src);
>   	}
>   }
>   
> -static void fork_bcs_copy(int target, drm_intel_bo **dst, int count)
> +static void fork_bcs_copy(int timeout, uint32_t final,
> +			  drm_intel_bo **dst, int count)
>   {
>   	int devid;
>   
> @@ -169,18 +179,20 @@ static void fork_bcs_copy(int target, drm_intel_bo **dst, int count)
>   
>   	igt_fork(child, count) {
>   		struct intel_batchbuffer *batch;
> +		drm_intel_bo *src[2];
> +		unsigned long i;
> +
>   
>   		batch = intel_batchbuffer_alloc(dst[child]->bufmgr,
>   						devid);
>   		igt_assert(batch);
>   
> -		for (int i = 0; i <= target; i++) {
> -			drm_intel_bo *src[2];
> -
> +		i = 0;
> +		igt_until_timeout(timeout) {
>   			src[0] = create_bo(dst[child]->bufmgr,
>   					   ~0);
>   			src[1] = create_bo(dst[child]->bufmgr,
> -					   i | child << 16);
> +					   i++ | child << 16);
>   
>   			intel_copy_bo(batch, src[0], src[1], SIZE);
>   			intel_copy_bo(batch, dst[child], src[0], SIZE);
> @@ -188,6 +200,17 @@ static void fork_bcs_copy(int target, drm_intel_bo **dst, int count)
>   			drm_intel_bo_unreference(src[1]);
>   			drm_intel_bo_unreference(src[0]);
>   		}
> +
> +		src[0] = create_bo(dst[child]->bufmgr,
> +				   ~0);
> +		src[1] = create_bo(dst[child]->bufmgr,
> +				   final | child << 16);
> +
> +		intel_copy_bo(batch, src[0], src[1], SIZE);
> +		intel_copy_bo(batch, dst[child], src[0], SIZE);
> +
> +		drm_intel_bo_unreference(src[1]);
> +		drm_intel_bo_unreference(src[0]);
>   	}
>   }
>   
> @@ -314,8 +337,8 @@ int main(int argc, char **argv)
>   	igt_subtest("blt-vs-render-ctx0") {
>   		drm_intel_bo *bcs[1], *rcs[N_CHILD];
>   
> -		fork_bcs_copy(0x4000, bcs, 1);
> -		fork_rcs_copy(0x8000 / N_CHILD, rcs, N_CHILD, 0);
> +		fork_bcs_copy(30, 0x4000, bcs, 1);
> +		fork_rcs_copy(30, 0x8000 / N_CHILD, rcs, N_CHILD, 0);
>   
>   		igt_waitchildren();
>   
> @@ -326,8 +349,8 @@ int main(int argc, char **argv)
>   	igt_subtest("blt-vs-render-ctxN") {
>   		drm_intel_bo *bcs[1], *rcs[N_CHILD];
>   
> -		fork_rcs_copy(0x8000 / N_CHILD, rcs, N_CHILD, CREATE_CONTEXT);
> -		fork_bcs_copy(0x4000, bcs, 1);
> +		fork_rcs_copy(30, 0x8000 / N_CHILD, rcs, N_CHILD, CREATE_CONTEXT);
> +		fork_bcs_copy(30, 0x4000, bcs, 1);
>   
>   		igt_waitchildren();
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the igt-dev mailing list