diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-11-10 09:56:03 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-11-10 21:17:18 +0000 |
commit | 5e0509f629032bd7b4efa45b15ff13359d5314dc (patch) | |
tree | a90b56b899e022e4fb28f371b557d2d9fc2d9e00 | |
parent | f485466ca88716bd8a7d8001654ee1a4eaa5260e (diff) |
igt/gem_mmap_gtt: Swap thrash copy
Copy between two objects that together just exceed physical memory
causing ping-pong on every page. Not for the faint hearted.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_mmap_gtt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c index 4a419095..4113685e 100644 --- a/tests/gem_mmap_gtt.c +++ b/tests/gem_mmap_gtt.c @@ -511,6 +511,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus) { const uint32_t devid = intel_get_drm_devid(fd); uint64_t huge_object_size, i; + unsigned mode = CHECK_RAM; switch (huge) { case -2: @@ -522,11 +523,15 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus) case 0: huge_object_size = gem_mappable_aperture_size() + PAGE_SIZE; break; - default: + case 1: huge_object_size = gem_global_aperture_size(fd) + PAGE_SIZE; break; + default: + huge_object_size = (intel_get_total_ram_mb() << 19) + PAGE_SIZE; + mode |= CHECK_SWAP; + break; } - intel_require_memory(2*ncpus, huge_object_size, CHECK_RAM); + intel_require_memory(2*ncpus, huge_object_size, mode); igt_fork(child, ncpus) { uint32_t bo; @@ -777,6 +782,7 @@ igt_main { "medium", -1 }, { "big", 0 }, { "huge", 1 }, + { "swap", 2 }, { } }; const struct copy_mode { |