aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>2024-02-14 21:20:07 +0900
committerJens Axboe <axboe@kernel.dk>2024-02-14 07:39:48 -0700
commit96a7e64c8967631ac565481672209ce96df02332 (patch)
tree8897e23cea5d995250f0603bdf333191a7edea60
parenta99bd37f690ab246caa9b9d65adfa65a25967190 (diff)
downloadfio-96a7e64c8967631ac565481672209ce96df02332.tar.gz
verify: fix loops option behavior of read-verify workloads
The commit 191d6634e8a6 ("verify: fix bytes_done accounting of experimental verify") introduced td->bytes_verified to separate the verified bytes from the read bytes in td->bytes_done[]. This fixed the issue of experimental verify feature. However, it caused another issue. When the verify workload does only read and does not do write, the read bytes in td->bytes_done[] is no longer updated and always zero. This zero value is returned from do_io() to thread_main() in the bytes_done array. If the read bytes is zero, thread_main() marks the job to terminate and it makes the loops option ignored. For example, the job below should do 8k read, but it does only 4k read. [global] filename=/tmp/fio.test size=4k verify=md5 [write] rw=write do_verify=0 [read] stonewall=1 rw=read loops=2 do_verify=1 To make the loops option work together with the read-verify workloads, modify io_u_update_bytes_done(). After updating td->bytes_verified, check if the workload does not write. If so, do not return from io_u_update_bytes_done() and update td->bytes_done[] for DDIR_READ in the following code. Fixes: 191d6634e8a6 ("verify: fix bytes_done accounting of experimental verify") Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Link: https://lore.kernel.org/r/20240214122008.4123286-2-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--io_u.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io_u.c b/io_u.c
index 131878822..4254675ac 100644
--- a/io_u.c
+++ b/io_u.c
@@ -2151,7 +2151,8 @@ static void io_u_update_bytes_done(struct thread_data *td,
if (td->runstate == TD_VERIFYING) {
td->bytes_verified += icd->bytes_done[DDIR_READ];
- return;
+ if (td_write(td))
+ return;
}
for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++)