From: Vincent Fu Date: Thu, 23 Jun 2016 15:32:04 +0000 (-0400) Subject: Add locking around reads of td->io_blocks and io_byes. X-Git-Tag: fio-2.16~3^2~36 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=0587ef3261e642a444616b2d24c192f943f44d8f Add locking around reads of td->io_blocks and io_byes. This is present in add_bw/iops/lat_sample but absent from show_thread_status. Not certain if this is really necessary. --- diff --git a/steadystate.c b/steadystate.c index 1e7212f8..e0dcc22e 100644 --- a/steadystate.c +++ b/steadystate.c @@ -69,10 +69,12 @@ void steadystate_check() if (utime_since(&td->epoch, &now) >= (ss->ramp_time + 1000000L)) ss->ramp_time_over = 1; + td_io_u_lock(td); for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) { td_iops += td->io_blocks[ddir]; td_bytes += td->io_bytes[ddir]; } + td_io_u_unlock(td); rate_time = mtime_since(&ss->prev_time, &now); memcpy(&ss->prev_time, &now, sizeof(now));