This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Simple DAX microbenchmark (throughput + per-chunk latency) | |
| // - Works on /dev/daxX.Y or an fs-DAX mmap'ed file | |
| // - No external libraries | |
| // - Ensures persistence on x86 via CLWB/CLFLUSHOPT + SFENCE | |
| // | |
| // Build: gcc -O3 -march=native -Wall -Wextra -o dax_bench dax-write-read-microbench.c | |
| // Example: sudo ./dax_bench -d /dev/dax0.0 -m 256M -b 4K -t write | |
| // sudo ./dax_bench -d /dev/dax0.0 -m 256M -b 4K -t read | |
| // Notes: | |
| // * On x86, we flush caches to ensure data reaches persistence domain. |