Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
/*
* FIXME: add blockdev flushing too
*/
/*
* FIXME: add blockdev flushing too
*/
ret = madvise(f->mmap_ptr, f->mmap_sz, MADV_DONTNEED);
ret = madvise(f->mmap_ptr, f->mmap_sz, MADV_DONTNEED);
- else if (f->filetype == FIO_TYPE_FILE) {
+#ifdef FIO_MADV_FREE
+ (void) madvise(f->mmap_ptr, f->mmap_sz, FIO_MADV_FREE);
+#endif
+ } else if (f->filetype == FIO_TYPE_FILE) {
ret = fadvise(f->fd, off, len, POSIX_FADV_DONTNEED);
} else if (f->filetype == FIO_TYPE_BD) {
ret = blockdev_invalidate_cache(f->fd);
ret = fadvise(f->fd, off, len, POSIX_FADV_DONTNEED);
} else if (f->filetype == FIO_TYPE_BD) {
ret = blockdev_invalidate_cache(f->fd);
+#ifdef MADV_FREE
+#define FIO_MADV_FREE MADV_FREE
+#endif
+
#define FIO_O_NOATIME 0
#endif
#define FIO_O_NOATIME 0
#endif
+#ifdef MADV_REMOVE
+#define FIO_MADV_FREE MADV_REMOVE
+#endif
+
#define CACHE_LINE_FILE \
"/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size"
#define CACHE_LINE_FILE \
"/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size"
*/
#define FIO_MAX_CPUS 16384
*/
#define FIO_MAX_CPUS 16384
+#ifdef MADV_FREE
+#define FIO_MADV_FREE MADV_FREE
+#endif
+