X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.c;h=1aba82ded2aed00396f9b76e9926000de8347f54;hp=f699951dcf58697f87922be056bfe99191e82f96;hb=fc6bd43c62196441607e6c36ec66bd0e16f9e4ef;hpb=df9c26b10275a631e83e7cc92d5f7384998b2c49 diff --git a/fio.c b/fio.c index f699951d..1aba82de 100644 --- a/fio.c +++ b/fio.c @@ -733,7 +733,7 @@ static int init_io_u(struct thread_data *td) { struct io_u *io_u; unsigned int max_bs; - int i, max_units; + int cl_align, i, max_units; char *p; max_units = td->o.iodepth; @@ -761,10 +761,20 @@ static int init_io_u(struct thread_data *td) else p = td->orig_buffer; + cl_align = os_cache_line_size(); + for (i = 0; i < max_units; i++) { + void *ptr; + if (td->terminate) return 1; - io_u = malloc(sizeof(*io_u)); + + if (posix_memalign(&ptr, cl_align, sizeof(*io_u))) { + log_err("fio: posix_memalign=%s\n", strerror(errno)); + break; + } + + io_u = ptr; memset(io_u, 0, sizeof(*io_u)); INIT_FLIST_HEAD(&io_u->list); @@ -876,6 +886,11 @@ static void reset_io_counters(struct thread_data *td) */ if (td->o.time_based || td->o.loops) td->nr_done_files = 0; + + /* + * Set the same seed to get repeatable runs + */ + td_fill_rand_seeds(td); } void reset_all_stats(struct thread_data *td)