lib: Test against available swap

Even if we ignore the double-accounting bug in Linux, we need to be sure
that the remaining swapspace is adequate for running our test as the
system may be under load before we even start.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-02-26 11:56:16 +00:00
parent 37773d91d9
commit ea332b64b6

View File

@ -132,7 +132,7 @@ intel_get_total_swap_mb(void)
ret = sysinfo(&sysinf);
assert(ret == 0);
retval = sysinf.totalswap;
retval = sysinf.freeswap;
retval *= sysinf.mem_unit;
#elif defined(HAVE_SWAPCTL) /* Solaris */
long pagesize = sysconf(_SC_PAGESIZE);