options: force refill_buffers with pattern and any reads
[fio.git] / options.c
index dcf0eeabba188c718170554e156e774d5d54250d..b489e90210ae008be47b427195242a56272daa90 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1306,8 +1306,17 @@ static int str_buffer_pattern_cb(void *data, const char *input)
 
        assert(ret != 0);
        td->o.buffer_pattern_bytes = ret;
-       if (!td->o.compress_percentage)
+
+       /*
+        * If this job is doing any reading or has compression set,
+        * ensure that we refill buffers for writes or we could be
+        * invalidating the pattern through reads.
+        */
+       if (!td->o.compress_percentage && !td_read(td))
                td->o.refill_buffers = 0;
+       else
+               td->o.refill_buffers = 1;
+
        td->o.scramble_buffers = 0;
        td->o.zero_buffers = 0;
 
@@ -2603,6 +2612,12 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .oval = MEM_MMAPHUGE,
                            .help = "Like mmap, but use huge pages",
                          },
+#endif
+#ifdef CONFIG_CUDA
+                         { .ival = "cudamalloc",
+                           .oval = MEM_CUDA_MALLOC,
+                           .help = "Allocate GPU device memory for GPUDirect RDMA",
+                         },
 #endif
                  },
        },
@@ -3562,6 +3577,18 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .type   = FIO_OPT_UNSUPPORTED,
                .help   = "Build fio with libnuma-dev(el) to enable this option",
        },
+#endif
+#ifdef CONFIG_CUDA
+       {
+               .name   = "gpu_dev_id",
+               .lname  = "GPU device ID",
+               .type   = FIO_OPT_INT,
+               .off1   = offsetof(struct thread_options, gpu_dev_id),
+               .help   = "Set GPU device ID for GPUDirect RDMA",
+               .def    = "0",
+               .category = FIO_OPT_C_GENERAL,
+               .group  = FIO_OPT_G_INVALID,
+       },
 #endif
        {
                .name   = "end_fsync",
@@ -3865,6 +3892,16 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .category = FIO_OPT_C_STAT,
                .group  = FIO_OPT_G_INVALID,
        },
+       {
+               .name   = "stats",
+               .lname  = "Stats",
+               .type   = FIO_OPT_BOOL,
+               .off1   = offsetof(struct thread_options, stats),
+               .help   = "Enable collection of stats",
+               .def    = "1",
+               .category = FIO_OPT_C_STAT,
+               .group  = FIO_OPT_G_INVALID,
+       },
        {
                .name   = "zero_buffers",
                .lname  = "Zero I/O buffers",