From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: [CI] drm/xe: Attempt to reduce execution time for the xe_bo_shrink dynamic test
Date: Thu, 19 Sep 2024 18:51:22 +0200 [thread overview]
Message-ID: <20240919165122.17751-1-thomas.hellstrom@linux.intel.com> (raw)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
drivers/gpu/drm/xe/tests/xe_bo.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c
index 7d3fd720478b..9aa6d30345e4 100644
--- a/drivers/gpu/drm/xe/tests/xe_bo.c
+++ b/drivers/gpu/drm/xe/tests/xe_bo.c
@@ -440,7 +440,7 @@ static int shrink_test_run_device(struct xe_device *xe)
LIST_HEAD(bos);
struct xe_bo_link *link, *next;
struct sysinfo si;
- size_t ram, ram_and_swap, purgeable, alloced, to_alloc, limit;
+ size_t ram, ram_and_swap, purgeable, alloced, to_alloc;
unsigned int interrupted = 0, successful = 0, count = 0;
struct rnd_state prng;
u64 rand_seed;
@@ -451,25 +451,18 @@ static int shrink_test_run_device(struct xe_device *xe)
kunit_info(test, "Random seed is 0x%016llx.\n",
(unsigned long long)rand_seed);
- /* Skip if execution time is expected to be too long. */
-
- limit = SZ_32G;
- /* IGFX with flat CCS needs to copy when swapping / shrinking */
- if (!IS_DGFX(xe) && xe_device_has_flat_ccs(xe))
- limit = SZ_16G;
-
si_meminfo(&si);
ram = (size_t)si.freeram * si.mem_unit;
- if (ram > limit) {
- kunit_skip(test, "Too long expected execution time.\n");
- return 0;
- }
to_alloc = ram * 2;
- ram_and_swap = ram + get_nr_swap_pages() * PAGE_SIZE;
+ ram_and_swap = get_nr_swap_pages() * PAGE_SIZE;
+ /* Don't use more that 4G swap to save execution time. */
+ ram_and_swap = min_t(size_t, ram_and_swap, SZ_4G);
+ ram_and_swap += ram;
+ purgeable = 0;
if (to_alloc > ram_and_swap)
purgeable = to_alloc - ram_and_swap;
- purgeable += purgeable / 5;
+ purgeable += to_alloc / 128;
kunit_info(test, "Free ram is %lu bytes. Will allocate twice of that.\n",
(unsigned long)ram);
--
2.46.0
next reply other threads:[~2024-09-19 16:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 16:51 Thomas Hellström [this message]
2024-09-19 16:56 ` ✓ CI.Patch_applied: success for drm/xe: Attempt to reduce execution time for the xe_bo_shrink dynamic test Patchwork
2024-09-19 16:57 ` ✗ CI.checkpatch: warning " Patchwork
2024-09-19 16:58 ` ✓ CI.KUnit: success " Patchwork
2024-09-19 17:10 ` ✓ CI.Build: " Patchwork
2024-09-19 17:12 ` ✓ CI.Hooks: " Patchwork
2024-09-19 17:13 ` ✓ CI.checksparse: " Patchwork
2024-09-19 17:44 ` ✗ CI.BAT: failure " Patchwork
2024-09-19 21:15 ` ✗ CI.FULL: " Patchwork
2024-09-20 13:29 ` [CI] " Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240919165122.17751-1-thomas.hellstrom@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.