[PATCH 1/2] verify: fix loops option behavior of read-verify workloads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 io_u.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/io_u.c b/io_u.c
index 13187882..4254675a 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++)
-- 
2.43.0





[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux