From a26bb0a21d4e4f453e0628ada5d0f2539b0512fa Mon Sep 17 00:00:00 2001 From: Abdiel Janulgue Date: Tue, 5 Jun 2018 13:13:38 +0300 Subject: [PATCH i-g-t] igt/evictions: Leave a tiny amount out when mlocking the free system memory Locking the entire free system memory from being swapped is causing oom killer to terminate the test process. I experimented with various size combinations and it seems that mlocking the available memory subtracted by half the size of total test surfaces seems to cure the issue - while at the same time still being able to test i915's eviction mechanism by forcing the surface operations through a narrow memory window. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95427 Signed-off-by: Abdiel Janulgue --- tests/eviction_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/eviction_common.c b/tests/eviction_common.c index 300eb03..32af51f 100644 --- a/tests/eviction_common.c +++ b/tests/eviction_common.c @@ -139,7 +139,7 @@ static void mlocked_evictions(int fd, struct igt_eviction_test_ops *ops, intel_require_memory(surface_count, surface_size, CHECK_RAM); sz = surface_size*surface_count; - pin = intel_get_avail_ram_mb(); + pin = intel_get_avail_ram_mb() - (sz * 1 / 2) / (1024 * 1024); pin *= 1024 * 1024; igt_require(pin > sz); pin -= sz; -- 2.7.4