The following changes since commit 836bad52fff2a882e857a52ba94ac0eae6222587: Fix inconsistencies in with man page <param>=<value> (2011-09-14 09:27:53 +0200) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (3): Fio 1.58 Scramble default write buffer contents slightly Scramble on a 512b boundary Zheng Liu (1): Fix sum_stat() bug in group_reporting init.c | 2 +- io_u.c | 38 ++++++++++++++++++++++++++++++++++++++ os/windows/install.wxs | 2 +- os/windows/version.h | 4 ++-- stat.c | 3 +++ 5 files changed, 45 insertions(+), 4 deletions(-) --- Diff of recent changes: diff --git a/init.c b/init.c index f55e5d7..62c070e 100644 --- a/init.c +++ b/init.c @@ -22,7 +22,7 @@ #include "lib/getopt.h" -static char fio_version_string[] = "fio 1.57"; +static char fio_version_string[] = "fio 1.58"; #define FIO_RANDSEED (0xb1899bedUL) diff --git a/io_u.c b/io_u.c index a87c58e..f4c4aa2 100644 --- a/io_u.c +++ b/io_u.c @@ -1121,6 +1121,39 @@ static int check_get_verify(struct thread_data *td, struct io_u *io_u) } /* + * Fill offset and start time into the buffer content, to prevent too + * easy compressible data for simple de-dupe attempts. Do this for every + * 512b block in the range, since that should be the smallest block size + * we can expect from a device. + */ +static void small_content_scramble(struct io_u *io_u) +{ + unsigned int i, nr_blocks = io_u->buflen / 512; + unsigned int offset; + void *p, *end; + + if (!nr_blocks) + return; + + p = io_u->xfer_buf; + for (i = 0; i < nr_blocks; i++) { + /* + * Fill the byte offset into a "random" start offset of + * the buffer, given by the product of the usec time + * and the actual offset. + */ + offset = (io_u->start_time.tv_usec * io_u->offset) & 511; + if (offset >= 512 - sizeof(unsigned long long)) + offset -= sizeof(unsigned long long); + *((unsigned long long *) p + offset) = io_u->offset; + + end = p + 512 - sizeof(io_u->start_time); + memcpy(end, &io_u->start_time, sizeof(io_u->start_time)); + p += 512; + } +} + +/* * Return an io_u to be processed. Gets a buflen and offset, sets direction, * etc. The returned io_u is fully ready to be prepped and submitted. */ @@ -1128,6 +1161,7 @@ struct io_u *get_io_u(struct thread_data *td) { struct fio_file *f; struct io_u *io_u; + int do_scramble = 0; io_u = __get_io_u(td); if (!io_u) { @@ -1173,6 +1207,8 @@ struct io_u *get_io_u(struct thread_data *td) 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); + else if (io_u->ddir == DDIR_WRITE) + do_scramble = 1; else if (io_u->ddir == DDIR_READ) { /* * Reset the buf_filled parameters so next time if the @@ -1193,6 +1229,8 @@ out: if (!td_io_prep(td, io_u)) { if (!td->o.disable_slat) fio_gettime(&io_u->start_time, NULL); + if (do_scramble) + small_content_scramble(io_u); return io_u; } err_put: diff --git a/os/windows/install.wxs b/os/windows/install.wxs index a6e1642..708819d 100755 --- a/os/windows/install.wxs +++ b/os/windows/install.wxs @@ -2,7 +2,7 @@ <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <?define VersionMajor = 1?> -<?define VersionMinor = 57?> +<?define VersionMinor = 58?> <?define VersionBuild = 0?> <Product Id="*" diff --git a/os/windows/version.h b/os/windows/version.h index 0e6cea9..e2c95f5 100644 --- a/os/windows/version.h +++ b/os/windows/version.h @@ -1,4 +1,4 @@ #define FIO_VERSION_MAJOR 1 -#define FIO_VERSION_MINOR 57 +#define FIO_VERSION_MINOR 58 #define FIO_VERSION_BUILD 0 -#define FIO_VERSION_STRING "1.57" +#define FIO_VERSION_STRING "1.58" diff --git a/stat.c b/stat.c index d2cc775..3662fd9 100644 --- a/stat.c +++ b/stat.c @@ -618,6 +618,9 @@ static void sum_stat(struct io_stat *dst, struct io_stat *src, int nr) { double mean, S; + if (src->samples == 0) + return; + dst->min_val = min(dst->min_val, src->min_val); dst->max_val = max(dst->max_val, src->max_val); -- 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