From 90c883ce651dc74671086fdf8229902ebde593e7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 10 Mar 2017 20:09:26 +0000 Subject: lib: Shrink all i915 caches before measuring avail memory Signed-off-by: Chris Wilson --- lib/intel_os.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/intel_os.c') diff --git a/lib/intel_os.c b/lib/intel_os.c index 0f9af634..924ac7e7 100644 --- a/lib/intel_os.c +++ b/lib/intel_os.c @@ -51,6 +51,7 @@ #include "intel_io.h" #include "drmtest.h" #include "igt_aux.h" +#include "igt_debugfs.h" /** * intel_get_total_ram_mb: @@ -295,6 +296,8 @@ void intel_purge_vm_caches(void) { int fd; + igt_drop_caches_set(DROP_SHRINK_ALL); + fd = open("/proc/sys/vm/drop_caches", O_WRONLY); if (fd >= 0) { /* BIT(2): Be quiet. Cannot be combined with other operations, -- cgit v1.2.3