Re: [PATCH v1 1/2] tests/intel/xe_exec_system_allocator: fix prefetch-change-attr flow

Kamil Konieczny <[email protected]>
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
Hi nishit.sharma,
On 2026-08-19 at 14:53:00 +0000, [email protected] wrote:
> From: Nishit Sharma <[email protected]>
> 
> These changes fixes the prefetch-change-attr test flow so the intended
> prefetch and atomic-attribute transition execute in the correct path.

You should also write about memory leak fixed. Now it looks like
another candidate for a split but as they are located near each other,
let this be in one patch.

> 
> Signed-off-by: Nishit Sharma <[email protected]>

LGTM
Reviewed-by: Kamil Konieczny <[email protected]>

Regards,
Kamil

> ---
>  tests/intel/xe_exec_system_allocator.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/intel/xe_exec_system_allocator.c b/tests/intel/xe_exec_system_allocator.c
> index 6ca53aa5f..476470be7 100644
> --- a/tests/intel/xe_exec_system_allocator.c
> +++ b/tests/intel/xe_exec_system_allocator.c
> @@ -1395,6 +1395,9 @@ madvise_prefetch_op(int fd, uint32_t vm, uint64_t addr, size_t bo_size,
>  
>  		xe_vm_madvise_migrate_pages(fd, vm, to_user_pointer(data), bo_size / 2);
>  
> +		/* free 1st allocation in mem_attrs */
> +		free(mem_attrs);
> +
>  		mem_attrs = xe_vm_get_mem_attr_values_in_range(fd, vm, addr, bo_size, &num_ranges);
>  		if (!mem_attrs) {
>  			igt_info("Failed to get memory attributes\n");
> @@ -1426,13 +1429,14 @@ madvise_prefetch_op(int fd, uint32_t vm, uint64_t addr, size_t bo_size,
>  		if (!mem_attrs) {
>  			igt_info("Failed to get memory attributes\n");
>  			return;
> +		}
>  
>  		xe_vm_prefetch_async(fd, vm, 0, 0, addr, bo_size, NULL, 0,
>  				     DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC);
>  
>  		xe_vm_madvise_atomic_attr(fd, vm, to_user_pointer(data), bo_size,
>  					  DRM_XE_ATOMIC_DEVICE);
> -		}
> +
>  		free(mem_attrs);
>  	}
>  }
> -- 
> 2.43.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.