Merge branch 'master' of https://github.com/SuhoSon/fio
authorJens Axboe <axboe@kernel.dk>
Tue, 4 Apr 2023 13:37:37 +0000 (07:37 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Apr 2023 13:37:37 +0000 (07:37 -0600)
* 'master' of https://github.com/SuhoSon/fio:
  thinktime: Fix missing re-init thinktime when using ramptime

HOWTO.rst
fio.1
fio.h
ioengines.c
options.c

index 5240f9da866d76da6d044961585d3b6249b3d514..cb0f9834f852baf11a303466b270b8724f38c013 100644 (file)
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -1308,6 +1308,11 @@ I/O type
                **random**
                        Advise using **FADV_RANDOM**.
 
+               **noreuse**
+                       Advise using **FADV_NOREUSE**. This may be a no-op on older Linux
+                       kernels. Since Linux 6.3, it provides a hint to the LRU algorithm.
+                       See the :manpage:`posix_fadvise(2)` man page.
+
 .. option:: write_hint=str
 
        Use :manpage:`fcntl(2)` to advise the kernel what life time to expect
diff --git a/fio.1 b/fio.1
index e2db3a3fc0385ecb934b04cd739834af90a728ef..311b16d828978fd29840591812b57796e0c8bee7 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -1098,6 +1098,11 @@ Advise using FADV_SEQUENTIAL.
 .TP
 .B random
 Advise using FADV_RANDOM.
+.TP
+.B noreuse
+Advise using FADV_NOREUSE. This may be a no-op on older Linux
+kernels. Since Linux 6.3, it provides a hint to the LRU algorithm.
+See the \fBposix_fadvise\fR\|(2) man page.
 .RE
 .RE
 .TP
diff --git a/fio.h b/fio.h
index 7e90175af8d1e1fbcdf65b4dc220857f19bed128..6b841e9c263bf1b1960d00b551d78e7ebb986467 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -163,6 +163,7 @@ enum {
        F_ADV_TYPE,
        F_ADV_RANDOM,
        F_ADV_SEQUENTIAL,
+       F_ADV_NOREUSE,
 };
 
 /*
index e2316ee4e391d0d5899c960552fec4d19aa33ca2..742f97dd32a444196706bebb29ab423a9dfb8a25 100644 (file)
@@ -565,6 +565,10 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f)
                        flags = POSIX_FADV_RANDOM;
                else if (td->o.fadvise_hint == F_ADV_SEQUENTIAL)
                        flags = POSIX_FADV_SEQUENTIAL;
+#ifdef POSIX_FADV_NOREUSE
+               else if (td->o.fadvise_hint == F_ADV_NOREUSE)
+                       flags = POSIX_FADV_NOREUSE;
+#endif
                else {
                        log_err("fio: unknown fadvise type %d\n",
                                                        td->o.fadvise_hint);
index 18857795e3c53b0c5c9f647e21a5e4552c0fab9e..440bff37cb131fcbc4b8f9e8d10da449d7aa5709 100644 (file)
--- a/options.c
+++ b/options.c
@@ -4,6 +4,7 @@
 #include <ctype.h>
 #include <string.h>
 #include <assert.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <netinet/in.h>
 
@@ -2740,6 +2741,12 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .oval = F_ADV_SEQUENTIAL,
                            .help = "Advise using FADV_SEQUENTIAL",
                          },
+#ifdef POSIX_FADV_NOREUSE
+                         { .ival = "noreuse",
+                           .oval = F_ADV_NOREUSE,
+                           .help = "Advise using FADV_NOREUSE",
+                         },
+#endif
                },
                .help   = "Use fadvise() to advise the kernel on IO pattern",
                .def    = "1",