The following changes since commit d1ece0c725b4643bcc0187e99b29e7886fc9705a: Fix batch mismatch for verifies (2012-03-07 09:32:58 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (4): Compression buffer fill fix Honor refill_buffers even for verifies Add buffer_compress_chunk option Mark buffer_compress_chunk as child of buffer_compress_percentage fio.h | 1 + io_u.c | 13 +++++++++---- lib/rand.c | 2 ++ options.c | 7 +++++++ 4 files changed, 19 insertions(+), 4 deletions(-) --- Diff of recent changes: diff --git a/fio.h b/fio.h index 7443bc0..4afdd2d 100644 --- a/fio.h +++ b/fio.h @@ -195,6 +195,7 @@ struct thread_options { unsigned int refill_buffers; unsigned int scramble_buffers; unsigned int compress_percentage; + unsigned int compress_chunk; unsigned int time_based; unsigned int disable_lat; unsigned int disable_clat; diff --git a/io_u.c b/io_u.c index 06ca711..a0020d2 100644 --- a/io_u.c +++ b/io_u.c @@ -1226,13 +1226,15 @@ struct io_u *get_io_u(struct thread_data *td) f->last_pos = io_u->offset + io_u->buflen; if (io_u->ddir == DDIR_WRITE) { - if (td->o.verify != VERIFY_NONE) - populate_verify_io_u(td, io_u); - else if (td->o.refill_buffers) { + if (td->o.refill_buffers) { io_u_fill_buffer(td, io_u, io_u->xfer_buflen, io_u->xfer_buflen); } else if (td->o.scramble_buffers) do_scramble = 1; + if (td->o.verify != VERIFY_NONE) { + populate_verify_io_u(td, io_u); + do_scramble = 0; + } } else if (io_u->ddir == DDIR_READ) { /* * Reset the buf_filled parameters so next time if the @@ -1542,8 +1544,11 @@ void io_u_fill_buffer(struct thread_data *td, struct io_u *io_u, unsigned int perc = td->o.compress_percentage; if (perc) { + unsigned int seg = min_write; + + seg = min(min_write, td->o.compress_chunk); fill_random_buf_percentage(&td->buf_state, io_u->buf, - perc, min_write, max_bs); + perc, seg, max_bs); } else fill_random_buf(&td->buf_state, io_u->buf, max_bs); } else diff --git a/lib/rand.c b/lib/rand.c index 995035f..a79fb9c 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -125,6 +125,8 @@ unsigned long fill_random_buf_percentage(struct frand_state *fs, void *buf, this_len = len; memset(buf, 0, this_len); + len -= this_len; + buf += this_len; } return r; diff --git a/options.c b/options.c index 8034cd7..463b66d 100644 --- a/options.c +++ b/options.c @@ -2022,6 +2022,13 @@ static struct fio_option options[FIO_MAX_OPTS] = { .help = "How compressible the buffer is (approximately)", }, { + .name = "buffer_compress_chunk", + .type = FIO_OPT_INT, + .off1 = td_var_offset(compress_chunk), + .parent = "buffer_compress_percentage", + .help = "Size of compressible region in buffer", + }, + { .name = "clat_percentiles", .type = FIO_OPT_BOOL, .off1 = td_var_offset(clat_percentiles), -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html