summaryrefslogtreecommitdiff
path: root/lib/intel_os.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-03-25 00:50:45 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-25 18:23:56 +0000
commit98dcf2f0dcf7097a9404c0598ade4fc94cffeaac (patch)
tree698208ad19343d9a7f663914fd9516529a7cc76e /lib/intel_os.c
parent4e2a785e2412f148693b993d1a29d62f48da4937 (diff)
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/intel_os.c')
-rw-r--r--lib/intel_os.c17
1 files changed, 14 insertions, 3 deletions
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 <sys/swap.h>
#endif
+#include <sys/resource.h>
#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,