[Intel-gfx] [PATCH i-g-t] tests/gem_render_linear_blits: Increase min swap required

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 29 01:53:36 PDT 2015


On Wed, Jul 29, 2015 at 09:30:21AM +0100, Derek Morton wrote:
> The swap-thrash subtest had a requirement that swap memory be
> present but no minimum amount was specified. The subtest allowed
> for half the total swap memory for overhead. Some android systems
> have a only a small amount of swap space and half this was not
> enough resulting in OOM errors. It was not possible to determine
> the exact amount of memory the test would require in all
> configurations to guarentee swap memory would be used but not
> trigger an OOM error.
> As a minimum reccomended swap partition on Linux is 256Mb the
> subtest was updated to require this.
> 
> Also fixed a couple of small memory leaks.
> 
> Signed-off-by: Derek Morton <derek.j.morton at intel.com>
> ---
>  tests/gem_render_linear_blits.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
> index f83c6d4..5dd210d 100644
> --- a/tests/gem_render_linear_blits.c
> +++ b/tests/gem_render_linear_blits.c
> @@ -184,6 +184,9 @@ static void run_test (int fd, int count)
>  	}
>  	intel_batchbuffer_free(batch);
>  	drm_intel_bufmgr_destroy(bufmgr);
> +
> +	free(bo);
> +	free(start_val);
>  }
>  
>  igt_main
> @@ -210,7 +213,12 @@ igt_main
>  
>  	igt_subtest("swap-thrash") {
>  		uint64_t swap_mb = intel_get_total_swap_mb();
> -		igt_require(swap_mb > 0);
> +		/* The calculation of count allows 1/2 the swap memory as
> +		   overhead. However on Android systems with a very small swap
> +		   partition this is not enough resulting in OOM errors.
> +		   As 256Mb is a minimum recomended size for a swap partition
> +		   on Linux, skip the subtest if less than this. */
> +		igt_require(swap_mb > 255);
>  		count = ((intel_get_avail_ram_mb() + (swap_mb / 2)) * 1024*1024) / SIZE;
>  		intel_require_memory(count, SIZE, CHECK_RAM | CHECK_SWAP);

Surely fixing intel_require_memory(CHECK_SWAP) (adding the slop of
256MiB swap or somesuch) would be better?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list