From 0587ef3261e642a444616b2d24c192f943f44d8f Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Thu, 23 Jun 2016 11:32:04 -0400 Subject: [PATCH] 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. --- steadystate.c | 2 ++ 1 file changed, 2 insertions(+) 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)); -- 2.25.1