summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-02-26 11:56:16 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-02-26 12:06:10 +0000
commitea332b64b6e9f6935da4b43f05fefcdcea32cc64 (patch)
tree20d9e6fb907f171b2e9c9a42413eff5230fd22c9 /lib
parent37773d91d9b56f9f06c86e405e8dc9343f2c71c1 (diff)
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/intel_drm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/intel_drm.c b/lib/intel_drm.c
index cde068b2..f16e5784 100644
--- a/lib/intel_drm.c
+++ b/lib/intel_drm.c
@@ -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);