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>
This commit is contained in:
Chris Wilson
2014-12-03 09:05:54 +00:00
parent b9b82fdc5f
commit 068f9ceb62
3 changed files with 121 additions and 0 deletions
+18
View File
@@ -1028,6 +1028,12 @@ static void test_forking_evictions(int fd, int size, int count,
reset_handle_ptr();
}
static void test_mlocked_evictions(int fd, int size, int count)
{
mlocked_evictions(fd, &fault_ops, size, count);
reset_handle_ptr();
}
static void test_swapping_evictions(int fd, int size, int count)
{
int trash_count;
@@ -1395,6 +1401,9 @@ int main(int argc, char **argv)
}
}
igt_subtest("mlocked-unsync-normal")
test_mlocked_evictions(fd, size, count);
igt_subtest("swapping-unsync-normal")
test_swapping_evictions(fd, size, count);
@@ -1416,6 +1425,9 @@ int main(int argc, char **argv)
igt_fork_signal_helper();
igt_subtest("mlocked-unsync-interruptible")
test_mlocked_evictions(fd, size, count);
igt_subtest("swapping-unsync-interruptible")
test_swapping_evictions(fd, size, count);
@@ -1495,6 +1507,9 @@ int main(int argc, char **argv)
}
}
igt_subtest("mlocked-normal-sync")
test_mlocked_evictions(fd, size, count);
igt_subtest("swapping-normal-sync")
test_swapping_evictions(fd, size, count);
@@ -1516,6 +1531,9 @@ int main(int argc, char **argv)
igt_fork_signal_helper();
igt_subtest("mlocked-sync-interruptible")
test_mlocked_evictions(fd, size, count);
igt_subtest("swapping-sync-interruptible")
test_swapping_evictions(fd, size, count);