]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/xe: Add a xe_bo subtest for shrinking / swapping
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Mon, 9 Sep 2024 08:56:54 +0000 (10:56 +0200)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Wed, 11 Sep 2024 07:11:33 +0000 (09:11 +0200)
commit5a90b60db5e6765367d9bb2c03f66b14d72946d2
treee6abe1325753c345066f3adbc8c1ee9e3bb1418a
parent1c129ed07de47684ff2471e32b52fa823533aa06
drm/xe: Add a xe_bo subtest for shrinking / swapping

Add a subtest that tries to allocate twice the amount of
buffer object memory available, write data to it and then read
all the data back verifying data integrity.
In order to be able to do this on systems that
have no or not enough swap-space available, allocate some memory
as purgeable, and introduce a function to purge such memory from
the TTM swap_notify path.

this test is intended to add test coverage to the current
bo swap path and upcoming shrinking path.

The test has previously been part of the xe bo shrinker series.

v2:
- Skip test if the execution time is expected to be too long.
- Minor code cleanups.

v3:
- Print random seed. (Matthew Auld)

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240909085654.5064-1-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/xe/tests/xe_bo.c
drivers/gpu/drm/xe/xe_bo.c