[PATCH] drm/xe/tests: Limit purgeable size for faster execution
Thomas Hellström
thomas.hellstrom at linux.intel.com
Wed Nov 13 15:52:19 UTC 2024
On Wed, 2024-11-13 at 16:02 +0100, Nirmoy Das wrote:
> xe_bo_shrink_kunit takes a while to run on some machines depending
> on swap storage speed and ram size. Limit purgeable size to 2GB
> so xe_bo_shrink_kunit can execute much faster.
Hmm. This actually limits the swap size to 2GiB, and thus *increases*
the fraction of purgeable bos.
But question is if we end up shrinking only purgeable bos, given that
we, to be safe, overestimate the need for purgeable bos with 20%.
Probably better than skipping the test completely, though.
/Thomas
>
> Cc: Matthew Auld <matthew.auld at intel.com>
> Suggested-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2998
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
> drivers/gpu/drm/xe/tests/xe_bo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c
> b/drivers/gpu/drm/xe/tests/xe_bo.c
> index cd811aa2b227..71b71a546abe 100644
> --- a/drivers/gpu/drm/xe/tests/xe_bo.c
> +++ b/drivers/gpu/drm/xe/tests/xe_bo.c
> @@ -467,7 +467,7 @@ static int shrink_test_run_device(struct
> xe_device *xe)
> }
> to_alloc = ram * 2;
>
> - ram_and_swap = ram + get_nr_swap_pages() * PAGE_SIZE;
> + ram_and_swap = ram + min(get_nr_swap_pages() * PAGE_SIZE,
> SZ_2G);
> if (to_alloc > ram_and_swap)
> purgeable = to_alloc - ram_and_swap;
> purgeable += div64_u64(purgeable, 5);
More information about the Intel-xe
mailing list