Test patches for RWF_NOACCESS noaccess
authorJens Axboe <axboe@kernel.dk>
Wed, 11 Dec 2019 23:36:50 +0000 (16:36 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 11 Dec 2019 23:36:50 +0000 (16:36 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c
engines/sync.c

index 9ba126d86c77ac821265bb18a8dbf323fd0ef2ca..f5d302d2f9da57c6176e47458df9dd4c5c44bbc2 100644 (file)
@@ -76,6 +76,7 @@ struct ioring_options {
        unsigned int sqpoll_set;
        unsigned int sqpoll_cpu;
        unsigned int uncached;
+       unsigned int noaccess;
 };
 
 static int fio_ioring_sqpoll_cb(void *data, unsigned long long *val)
@@ -142,6 +143,15 @@ static struct fio_option options[] = {
                .category = FIO_OPT_C_ENGINE,
                .group  = FIO_OPT_G_IOURING,
        },
+       {
+               .name   = "noaccess",
+               .lname  = "No access",
+               .type   = FIO_OPT_INT,
+               .off1   = offsetof(struct ioring_options, noaccess),
+               .help   = "Use RWF_NOACCESS for buffered reads",
+               .category = FIO_OPT_C_ENGINE,
+               .group  = FIO_OPT_G_IOURING,
+       },
        {
                .name   = NULL,
        },
@@ -192,6 +202,8 @@ static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
                }
                if (!td->o.odirect && o->uncached)
                        sqe->rw_flags = RWF_UNCACHED;
+               if (!td->o.odirect && o->noaccess)
+                       sqe->rw_flags = 0x80;
                sqe->off = io_u->offset;
        } else if (ddir_sync(io_u->ddir)) {
                if (io_u->ddir == DDIR_SYNC_FILE_RANGE) {
index 65fd210cf108293e84f45057726c30e81881a751..94e3f8556895ef509634796c0c92ac3c561a4910 100644 (file)
@@ -40,6 +40,7 @@ struct psyncv2_options {
        unsigned int hipri;
        unsigned int hipri_percentage;
        unsigned int uncached;
+       unsigned int noaccess;
 };
 
 static struct fio_option options[] = {
@@ -73,6 +74,15 @@ static struct fio_option options[] = {
                .category = FIO_OPT_C_ENGINE,
                .group  = FIO_OPT_G_INVALID,
        },
+       {
+               .name   = "noaccess",
+               .lname  = "noaccess",
+               .type   = FIO_OPT_INT,
+               .off1   = offsetof(struct psyncv2_options, noaccess),
+               .help   = "Use RWF_NOACCESS for buffered reads",
+               .category = FIO_OPT_C_ENGINE,
+               .group  = FIO_OPT_G_INVALID,
+       },
        {
                .name   = NULL,
        },
@@ -164,6 +174,8 @@ static enum fio_q_status fio_pvsyncio2_queue(struct thread_data *td,
                flags |= RWF_HIPRI;
        if (!td->o.odirect && o->uncached)
                flags |= RWF_UNCACHED;
+       if (!td->o.odirect && o->noaccess)
+               flags |= 0x80;
 
        iov->iov_base = io_u->xfer_buf;
        iov->iov_len = io_u->xfer_buflen;