Squashed commit of the following:

commit b96ddedf4ffbba57faaaf8bf18781a7abfb9d4c1
Author: Carl Pearson <pearson@illinois.edu>
Date:   Mon Sep 23 16:53:54 2019 -0500

    add newline to result.hpp

commit c7e9f6ff4775bf86f9af216cbe311f65bf985f63
Author: Carl Pearson <pearson@illinois.edu>
Date:   Mon Sep 23 16:53:09 2019 -0500

    add EPERM to fs operations

commit bac918fd022006cad0da899c06ac31e9db59a2fb
Author: Carl Pearson <pearson@illinois.edu>
Date:   Mon Sep 23 16:49:25 2019 -0500

    add filesystem cache interface
This commit is contained in:
Carl Pearson
2019-09-23 16:54:33 -05:00
parent 7f1b1289bb
commit d6c861719f
7 changed files with 482 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ CPU/GPU performance control library for benchmarking
- [x] Disable GPU turbo (nvidia)
- [x] Flush addresses from cache (amd64, POWER)
- [x] CUDA not required (GPU functions will not be compiled)
- [x] Flush file system caches (linux)
## Installing
@@ -84,6 +85,22 @@ See [examples/gpu_monitor.cu](examples/gpu_monitor.cu)
* `void Monitor::pause()`: pause the monitor thread
* `void Monitor::resume()`: resume the monitor thread
### Flush file system caches
`perfect` can drop various filesystem caches
See [tools/sync_drop_caches.cpp](tools/sync_drop_caches.cpp)
```c++
#include "perfect/drop_caches.hpp"
```
* `Result sync()`: flush filesystem caches to disk
* `Result drop_caches(DropCaches_t mode)`: remove file system caches
* `mode = PAGECACHE`: drop page caches
* `mode = ENTRIES`: drop dentries and inodes
* `mode = PAGECACHE | ENTRIES`: both
### CPU Turbo
`perfect` can enable and disable CPU boost through the Intel p-state mechanism or the ACPI cpufreq mechanism.