[Intel-gfx] [PATCH] drm/i915/selftests: fixup igt_shrink_thp

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Jul 29 10:53:45 UTC 2021


Hi Matt,

On 28/07/2021 16:50, Matthew Auld wrote:
> Since the object might still be active here, the shrink_all will simply
> ignore it, which blows up in the test, since the pages will still be
> there. Currently THP is disabled which should result in the test being
> skipped, but if we ever re-enable THP we might start seeing the failure.
> Fix this by forcing I915_SHRINK_ACTIVE.
> 
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>   drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> index a094f3ce1a90..7a67e880b562 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> @@ -1575,7 +1575,10 @@ static int igt_shrink_thp(void *arg)
>   	 * Now that the pages are *unpinned* shrink-all should invoke
>   	 * shmem to truncate our pages.
>   	 */
> -	i915_gem_shrink_all(i915);
> +	i915_gem_shrink(NULL, i915, -1UL, NULL,
> +			I915_SHRINK_BOUND |
> +			I915_SHRINK_UNBOUND |
> +			I915_SHRINK_ACTIVE);
>   	if (i915_gem_object_has_pages(obj)) {
>   		pr_err("shrink-all didn't truncate the pages\n");
>   		err = -EINVAL;
> 

I did s/shrink-all/shrinking/ locally in the comment above, and in 
pr_err below the call to shrinker. Are you okay if I repost like that 
and with my r-b as part of my series?

Regards,

Tvrtko


More information about the dri-devel mailing list