pre_read=bool If this is given, files will be pre-read into memory before
starting the given IO operation. This will also clear
the 'invalidate' flag, since it is pointless to pre-read
- and then drop the cache.
+ and then drop the cache. This will only work for IO engines
+ that are seekable, since they allow you to read the same data
+ multiple times. Thus it will not work on eg network or splice
+ IO.
unlink=bool Unlink the job files when done. Not the default, as repeated
runs of that job would then waste time recreating the file
.open_file = fio_netio_open_file,
.close_file = generic_close_file,
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
- FIO_SIGQUIT,
+ FIO_SIGQUIT | FIO_PIPEIO,
};
#endif
.open_file = fio_netio_open_file,
.close_file = fio_netio_close_file,
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
- FIO_SIGQUIT,
+ FIO_SIGQUIT | FIO_PIPEIO,
};
static void fio_init fio_netio_register(void)
.open_file = generic_open_file,
.close_file = generic_close_file,
.get_file_size = generic_get_file_size,
- .flags = FIO_SYNCIO,
+ .flags = FIO_SYNCIO | FIO_PIPEIO,
};
#else /* FIO_HAVE_SPLICE */
unsigned int bs;
char *b;
+ if (td->io_ops->flags & FIO_PIPEIO)
+ return 0;
+
if (!fio_file_open(f)) {
if (td->io_ops->open_file(td, f)) {
log_err("fio: cannot pre-read, failed to open file\n");
.BI pre_read \fR=\fPbool
If this is given, files will be pre-read into memory before starting the given
IO operation. This will also clear the \fR \fBinvalidate\fR flag, since it is
-pointless to pre-read and then drop the cache.
+pointless to pre-read and then drop the cache. This will only work for IO
+engines that are seekable, since they allow you to read the same data
+multiple times. Thus it will not work on eg network or splice IO.
.TP
.BI unlink \fR=\fPbool
Unlink job files when done. Default: false.
if (td->o.verify != VERIFY_NONE)
td->o.refill_buffers = 1;
- if (td->o.pre_read)
+ if (td->o.pre_read) {
td->o.invalidate_cache = 0;
+ if (td->io_ops->flags & FIO_PIPEIO)
+ log_info("fio: cannot pre-read files with an IO engine"
+ " that isn't seekable. Pre-read disabled.\n");
+ }
if (td->o.mem_align) {
if (td->o.odirect && !is_power_of_2(td->o.mem_align)) {
FIO_UNIDIR = 1 << 5, /* engine is uni-directional */
FIO_NOIO = 1 << 6, /* thread does only pseudo IO */
FIO_SIGQUIT = 1 << 7, /* needs SIGQUIT to exit */
+ FIO_PIPEIO = 1 << 8, /* input/output no seekable */
};
/*