From 98dcf2f0dcf7097a9404c0598ade4fc94cffeaac Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 25 Mar 2016 00:50:45 +0000 Subject: igt/gem_concurrent_blit: Relax maxfiles restrictions Only fail the dmabuf tests if we cannot prep the system to support "unlimited" fd. Signed-off-by: Chris Wilson --- lib/intel_os.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/intel_os.c') diff --git a/lib/intel_os.c b/lib/intel_os.c index 8fcf0d63..812199c1 100644 --- a/lib/intel_os.c +++ b/lib/intel_os.c @@ -46,6 +46,7 @@ #elif defined(HAVE_SWAPCTL) /* Solaris */ #include #endif +#include #include "intel_io.h" #include "drmtest.h" @@ -192,6 +193,16 @@ static uint64_t vfs_file_max(void) return max; } +static unsigned max_open_files(void) +{ + struct rlimit rlim; + + if (getrlimit(RLIMIT_NOFILE, &rlim)) + rlim.rlim_cur = 64 << 10; + + return rlim.rlim_cur; +} + /** * intel_require_files: * @count: number of files that will be created @@ -200,9 +211,9 @@ static uint64_t vfs_file_max(void) */ void intel_require_files(uint64_t count) { - igt_require_f(count < vfs_file_max(), - "Estimated that we need %'llu files, but the VFS maximum is only %'llu\n", - (long long)count, (long long)vfs_file_max()); + igt_require_f(count < max_open_files(), + "Estimated that we need %'llu files, but the process maximum is only %'llu\n", + (long long)count, (long long)max_open_files()); } int __intel_check_memory(uint64_t count, uint64_t size, unsigned mode, -- cgit v1.2.3