projects
/
platform
/
upstream
/
intel-gpu-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
784b772
)
linux: Flush page/buffer cache before querying available memory
author
Chris Wilson
<chris@chris-wilson.co.uk>
Mon, 21 Jul 2014 15:15:24 +0000
(16:15 +0100)
committer
Chris Wilson
<chris@chris-wilson.co.uk>
Mon, 21 Jul 2014 15:32:42 +0000
(16:32 +0100)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
lib/intel_os.c
patch
|
blob
|
history
diff --git
a/lib/intel_os.c
b/lib/intel_os.c
index
2a29cc0
..
0d4f43d
100644
(file)
--- a/
lib/intel_os.c
+++ b/
lib/intel_os.c
@@
-98,7
+98,14
@@
intel_get_avail_ram_mb(void)
#ifdef HAVE_STRUCT_SYSINFO_TOTALRAM /* Linux */
struct sysinfo sysinf;
- int ret;
+ int fd, ret;
+
+ fd = open("/proc/sys/vm/drop_caches", O_RDWR);
+ if (fd != -1) {
+ ret = write(fd, "3", 2);
+ close(fd);
+ (void)ret;
+ }
ret = sysinfo(&sysinf);
assert(ret == 0);