Recent changes (master)
The following changes since commit a967e54d34afe3bb10cd521d78bcaea2dd8c7cdc:
stat: Fix ioprio print (2023-03-15 19:18:47 -0400)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to 51bbb1a120c96ae7b93d058c7ce418962b202515:
docs: clean up steadystate options (2023-03-20 13:57:47 -0400)
----------------------------------------------------------------
Christian Loehle (1):
fio: steadystate: allow for custom check interval
Vincent Fu (3):
steadystate: fix slope calculation for variable check intervals
steadystate: add some TODO items
docs: clean up steadystate options
HOWTO.rst | 17 +++++++++--- STEADYSTATE-TODO | 10 ++++++- cconv.c | 2 ++ fio.1 | 13 +++++++-- helper_thread.c | 2 +- init.c | 19 +++++++++++++ options.c | 14 ++++++++++ stat.c | 7 +++-- steadystate.c | 74 ++++++++++++++++++++++++++++++-------------------- steadystate.h | 3 +- t/steadystate_tests.py | 1 + thread_options.h | 2 ++ 12 files changed, 120 insertions(+), 44 deletions(-)
---
Diff of recent changes:
HOWTO.rst +13 -4
@@ -3821,10 +3821,11 @@ Steady state .. option:: steadystate_duration=time, ss_dur=time - A rolling window of this duration will be used to judge whether steady state - has been reached. Data will be collected once per second. The default is 0 - which disables steady state detection. When the unit is omitted, the - value is interpreted in seconds. + A rolling window of this duration will be used to judge whether steady + state has been reached. Data will be collected every + :option:`ss_interval`. The default is 0 which disables steady state + detection. When the unit is omitted, the value is interpreted in + seconds. .. option:: steadystate_ramp_time=time, ss_ramp=time
@@ -3832,6 +3833,14 @@ Steady state collection for checking the steady state job termination criterion. The default is 0. When the unit is omitted, the value is interpreted in seconds. +.. option:: steadystate_check_interval=time, ss_interval=time + + The values during the rolling window will be collected with a period of + this value. If :option:`ss_interval` is 30s and :option:`ss_dur` is + 300s, 10 measurements will be taken. Default is 1s but that might not + converge, especially for slower devices, so set this accordingly. When + the unit is omitted, the value is interpreted in seconds. + Measurements and reporting ~~~~~~~~~~~~~~~~~~~~~~~~~~
STEADYSTATE-TODO +9 -1
@@ -1,6 +1,14 @@ Known issues/TODO (for steady-state) -- Allow user to specify the frequency of measurements +- Replace the test script with a better one + - Add test cases for the new check_interval option + - Parse debug=steadystate output to check calculations + +- Instead of calculating `intervals` every time, calculate it once and stash it + somewhere + +- Add the time unit to the ss_dur and check_interval variable names to reduce + possible confusion - Better documentation for output
cconv.c +2 -0
@@ -252,6 +252,7 @@ int convert_thread_options_to_cpu(struct thread_options *o, o->ss_ramp_time =le64_to_cpu (top->ss_ramp_time); o->ss_state =le32_to_cpu (top->ss_state); o->ss_limit.u.f =fio_uint64_to_double (le64_to_cpu (top->ss_limit.u.i)); + o->ss_check_interval =le64_to_cpu (top->ss_check_interval); o->zone_range =le64_to_cpu (top->zone_range); o->zone_size =le64_to_cpu (top->zone_size); o->zone_capacity =le64_to_cpu (top->zone_capacity);
@@ -614,6 +615,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->ss_ramp_time =__cpu_to_le64 (top->ss_ramp_time); top->ss_state =cpu_to_le32 (top->ss_state); top->ss_limit.u.i =__cpu_to_le64 (fio_double_to_uint64 (o->ss_limit.u.f)); + top->ss_check_interval =__cpu_to_le64 (top->ss_check_interval); top->zone_range =__cpu_to_le64 (o->zone_range); top->zone_size =__cpu_to_le64 (o->zone_size); top->zone_capacity =__cpu_to_le64 (o->zone_capacity);
fio.1 +10 -3
@@ -3532,14 +3532,21 @@ slope. Stop the job if the slope falls below the specified limit. .TP .BI steadystate_duration \fR=\fPtime "\fR,\fP ss_dur" \fR=\fPtime A rolling window of this duration will be used to judge whether steady state -has been reached. Data will be collected once per second. The default is 0 -which disables steady state detection. When the unit is omitted, the -value is interpreted in seconds. +has been reached. Data will be collected every \fBss_interval\fR. The default +is 0 which disables steady state detection. When the unit is omitted, the value +is interpreted in seconds. .TP .BI steadystate_ramp_time \fR=\fPtime "\fR,\fP ss_ramp" \fR=\fPtime Allow the job to run for the specified duration before beginning data collection for checking the steady state job termination criterion. The default is 0. When the unit is omitted, the value is interpreted in seconds. +.TP +.BI steadystate_check_interval \fR=\fPtime "\fR,\fP ss_interval" \fR=\fPtime +The values suring the rolling window will be collected with a period of this +value. If \fBss_interval\fR is 30s and \fBss_dur\fR is 300s, 10 measurements +will be taken. Default is 1s but that might not converge, especially for slower +devices, so set this accordingly. When the unit is omitted, the value is +interpreted in seconds. .SS "Measurements and reporting" .TP .BI per_job_logs \fR=\fPbool
helper_thread.c +1 -1
@@ -281,7 +281,7 @@ static void *helper_thread_main(void *data) }, { .name = "steadystate", - .interval_ms = steadystate_enabled ? STEADYSTATE_MSEC : + .interval_ms = steadystate_enabled ? ss_check_interval : 0, .func = steadystate_check, }
init.c +19 -0
@@ -981,6 +981,25 @@ static int fixup_options(struct thread_data *td) } } +for_each_td (td2) { +if (td->o.ss_check_interval != td2->o.ss_check_interval) { +log_err ("fio: conflicting ss_check_interval: %llu and %llu, must be globally equal\n" , + td->o.ss_check_interval, td2->o.ss_check_interval); + ret |=1 ; + } + }end_for_each (); +if (td->o.ss_dur && td->o.ss_check_interval /1000L <1000 ) { +log_err ("fio: ss_check_interval must be at least 1s\n" ); + ret |=1 ; + + } +if (td->o.ss_dur && (td->o.ss_dur % td->o.ss_check_interval !=0 || td->o.ss_dur <= td->o.ss_check_interval)) { +log_err ("fio: ss_duration %lluus must be multiple of ss_check_interval %lluus\n" , + td->o.ss_dur, td->o.ss_check_interval); + ret |=1 ; + } + +return ret; }
options.c +14 -0
@@ -5228,6 +5228,20 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_RUNTIME, }, + { + .name = "steadystate_check_interval", + .lname = "Steady state check interval", + .alias = "ss_interval", + .parent = "steadystate", + .type = FIO_OPT_STR_VAL_TIME, + .off1 = offsetof(struct thread_options, ss_check_interval), + .help = "Polling interval for the steady state check (too low means steadystate will not converge)", + .def = "1", + .is_seconds = 1, + .is_time = 1, + .category = FIO_OPT_C_GENERAL, + .group = FIO_OPT_G_RUNTIME, + }, { .name = NULL, },
stat.c +4 -3
@@ -1874,6 +1874,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,struct json_array *iops, *bw;int j, k, l;char ss_buf[64 ]; +int intervals = ts->ss_dur / (ss_check_interval /1000L ); snprintf(ss_buf, sizeof(ss_buf), "%s%s:%f%s", ts->ss_state & FIO_SS_IOPS ? "iops" : "bw",
@@ -1907,9 +1908,9 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,if ((ts->ss_state &FIO_SS_ATTAINED ) || !(ts->ss_state &FIO_SS_BUFFER_FULL )) j = ts->ss_head;else - j = ts->ss_head ==0 ? ts->ss_dur -1 : ts->ss_head -1 ; -for (l =0 ; l < ts->ss_dur; l++) { - k = (j + l) % ts->ss_dur; + j = ts->ss_head ==0 ? intervals -1 : ts->ss_head -1 ; +for (l =0 ; l < intervals; l++) { + k = (j + l) % intervals;json_array_add_value_int (bw, ts->ss_bw_data[k]);json_array_add_value_int (iops, ts->ss_iops_data[k]); }
steadystate.c +44 -30
213 lines not on this page · raw message
steadystate.h +1 -2
@@ -11,6 +11,7 @@ extern uint64_t steadystate_bw_mean(struct thread_stat *);extern uint64_t steadystate_iops_mean (struct thread_stat *);extern bool steadystate_enabled; +extern unsigned int ss_check_interval;struct steadystate_data {double limit;
@@ -64,6 +65,4 @@ enum { FIO_SS_BW_SLOPE = FIO_SS_BW | FIO_SS_SLOPE, }; -#define STEADYSTATE_MSEC 1000 -#endif
t/steadystate_tests.py +1 -0
@@ -115,6 +115,7 @@ if __name__ == '__main__': {'s': False, 'timeout': 20, 'numjobs': 2}, {'s': True, 'timeout': 100, 'numjobs': 3, 'ss_dur': 10, 'ss_ramp': 5, 'iops': False, 'slope': True, 'ss_limit': 0.1, 'pct': True}, {'s': True, 'timeout': 10, 'numjobs': 3, 'ss_dur': 10, 'ss_ramp': 500, 'iops': False, 'slope': True, 'ss_limit': 0.1, 'pct': True}, + {'s': True, 'timeout': 10, 'numjobs': 3, 'ss_dur': 10, 'ss_ramp': 500, 'iops': False, 'slope': True, 'ss_limit': 0.1, 'pct': True, 'ss_interval': 5}, ] jobnum = 0
thread_options.h +2 -0
@@ -211,6 +211,7 @@ struct thread_options {fio_fp64_t ss_limit;unsigned long long ss_dur;unsigned long long ss_ramp_time; +unsigned long long ss_check_interval;unsigned int overwrite;unsigned int bw_avg_time;unsigned int iops_avg_time;
@@ -533,6 +534,7 @@ struct thread_options_pack {uint64_t ss_ramp_time;uint32_t ss_state;fio_fp64_t ss_limit; +uint64_t ss_check_interval;uint32_t overwrite;uint32_t bw_avg_time;uint32_t iops_avg_time;