From: Radha Ramachandran Date: Tue, 28 Apr 2009 06:12:56 +0000 (+0200) Subject: Don't populate random data for verify reads X-Git-Tag: fio-1.26.2~4 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c311cd2a9e3ca77f4d2cb2f6dd8bd08185e8c0f6;ds=sidebyside Don't populate random data for verify reads I was seeing some performance drop during the read verification phase of a test, and from the code in io_u.c in get_io_u function, we prepare/populate the buffer in the io_u structure based on the verify patterns/options. This makes sense when we are doing writes, but I dont understand why we do this for the read phase when this data is going to be overwritten anyways(and in case of truncated reads, we do modify the buf_len). So based on that I changed the code to populate the buffer(io_u->buf) only if its a write with verify enabled. This works for my tests, but I do not know if there was a reason why this was populated for reads as well to begin with. Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index c0beafd4..8c2f33b5 100644 --- a/io_u.c +++ b/io_u.c @@ -838,7 +838,7 @@ struct io_u *get_io_u(struct thread_data *td) f->last_pos = io_u->offset + io_u->buflen; - if (td->o.verify != VERIFY_NONE) + if (td->o.verify != VERIFY_NONE && io_u->ddir == DDIR_WRITE) populate_verify_io_u(td, io_u); else if (td->o.refill_buffers && io_u->ddir == DDIR_WRITE) io_u_fill_buffer(td, io_u, io_u->xfer_buflen);