summaryrefslogtreecommitdiff
path: root/tests/gem_evict_everything.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-12-03 09:05:54 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-03-29 15:57:50 +0100
commit068f9ceb628b3d721bf3d74c7932afc01a70905c (patch)
tree9be0d7c2f3811b5c3ed7e8df503d9cc94ef7e58c /tests/gem_evict_everything.c
parentb9b82fdc5fdcbc43d0720b6aaf79e1f00f407d3a (diff)
igt/gem_evict_everything: Use mlock to reduce available memory
The idea here is to check what happens when a large process requests memory from us - we create and utilize a bunch of surfaces then have to relinquish some but continue using the whole working set (so as to force reloads). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_evict_everything.c')
-rw-r--r--tests/gem_evict_everything.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index 15ab382a..54acc2b6 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -160,6 +160,11 @@ static void test_forking_evictions(int fd, int size, int count,
forking_evictions(fd, &fault_ops, size, count, trash_count, flags);
}
+static void test_mlocked_evictions(int fd, int size, int count)
+{
+ mlocked_evictions(fd, &fault_ops, size, count);
+}
+
static void test_swapping_evictions(int fd, int size, int count)
{
int trash_count;
@@ -205,6 +210,9 @@ igt_main
}
}
+ igt_subtest("mlocked-normal")
+ test_mlocked_evictions(fd, size, count);
+
igt_subtest("swapping-normal")
test_swapping_evictions(fd, size, count);
@@ -224,6 +232,9 @@ igt_main
igt_fork_signal_helper();
+ igt_subtest("mlocked-interruptible")
+ test_mlocked_evictions(fd, size, count);
+
igt_subtest("swapping-interruptible")
test_swapping_evictions(fd, size, count);
@@ -237,6 +248,14 @@ igt_main
}
if (igt_fork_hang_helper()) {
+ igt_fixture {
+ size = 1024 * 1024;
+ count = 3*gem_aperture_size(fd) / size / 4;
+ }
+
+ igt_subtest("mlocked-hang")
+ test_mlocked_evictions(fd, size, count);
+
igt_subtest("swapping-hang")
test_swapping_evictions(fd, size, count);