Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
randrepeat=bool For random IO workloads, seed the generator in a predictable
way so that results are repeatable across repetitions.
randrepeat=bool For random IO workloads, seed the generator in a predictable
way so that results are repeatable across repetitions.
+fallocate=bool By default, fio will use fallocate() to advise the system
+ of the size of the file we are going to write. This can be
+ turned off with fallocate=0. May not be available on all
+ supported platforms.
+
fadvise_hint=bool By default, fio will use fadvise() to advise the kernel
on what IO patterns it is likely to issue. Sometimes you
want to test specific IO patterns without telling the
fadvise_hint=bool By default, fio will use fadvise() to advise the kernel
on what IO patterns it is likely to issue. Sometimes you
want to test specific IO patterns without telling the
+#ifdef FIO_HAVE_FALLOCATE
+ if (td->o.fallocate && !td->o.fill_device) {
+ dprint(FD_FILE, "fallocate file %s size %llu\n", f->file_name,
+ f->real_file_size);
+
+ r = posix_fallocate(f->fd, 0, f->real_file_size);
+ if (r < 0) {
+ log_err("fio: posix_fallocate fails: %s\n",
+ strerror(-r));
+ }
+ }
+#endif
+
if (!new_layout)
goto done;
if (!new_layout)
goto done;
td_verror(td, errno, "ftruncate");
goto err;
}
td_verror(td, errno, "ftruncate");
goto err;
}
-
-#ifdef FIO_HAVE_FALLOCATE
- dprint(FD_FILE, "fallocate file %s, size %llu\n", f->file_name,
- f->real_file_size);
- r = posix_fallocate(f->fd, 0, f->real_file_size);
- if (r < 0) {
- log_err("fio: posix_fallocate fails: %s\n",
- strerror(-r));
- }
-#endif
}
b = malloc(td->o.max_bs[DDIR_WRITE]);
}
b = malloc(td->o.max_bs[DDIR_WRITE]);
Seed the random number generator in a predictable way so results are repeatable
across runs. Default: true.
.TP
Seed the random number generator in a predictable way so results are repeatable
across runs. Default: true.
.TP
+.BI fallocate \fR=\fPbool
+By default, fio will use fallocate() to advise the system of the size of the
+file we are going to write. This can be turned off with fallocate=0. May not
+be available on all supported platforms.
+.TP
.BI fadvise_hint \fR=\fPbool
Disable use of \fIposix_fadvise\fR\|(2) to advise the kernel what I/O patterns
are likely to be issued. Default: true.
.BI fadvise_hint \fR=\fPbool
Disable use of \fIposix_fadvise\fR\|(2) to advise the kernel what I/O patterns
are likely to be issued. Default: true.
unsigned int file_service_type;
unsigned int group_reporting;
unsigned int fadvise_hint;
unsigned int file_service_type;
unsigned int group_reporting;
unsigned int fadvise_hint;
+ unsigned int fallocate;
unsigned int zero_buffers;
unsigned int refill_buffers;
unsigned int time_based;
unsigned int zero_buffers;
unsigned int refill_buffers;
unsigned int time_based;
},
.parent = "nrfiles",
},
},
.parent = "nrfiles",
},
+#ifdef FIO_HAVE_FALLOCATE
+ {
+ .name = "fallocate",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(fallocate),
+ .help = "Use fallocate() when laying out files",
+ .def = "1",
+ },
+#endif
{
.name = "fadvise_hint",
.type = FIO_OPT_BOOL,
{
.name = "fadvise_hint",
.type = FIO_OPT_BOOL,