Recent changes (master)
The following changes since commit e12461d7864cf99581759f5417ca60dc68fee446:
Merge branch 'master' of https://github.com/alex310110/fio (2025-12-29 13:08:16 -0700)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to 6ff32768ff322a269f87cd515ecfb218400f22bf:
Add option to specify ramp period by amount of IO (2026-01-07 14:01:53 -0500)
----------------------------------------------------------------
Jan Kara (5):
time: rename in_ramp_time() and ramp_time_over()
td: Initialize ramp_period_over based on options
eta: Use in_ramp_period() instead of opencoding it
time: Evaluate ramp up condition once per second Add option to specify ramp period by amount of IO
HOWTO.rst | 10 +++++ backend.c | 12 ++--- cconv.c | 2 + eta.c | 7 ++- fio.1 | 9 ++++ fio.h | 2 +- fio_time.h | 10 ++++- helper_thread.c | 8 +++- init.c | 3 ++ io_u.c | 4 +- options.c | 10 +++++ server.h | 2 +- stat.c | 2 +- thread_options.h | 2 + time.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++--------- 15 files changed, 175 insertions(+), 39 deletions(-)
---
Diff of recent changes:
HOWTO.rst +10 -0
@@ -715,6 +715,16 @@ Time related parameters :option:`runtime` is specified. When the unit is omitted, the value is given in seconds. +.. option:: ramp_size=size + + If set, fio will wait until the job does given amount of IO before + logging any performance numbers. When ``group_reporting`` is enabled, + the logging starts when all jobs in the group together perform given + amount of IO. Similarly to ``ramp_time`` this is useful for letting + performance to settle before logging results and will increase the total + runtime if a special timeout or :option:`runtime` is specified. When + the unit is omitted, the value is given in bytes. + .. option:: clocksource=str Use the given clocksource as the base of timing. The supported options are:
backend.c +6 -6
@@ -298,7 +298,7 @@ static inline void update_ts_cache(struct thread_data *td)static inline bool runtime_exceeded (struct thread_data *td,struct timespec *t) { -if (in_ramp_time (td)) +if (in_ramp_period (td))return false;if (!td->o.timeout)return false;
@@ -1031,7 +1031,7 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)for (i =0 ; i <DDIR_RWDIR_CNT ; i++) bytes_done[i] = td->bytes_done[i]; -if (in_ramp_time (td)) +if (in_ramp_period (td))td_set_runstate (td,TD_RAMP );else td_set_runstate (td,TD_RUNNING );
@@ -1162,7 +1162,7 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)else io_u->end_io = verify_io_u;td_set_runstate (td,TD_VERIFYING ); - }else if (in_ramp_time (td)) + }else if (in_ramp_period (td))td_set_runstate (td,TD_RAMP );else td_set_runstate (td,TD_RUNNING );
@@ -1232,7 +1232,7 @@ reap: !td_ioengine_flagged(td, FIO_NOIO))continue ; -if (!in_ramp_time (td) &&should_check_rate (td)) { +if (!in_ramp_period (td) &&should_check_rate (td)) {if (check_min_rate (td, &comp_time)) {if (exitall_on_terminate || td->o.exitall_error)fio_terminate_threads (td->groupid, td->o.exit_what);
@@ -1240,7 +1240,7 @@ reap:break ; } } -if (!in_ramp_time (td) && td->o.latency_target) +if (!in_ramp_period (td) && td->o.latency_target)lat_target_check (td); }
@@ -2673,7 +2673,7 @@ reap:if (td->runstate !=TD_INITIALIZED )continue ; -if (in_ramp_time (td)) +if (in_ramp_period (td))td_set_runstate (td,TD_RAMP );else td_set_runstate (td,TD_RUNNING );
cconv.c +2 -0
@@ -258,6 +258,7 @@ int convert_thread_options_to_cpu(struct thread_options *o, o->start_delay_high =le64_to_cpu (top->start_delay_high); o->timeout =le64_to_cpu (top->timeout); o->ramp_time =le64_to_cpu (top->ramp_time); + o->ramp_size =le64_to_cpu (top->ramp_size); o->ss_dur =le64_to_cpu (top->ss_dur); o->ss_ramp_time =le64_to_cpu (top->ss_ramp_time); o->ss_state =le32_to_cpu (top->ss_state);
@@ -636,6 +637,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->start_delay_high =__cpu_to_le64 (o->start_delay_high); top->timeout =__cpu_to_le64 (o->timeout); top->ramp_time =__cpu_to_le64 (o->ramp_time); + top->ramp_size =__cpu_to_le64 (o->ramp_size); top->ss_dur =__cpu_to_le64 (top->ss_dur); top->ss_ramp_time =__cpu_to_le64 (top->ss_ramp_time); top->ss_state =cpu_to_le32 (top->ss_state);
eta.c +3 -4
@@ -274,12 +274,11 @@ static unsigned long thread_eta(struct thread_data *td)uint64_t ramp_time = td->o.ramp_time; t_eta = __timeout + start_delay; -if (!td->ramp_time_over) { +if (in_ramp_period (td)) t_eta += ramp_time; - } t_eta /=1000000ULL ; -if ((td->runstate ==TD_RAMP ) &&in_ramp_time (td)) { +if ((td->runstate ==TD_RAMP ) &&in_ramp_period (td)) {unsigned long ramp_left; ramp_left =mtime_since_now (&td->epoch);
@@ -522,7 +521,7 @@ static bool calc_thread_status(struct jobs_eta *je, int force) any_td_in_ramp = false;for_each_td (td) { - any_td_in_ramp |=in_ramp_time (td); + any_td_in_ramp |=in_ramp_period (td); }end_for_each ();if (write_bw_log && rate_time > bw_avg_time && !any_td_in_ramp) { calc_rate(unified_rw_rep, rate_time, io_bytes, rate_io_bytes,
fio.1 +9 -0
@@ -497,6 +497,15 @@ thus it will increase the total runtime if a special timeout or \fBruntime\fR is specified. When the unit is omitted, the value is given in seconds. .TP +.BI ramp_size \fR=\fPsize +If set, fio will wait until the job does given amount of IO before +logging any performance numbers. When \fBgroup_reporting\fR is enabled, +the logging starts when all jobs in the group together perform given +amount of IO. Similarly to \fBramp_time\fR this is useful for letting +performance to settle before logging results and will increase the total +runtime if a special timeout or \fBruntime\fR is specified. When +the unit is omitted, the value is given in bytes. +.TP .BI clocksource \fR=\fPstr Use the given clocksource as the base of timing. The supported options are: .RS
fio.h +1 -1
@@ -417,7 +417,7 @@ struct thread_data {struct timespec terminate_time;unsigned int ts_cache_nr;unsigned int ts_cache_mask; -bool ramp_time_over; +unsigned int ramp_period_state;/* * Time since last latency_window was started
fio_time.h +8 -2
@@ -8,6 +8,10 @@/* IWYU pragma: end_exports */ #include "lib/types.h" +#define RAMP_PERIOD_CHECK_MSEC 1000 + +extern bool ramp_period_enabled; +struct thread_data ;extern uint64_t ntime_since (const struct timespec *,const struct timespec *);extern uint64_t ntime_since_now (const struct timespec *);
@@ -27,8 +31,10 @@ extern uint64_t usec_spin(unsigned int);extern uint64_t usec_sleep (struct thread_data *,unsigned long );extern void fill_start_time (struct timespec *);extern void set_genesis_time (void ); -extern bool ramp_time_over (struct thread_data *); -extern bool in_ramp_time (struct thread_data *); +extern int ramp_period_check (void ); +extern bool ramp_period_over (struct thread_data *); +extern bool in_ramp_period (struct thread_data *); +extern int td_ramp_period_init (struct thread_data *);extern void fio_time_init (void );extern void timespec_add_msec (struct timespec *,unsigned int );extern void set_epoch_time (struct thread_data *,clockid_t ,clockid_t );
helper_thread.c +7 -1
@@ -290,7 +290,13 @@ static void *helper_thread_main(void *data) .interval_ms = steadystate_enabled ? ss_check_interval : 0, .func = steadystate_check, - } + }, + { + .name = "ramp_period", + .interval_ms = ramp_period_enabled ? + RAMP_PERIOD_CHECK_MSEC : 0, + .func = ramp_period_check, + }, };struct timespec ts;long clk_tck;
init.c +3 -0
@@ -1703,6 +1703,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,if (setup_rate (td)) goto err; +if (td_ramp_period_init (td)) + goto err; +if (o->write_lat_log) {struct log_params p = { .td = td,
io_u.c +2 -2
@@ -2106,7 +2106,7 @@ static void file_log_write_comp(const struct thread_data *td, struct fio_file *fstatic bool should_account (struct thread_data *td) { -return ramp_time_over (td) && (td->runstate ==TD_RUNNING || +return ramp_period_over (td) && (td->runstate ==TD_RUNNING || td->runstate ==TD_VERIFYING ); }
@@ -2333,7 +2333,7 @@ int io_u_queued_complete(struct thread_data *td, int min_evts)*/ void io_u_queued (struct thread_data *td,struct io_u *io_u) { -if (!td->o.disable_slat &&ramp_time_over (td) && td->o.stats) { +if (!td->o.disable_slat &&ramp_period_over (td) && td->o.stats) {if (td->parent) td = td->parent;add_slat_sample (td, io_u);
options.c +10 -0
@@ -3114,6 +3114,16 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_RUNTIME, }, + { + .name = "ramp_size", + .lname = "Ramp size", + .type = FIO_OPT_STR_VAL, + .off1 = offsetof(struct thread_options, ramp_size), + .minval = 1, + .help = "Amount of data transferred before measuring performance", + .category = FIO_OPT_C_GENERAL, + .group = FIO_OPT_G_RUNTIME, + }, { .name = "clocksource", .lname = "Clock source",
server.h +1 -1
@@ -51,7 +51,7 @@ struct fio_net_cmd_reply { };enum { -FIO_SERVER_VER =115 , +FIO_SERVER_VER =116 ,FIO_SERVER_MAX_FRAGMENT_PDU =1024 ,FIO_SERVER_MAX_CMD_MB =2048 ,
stat.c +1 -1
@@ -3657,7 +3657,7 @@ static int add_iops_samples(struct thread_data *td, struct timespec *t)static bool td_in_logging_state (struct thread_data *td) { -if (in_ramp_time (td)) +if (in_ramp_period (td))return false;switch (td->runstate) {
thread_options.h +2 -0
@@ -212,6 +212,7 @@ struct thread_options {unsigned long long start_delay_high;unsigned long long timeout;unsigned long long ramp_time; +unsigned long long ramp_size;unsigned int ss_state;fio_fp64_t ss_limit;unsigned long long ss_dur;
@@ -546,6 +547,7 @@ struct thread_options_pack {uint64_t start_delay_high;uint64_t timeout;uint64_t ramp_time; +uint64_t ramp_size;uint64_t ss_dur;uint64_t ss_ramp_time;uint32_t ss_state;
time.c +110 -21
163 lines not on this page · raw message