Rename rate_poisson to rate_process
authorJens Axboe <axboe@fb.com>
Mon, 9 Nov 2015 23:37:33 +0000 (16:37 -0700)
committerJens Axboe <axboe@fb.com>
Mon, 9 Nov 2015 23:37:33 +0000 (16:37 -0700)
This will more accurately follow what other options could adopt,
for instance if we want to do a dynamic IO depth.

Signed-off-by: Jens Axboe <axboe@fb.com>
HOWTO
backend.c
cconv.c
examples/poisson-rate-submission.fio
fio.1
fio.h
options.c
thread_options.h

diff --git a/HOWTO b/HOWTO
index 2742fd7994ec9e148975b1ee62a827b4a4d31a5f..e259aa7f07c26f0335d71c025fe7498946823020 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -1064,11 +1064,13 @@ rate_iops_min=int If fio doesn't meet this rate of IO, it will cause
                the job to exit. The same format as rate is used for read vs
                write separation.
 
-rate_poisson=bool      Real world random request flow follows Poisson process
-               (https://en.wikipedia.org/wiki/Poisson_process). With
-               rate_poisson=1, fio tries to simulate request flow under Poisson
-               process (instead of even distribution, which is the default).
-               Default: false.
+rate_process=str       This option controls how fio manages rated IO
+               submissions. The default is 'linear', which submits IO in a
+               linear fashion with fixed delays between IOs that gets
+               adjusted based on IO completion rates. If this is set to
+               'poisson', fio will submit IO based on a more real world
+               random request flow, known as the Poisson process
+               (https://en.wikipedia.org/wiki/Poisson_process).
 
 latency_target=int     If set, fio will attempt to find the max performance
                point that the given workload will run at while maintaining a
index b329fa31f62dc929a5bb7c5796b27a2dd03d1cd2..aa94acf2499808e4543922f26ea83d21ebff06d4 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -782,7 +782,7 @@ static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)
        bytes = td->rate_io_issue_bytes[ddir];
        bps = td->rate_bps[ddir];
 
-       if (td->o.poisson_rate) {
+       if (td->o.rate_process == RATE_PROCESS_POISSON) {
                uint64_t val;
                iops = bps / td->o.bs[ddir];
                val = (int64_t) (1000000 / iops) *
diff --git a/cconv.c b/cconv.c
index 26b90b93611342b3de8e2cfc5cb635ad19a8389f..c309578cd06a9bf27700468c5866b52069060a16 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -254,7 +254,7 @@ void convert_thread_options_to_cpu(struct thread_options *o,
        o->per_job_logs = le32_to_cpu(top->per_job_logs);
 
        o->trim_backlog = le64_to_cpu(top->trim_backlog);
-       o->poisson_rate = le32_to_cpu(top->poisson_rate);
+       o->rate_process = le32_to_cpu(top->rate_process);
 
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
                o->percentile_list[i].u.f = fio_uint64_to_double(le64_to_cpu(top->percentile_list[i].u.i));
@@ -475,7 +475,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
        top->trim_backlog = __cpu_to_le64(o->trim_backlog);
        top->offset_increment = __cpu_to_le64(o->offset_increment);
        top->number_ios = __cpu_to_le64(o->number_ios);
-       top->poisson_rate = cpu_to_le32(o->poisson_rate);
+       top->rate_process = cpu_to_le32(o->rate_process);
 
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
                top->percentile_list[i].u.i = __cpu_to_le64(fio_double_to_uint64(o->percentile_list[i].u.f));
index 6a94df8a3b22010d145f4b3fb500065af3f84c3f..4bb28f219a2b1ad9c918bf1f02f67f8038c84ae4 100644 (file)
@@ -11,4 +11,4 @@ rate_iops=50
 # Real world random request flow follows Poisson process. To give better
 # insight on latency distribution, we simulate request flow under Poisson
 # process.
-rate_poisson=1
\ No newline at end of file
+rate_process=poisson
diff --git a/fio.1 b/fio.1
index 1b4c866947c05234c9126b3a8833acac7956015f..6f72ec0f910a6d12bc6cc6f949b765d5f4988b38 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -963,11 +963,13 @@ size is used as the metric.
 If this rate of I/O is not met, the job will exit. The same format as \fBrate\fR
 is used for read vs write separation.
 .TP
-.BI rate_poisson \fR=\fPbool
-Real world random request flow follows Poisson process
-(https://en.wikipedia.org/wiki/Poisson_process). With \fBrate_poisson\fR=1, fio
-tries to simulate request flow under Poisson process (instead of even
-distribution, which is the default). Default: false.
+.BI rate_process \fR=\fPstr
+This option controls how fio manages rated IO submissions. The default is
+\fBlinear\fR, which submits IO in a linear fashion with fixed delays between
+IOs that gets adjusted based on IO completion rates. If this is set to
+\fBpoisson\fR, fio will submit IO based on a more real world random request
+flow, known as the Poisson process
+(https://en.wikipedia.org/wiki/Poisson_process).
 .TP
 .BI rate_cycle \fR=\fPint
 Average bandwidth for \fBrate\fR and \fBrate_min\fR over this number of
diff --git a/fio.h b/fio.h
index 7b198b216411b81043e761e4fa444c09dfb5f012..a2b3d9ffbb3da3de952a8f0970cf36815a43e11c 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -101,7 +101,10 @@ enum {
 
 enum {
        IO_MODE_INLINE = 0,
-       IO_MODE_OFFLOAD,
+       IO_MODE_OFFLOAD = 1,
+
+       RATE_PROCESS_LINEAR = 0,
+       RATE_PROCESS_POISSON = 1,
 };
 
 /*
index 7f663bb8ffbe880c2e67bc0c8c021e1f8a52e784..a61606c6654e2244056209eb847975af74754383 100644 (file)
--- a/options.c
+++ b/options.c
@@ -2857,16 +2857,26 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .group  = FIO_OPT_G_RATE,
        },
        {
-               .name   = "rate_poisson",
-               .lname  = "simulate requests under Poisson process",
-               .type   = FIO_OPT_BOOL,
-               .off1   = td_var_offset(poisson_rate),
-               .help   = "With rate limit, simulate requests that follow Poisson process",
-               .def    = "0",
-               .parent = "rate",
-               .hide   = 1,
+               .name   = "rate_process",
+               .lname  = "Rate Process",
+               .type   = FIO_OPT_STR,
+               .off1   = td_var_offset(rate_process),
+               .help   = "What process controls how rated IO is managed",
+               .def    = "linear",
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_RATE,
+               .posval = {
+                         { .ival = "linear",
+                           .oval = RATE_PROCESS_LINEAR,
+                           .help = "Linear rate of IO",
+                         },
+                         {
+                           .ival = "poisson",
+                           .oval = RATE_PROCESS_POISSON,
+                           .help = "Rate follows Poisson process",
+                         },
+               },
+               .parent = "rate",
        },
        {
                .name   = "rate_cycle",
index 067079444b7854ba5570bf9e818d55f06a984933..567df819a85ee6d02fe6089599fe7b1227d0b35f 100644 (file)
@@ -231,7 +231,7 @@ struct thread_options {
        unsigned int io_submit_mode;
        unsigned int rate_iops[DDIR_RWDIR_CNT];
        unsigned int rate_iops_min[DDIR_RWDIR_CNT];
-       unsigned int poisson_rate;
+       unsigned int rate_process;
 
        char *ioscheduler;
 
@@ -472,7 +472,7 @@ struct thread_options_pack {
        uint32_t io_submit_mode;
        uint32_t rate_iops[DDIR_RWDIR_CNT];
        uint32_t rate_iops_min[DDIR_RWDIR_CNT];
-       uint32_t poisson_rate;
+       uint32_t rate_process;
        uint32_t padding_0;   /* for alignment assert */
 
        uint8_t ioscheduler[FIO_TOP_STR_MAX];