o->end_fsync = le32_to_cpu(top->end_fsync);
o->pre_read = le32_to_cpu(top->pre_read);
o->sync_io = le32_to_cpu(top->sync_io);
+ o->write_hint = le32_to_cpu(top->write_hint);
o->verify = le32_to_cpu(top->verify);
o->do_verify = le32_to_cpu(top->do_verify);
o->verifysort = le32_to_cpu(top->verifysort);
top->end_fsync = cpu_to_le32(o->end_fsync);
top->pre_read = cpu_to_le32(o->pre_read);
top->sync_io = cpu_to_le32(o->sync_io);
+ top->write_hint = cpu_to_le32(o->write_hint);
top->verify = cpu_to_le32(o->verify);
top->do_verify = cpu_to_le32(o->do_verify);
top->verifysort = cpu_to_le32(o->verifysort);
struct psyncv2_options {
void *pad;
unsigned int hipri;
- unsigned int stream;
};
static struct fio_option options[] = {
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_INVALID,
},
- {
- .name = "stream",
- .lname = "Stream ID",
- .type = FIO_OPT_STR,
- .off1 = offsetof(struct psyncv2_options, stream),
- .help = "Set expected write life time",
- .category = FIO_OPT_C_ENGINE,
- .group = FIO_OPT_G_INVALID,
- .posval = {
- { .ival = "short",
- .oval = RWF_WRITE_LIFE_SHORT,
- },
- { .ival = "medium",
- .oval = RWF_WRITE_LIFE_MEDIUM,
- },
- { .ival = "long",
- .oval = RWF_WRITE_LIFE_LONG,
- },
- { .ival = "extreme",
- .oval = RWF_WRITE_LIFE_EXTREME,
- },
- },
- },
{
.name = NULL,
},
if (o->hipri)
flags |= RWF_HIPRI;
- if (o->stream)
- flags |= o->stream;
iov->iov_base = io_u->xfer_buf;
iov->iov_len = io_u->xfer_buflen;
goto err;
}
}
-#ifdef FIO_HAVE_STREAMID
- if (td->o.fadvise_stream &&
+#ifdef FIO_HAVE_WRITE_HINT
+ if (fio_option_is_set(&td->o, write_hint) &&
(f->filetype == FIO_TYPE_BLOCK || f->filetype == FIO_TYPE_FILE)) {
- off_t stream = td->o.fadvise_stream;
+ uint64_t hint = td->o.write_hint;
- if (posix_fadvise(f->fd, stream, f->io_size, POSIX_FADV_STREAMID) < 0) {
- td_verror(td, errno, "fadvise streamid");
+ if (fcntl(f->fd, F_SET_RW_HINT, &hint) < 0) {
+ td_verror(td, errno, "fcntl write hint");
goto err;
}
}
.category = FIO_OPT_C_FILE,
.group = FIO_OPT_G_INVALID,
},
-#ifdef FIO_HAVE_STREAMID
- {
- .name = "fadvise_stream",
- .lname = "Fadvise stream",
- .type = FIO_OPT_INT,
- .off1 = offsetof(struct thread_options, fadvise_stream),
- .help = "Use fadvise() to set stream ID",
- .category = FIO_OPT_C_FILE,
- .group = FIO_OPT_G_INVALID,
- },
-#else
- {
- .name = "fadvise_stream",
- .lname = "Fadvise stream",
- .type = FIO_OPT_UNSUPPORTED,
- .help = "Your platform does not support fadvise stream ID",
- },
-#endif
{
.name = "fsync",
.lname = "Fsync",
.category = FIO_OPT_C_IO,
.group = FIO_OPT_G_IO_TYPE,
},
+#ifdef FIO_HAVE_WRITE_HINT
+ {
+ .name = "write_hint",
+ .lname = "Write hint",
+ .type = FIO_OPT_STR,
+ .off1 = offsetof(struct thread_options, write_hint),
+ .help = "Set expected write life time",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_INVALID,
+ .posval = {
+ { .ival = "none",
+ .oval = RWH_WRITE_LIFE_NONE,
+ },
+ { .ival = "short",
+ .oval = RWH_WRITE_LIFE_SHORT,
+ },
+ { .ival = "medium",
+ .oval = RWH_WRITE_LIFE_MEDIUM,
+ },
+ { .ival = "long",
+ .oval = RWH_WRITE_LIFE_LONG,
+ },
+ { .ival = "extreme",
+ .oval = RWH_WRITE_LIFE_EXTREME,
+ },
+ },
+ },
+#endif
{
.name = "create_serialize",
.lname = "Create serialize",
}
#endif
-#ifndef POSIX_FADV_STREAMID
-#define POSIX_FADV_STREAMID 8
+#ifndef F_GET_RW_HINT
+#ifndef F_LINUX_SPECIFIC_BASE
+#define F_LINUX_SPECIFIC_BASE 1024
+#endif
+#define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11)
+#define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12)
+#endif
+
+#ifndef RWH_WRITE_LIFE_NONE
+#define RWH_WRITE_LIFE_NONE 0
+#define RWH_WRITE_LIFE_SHORT 1
+#define RWH_WRITE_LIFE_MEDIUM 2
+#define RWH_WRITE_LIFE_LONG 3
+#define RWH_WRITE_LIFE_EXTREME 4
#endif
-#define FIO_HAVE_STREAMID
+#define FIO_HAVE_WRITE_HINT
#ifndef RWF_HIPRI
#define RWF_HIPRI 0x00000001
};
enum {
- FIO_SERVER_VER = 62,
+ FIO_SERVER_VER = 63,
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
FIO_SERVER_MAX_CMD_MB = 2048,
unsigned int end_fsync;
unsigned int pre_read;
unsigned int sync_io;
+ unsigned int write_hint;
unsigned int verify;
unsigned int do_verify;
unsigned int verifysort;
uint32_t end_fsync;
uint32_t pre_read;
uint32_t sync_io;
+ uint32_t write_hint;
uint32_t verify;
uint32_t do_verify;
uint32_t verifysort;
uint32_t random_distribution;
uint32_t exitall_error;
+ uint32_t pad;
struct zone_split zone_split[DDIR_RWDIR_CNT][ZONESPLIT_MAX];
uint32_t zone_split_nr[DDIR_RWDIR_CNT];