X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=steadystate.c;h=2e3da1db0cfb3de21c068d6b6f3d159f71c592ad;hp=ee1c0e5b637d0512302ea96fb4e7f9263a4c5799;hb=f4bd2c3d80bc35f76892205a7e50426711e3def3;hpb=c479640d6208236744f0562b1e79535eec290e2b diff --git a/steadystate.c b/steadystate.c index ee1c0e5b..2e3da1db 100644 --- a/steadystate.c +++ b/steadystate.c @@ -196,7 +196,7 @@ static bool steadystate_deviation(uint64_t iops, uint64_t bw, return false; } -void steadystate_check(void) +int steadystate_check(void) { int i, j, ddir, prev_groupid, group_ramp_time_over = 0; unsigned long rate_time; @@ -208,6 +208,7 @@ void steadystate_check(void) prev_groupid = -1; for_each_td(td, i) { + const bool needs_lock = td_async_processing(td); struct steadystate_data *ss = &td->ss; if (!ss->dur || td->runstate <= TD_SETTING_UP || @@ -235,12 +236,16 @@ void steadystate_check(void) ss->state |= FIO_SS_RAMP_OVER; } - td_io_u_lock(td); + if (needs_lock) + __td_io_u_lock(td); + for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) { td_iops += td->io_blocks[ddir]; td_bytes += td->io_bytes[ddir]; } - td_io_u_unlock(td); + + if (needs_lock) + __td_io_u_unlock(td); rate_time = mtime_since(&ss->prev_time, &now); memcpy(&ss->prev_time, &now, sizeof(now)); @@ -297,6 +302,7 @@ void steadystate_check(void) } } } + return 0; } int td_steadystate_init(struct thread_data *td)