As of Linux kernel commit
17e810229cb3 ("mm: support
POSIX_FADV_NOREUSE"), POSIX_FADV_NOREUSE hints at the LRU algorithm to
ignore accesses to mapped files with this flag. Previously, it was a
no-op.
Add it in fio as an fadvise_hint option to test the new behavior.
Signed-off-by: Yuanchu Xie <yuanchu@google.com>
Link: https://lore.kernel.org/r/20230331183703.3145788-1-yuanchu@google.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
F_ADV_TYPE,
F_ADV_RANDOM,
F_ADV_SEQUENTIAL,
+ F_ADV_NOREUSE,
};
/*
flags = POSIX_FADV_RANDOM;
else if (td->o.fadvise_hint == F_ADV_SEQUENTIAL)
flags = POSIX_FADV_SEQUENTIAL;
+ else if (td->o.fadvise_hint == F_ADV_NOREUSE)
+ flags = POSIX_FADV_NOREUSE;
else {
log_err("fio: unknown fadvise type %d\n",
td->o.fadvise_hint);
.oval = F_ADV_SEQUENTIAL,
.help = "Advise using FADV_SEQUENTIAL",
},
+ { .ival = "noreuse",
+ .oval = F_ADV_NOREUSE,
+ .help = "Advise using FADV_NOREUSE",
+ },
},
.help = "Use fadvise() to advise the kernel on IO pattern",
.def = "1",