From 8d4d8b00ed92287cee81448ad886d8e9a4602f7b Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 23 Jan 2012 17:18:53 +0100 Subject: [PATCH] tests/gem_tiled_swapping: be more conservative with the swap requirements Blew up and angered the OOM killer on one of my machines. Signed-Off-by: Daniel Vetter --- tests/gem_tiled_swapping.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c index 1af36525..d1484f0e 100644 --- a/tests/gem_tiled_swapping.c +++ b/tests/gem_tiled_swapping.c @@ -112,6 +112,11 @@ main(int argc, char **argv) return 77; } + if (intel_get_total_ram_mb() / 4 > intel_get_total_swap_mb()) { + printf("not enough swap detected\n"); + return 77; + } + for (i = 0; i < count; i++) bo_handles[i] = create_bo_and_fill(fd);