[Intel-gfx] [PATCH i-g-t] tests/gem_lmem_swapping: add some coverage for big objects

Ramalingam C ramalingam.c at intel.com
Mon Aug 8 01:07:14 UTC 2022


On 2022-08-05 at 14:10:52 +0100, Matthew Auld wrote:
> Everything we are testing here unfortunately fits within one packet (8M)
> which means we have zero coverage when we need to split the copy over
> multiple packets (including the aux CCS state).
> 
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Cc: Ramalingam C <ramalingam.c at intel.com>
> ---
>  tests/i915/gem_lmem_swapping.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/i915/gem_lmem_swapping.c b/tests/i915/gem_lmem_swapping.c
> index 1a4f4ca5..67e95cea 100644
> --- a/tests/i915/gem_lmem_swapping.c
> +++ b/tests/i915/gem_lmem_swapping.c
> @@ -63,6 +63,7 @@ struct params {
>  #define TEST_ENGINES	(1 << 4)
>  #define TEST_MULTI	(1 << 5)
>  #define TEST_CCS	(1 << 6)
> +#define TEST_BIG	(1 << 7)
>  	unsigned int flags;
>  	unsigned int seed;
>  	bool oom_test;
> @@ -477,8 +478,8 @@ static void fill_params(int i915, struct params *params,
>  {
>  	const int swap_mb = /* For lmem, swap is total of smem + swap. */
>  		igt_get_total_ram_mb() + igt_get_total_swap_mb();
> -	const unsigned int size = 1 << 20;
>  	const int max_swap_pct = 75;
> +	unsigned int size;
Since we are extending, could we test for >2G too? Might catch if we ever break the obj size
support for >=2G in kernel. Like using int/uint instead of u64.

May be another test as TEST_HUGE!?

Otherwise looks good to me
Reveiwed-by: Ramalingam C<ramalingam.c at intel.com>

>  	/*
>  	 * In random mode, add 85% hard limit to use system memory.
>  	 * noticed that 88.8% can trigger OOM on some system.
> @@ -487,6 +488,17 @@ static void fill_params(int i915, struct params *params,
>  	int spill_mb;
>  	uint32_t handle;
>  
> +	size = 1 << 20;
> +	if (flags & TEST_BIG) {
> +		/*
> +		 * The kernel only copies in small chunks, so make sure we
> +		 * have some coverage where multiple packets are needed to copy
> +		 * the entire object.
> +		 */
> +		size = 1u << 26; /* 64M */
> +		size += 1u << 16; /* So we also exceed NUM_CCS_BLKS_PER_XFER */
> +	}
> +
>  	if (flags & TEST_RANDOM) {
>  		params->size.min = 4096;
>  		handle = create_bo(i915, &params->size.min, &region->region,
> @@ -733,6 +745,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
>  		unsigned int flags;
>  	} *test, tests[] = {
>  		{ "basic", 0 },
> +		{ "basic-big", TEST_BIG },
>  		{ "random", TEST_RANDOM },
>  		{ "random-engines", TEST_RANDOM | TEST_ENGINES },
>  		{ "heavy-random", TEST_RANDOM | TEST_HEAVY },
> @@ -746,6 +759,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
>  		{ "parallel-random-verify", TEST_PARALLEL | TEST_RANDOM | TEST_VERIFY },
>  		{ "parallel-multi", TEST_PARALLEL | TEST_RANDOM | TEST_VERIFY | TEST_ENGINES | TEST_MULTI },
>  		{ "verify-ccs", TEST_CCS },
> +		{ "verify-ccs-big", TEST_CCS | TEST_BIG },
>  		{ "verify-random-ccs", TEST_CCS | TEST_RANDOM },
>  		{ "heavy-verify-random-ccs", TEST_CCS | TEST_RANDOM | TEST_HEAVY },
>  		{ "heavy-verify-multi-ccs", TEST_CCS | TEST_RANDOM | TEST_HEAVY | TEST_ENGINES | TEST_MULTI },
> -- 
> 2.37.1
> 


More information about the Intel-gfx mailing list