X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=27e36bb0ae23e9cb1cf32c5c2840429edf6ebd5d;hp=ac71521e94fc4420714823aab73c45a924e0432d;hb=589d5d4fa38318111a68f8588a919a628548fe01;hpb=6be06c46544c19e513ff80e7b841b1de688ffc66 diff --git a/backend.c b/backend.c index ac71521e..27e36bb0 100644 --- a/backend.c +++ b/backend.c @@ -76,9 +76,6 @@ int shm_id = 0; int temp_stall_ts; unsigned long done_secs = 0; -#define PAGE_ALIGN(buf) \ - (char *) (((uintptr_t) (buf) + page_mask) & ~page_mask) - #define JOB_START_TIMEOUT (5 * 1000) static void sig_int(int sig) @@ -180,8 +177,8 @@ static bool __check_min_rate(struct thread_data *td, struct timeval *now, * check bandwidth specified rate */ if (bytes < td->rate_bytes[ddir]) { - log_err("%s: min rate %u not met\n", td->o.name, - ratemin); + log_err("%s: rate_min=%uB/s not met, only transferred %lluB\n", + td->o.name, ratemin, bytes); return true; } else { if (spent) @@ -191,9 +188,8 @@ static bool __check_min_rate(struct thread_data *td, struct timeval *now, if (rate < ratemin || bytes < td->rate_bytes[ddir]) { - log_err("%s: min rate %u not met, got" - " %luKB/sec\n", td->o.name, - ratemin, rate); + log_err("%s: rate_min=%uB/s not met, got %luB/s\n", + td->o.name, ratemin, rate); return true; } } @@ -202,8 +198,8 @@ static bool __check_min_rate(struct thread_data *td, struct timeval *now, * checks iops specified rate */ if (iops < rate_iops) { - log_err("%s: min iops rate %u not met\n", - td->o.name, rate_iops); + log_err("%s: rate_iops_min=%u not met, only performed %lu IOs\n", + td->o.name, rate_iops, iops); return true; } else { if (spent) @@ -213,9 +209,8 @@ static bool __check_min_rate(struct thread_data *td, struct timeval *now, if (rate < rate_iops_min || iops < td->rate_blocks[ddir]) { - log_err("%s: min iops rate %u not met," - " got %lu\n", td->o.name, - rate_iops_min, rate); + log_err("%s: rate_iops_min=%u not met, got %lu IOPS\n", + td->o.name, rate_iops_min, rate); return true; } } @@ -1200,7 +1195,7 @@ static int init_io_u(struct thread_data *td) if (td->o.odirect || td->o.mem_align || td->o.oatomic || td_ioengine_flagged(td, FIO_RAWIO)) - p = PAGE_ALIGN(td->orig_buffer) + td->o.mem_align; + p = PTR_ALIGN(td->orig_buffer, page_mask) + td->o.mem_align; else p = td->orig_buffer; @@ -1364,7 +1359,7 @@ static bool keep_running(struct thread_data *td) uint64_t diff; /* - * If the difference is less than the minimum IO size, we + * If the difference is less than the maximum IO size, we * are done. */ diff = limit - ddir_rw_sum(td->io_bytes); @@ -1665,6 +1660,7 @@ static void *thread_main(void *data) fio_getrusage(&td->ru_start); memcpy(&td->bw_sample_time, &td->epoch, sizeof(td->epoch)); memcpy(&td->iops_sample_time, &td->epoch, sizeof(td->epoch)); + memcpy(&td->ss.prev_time, &td->epoch, sizeof(td->epoch)); if (o->ratemin[DDIR_READ] || o->ratemin[DDIR_WRITE] || o->ratemin[DDIR_TRIM]) { @@ -2056,7 +2052,7 @@ static bool check_mount_writes(struct thread_data *td) return false; for_each_file(td, f, i) { - if (f->filetype != FIO_TYPE_BD) + if (f->filetype != FIO_TYPE_BLOCK) continue; if (device_is_mounted(f->file_name)) goto mounted; @@ -2064,7 +2060,7 @@ static bool check_mount_writes(struct thread_data *td) return false; mounted: - log_err("fio: %s appears mounted, and 'allow_mounted_write' isn't set. Aborting.", f->file_name); + log_err("fio: %s appears mounted, and 'allow_mounted_write' isn't set. Aborting.\n", f->file_name); return true; } @@ -2415,6 +2411,12 @@ int fio_backend(struct sk_out *sk_out) } for_each_td(td, i) { + if (td->ss.dur) { + if (td->ss.iops_data != NULL) { + free(td->ss.iops_data); + free(td->ss.bw_data); + } + } fio_options_free(td); if (td->rusage_sem) { fio_mutex_remove(td->rusage_sem);