From: Jens Axboe Date: Tue, 18 Aug 2015 17:19:50 +0000 (-0600) Subject: Merge branch 'master' of git://github.com/DaveGlen/fio X-Git-Tag: fio-2.2.10~18 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=8a78a3b7d31b7e7346115e45235108a7ffb7ec85;hp=20e37e4a63ea7edb528c8a443b738a0a67c2406e Merge branch 'master' of git://github.com/DaveGlen/fio --- diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h index d4a080c4..aed41f9b 100644 --- a/arch/arch-ppc.h +++ b/arch/arch-ppc.h @@ -33,18 +33,24 @@ #define write_barrier() __asm__ __volatile__ ("sync" : : : "memory") +#ifdef __powerpc64__ +#define PPC_CNTLZL "cntlzd" +#else +#define PPC_CNTLZL "cntlzw" +#endif + static inline int __ilog2(unsigned long bitmask) { int lz; - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (bitmask)); - return 31 - lz; + asm (PPC_CNTLZL " %0,%1" : "=r" (lz) : "r" (bitmask)); + return BITS_PER_LONG - 1 - lz; } static inline int arch_ffz(unsigned long bitmask) { if ((bitmask = ~bitmask) == 0) - return 32; + return BITS_PER_LONG; return __ilog2(bitmask & -bitmask); } diff --git a/backend.c b/backend.c index 094cf710..76994d90 100644 --- a/backend.c +++ b/backend.c @@ -951,7 +951,7 @@ reap: } if (!in_ramp_time(td) && td->o.latency_target) lat_target_check(td); - + if (td->o.thinktime) { unsigned long long b; diff --git a/client.c b/client.c index af3407ce..110a01bd 100644 --- a/client.c +++ b/client.c @@ -184,6 +184,17 @@ void fio_put_client(struct fio_client *client) free(client); } +static int fio_client_dec_jobs_eta(struct client_eta *eta, client_eta_op eta_fn) +{ + if (!--eta->pending) { + eta_fn(&eta->eta); + free(eta); + return 0; + } + + return 1; +} + static void remove_client(struct fio_client *client) { assert(client->refs); @@ -1091,14 +1102,6 @@ void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je) strcpy((char *) dst->run_str, (char *) je->run_str); } -void fio_client_dec_jobs_eta(struct client_eta *eta, client_eta_op eta_fn) -{ - if (!--eta->pending) { - eta_fn(&eta->eta); - free(eta); - } -} - static void remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd) { struct fio_net_cmd_reply *reply = NULL; @@ -1573,8 +1576,10 @@ static void request_client_etas(struct client_ops *ops) (uintptr_t) eta, &client->cmd_list); } - while (skipped--) - fio_client_dec_jobs_eta(eta, ops->eta); + while (skipped--) { + if (!fio_client_dec_jobs_eta(eta, ops->eta)) + break; + } dprint(FD_NET, "client: requested eta tag %p\n", eta); } diff --git a/client.h b/client.h index 8818de2b..cfb0b4d4 100644 --- a/client.h +++ b/client.h @@ -111,7 +111,6 @@ struct client_eta { }; extern int fio_handle_client(struct fio_client *); -extern void fio_client_dec_jobs_eta(struct client_eta *eta, client_eta_op fn); extern void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je); enum { diff --git a/configure b/configure index 4fb65e66..1a41fe58 100755 --- a/configure +++ b/configure @@ -1409,11 +1409,14 @@ echo "HDFS engine $libhdfs" # Check whether we have MTD mtd="no" cat > $TMPC << EOF +#include #include #include int main(int argc, char **argv) { + struct mtd_write_req ops; struct mtd_info_user info; + memset(&ops, 0, sizeof(ops)); info.type = MTD_MLCNANDFLASH; return ioctl(0, MEMGETINFO, &info); } diff --git a/eta.c b/eta.c index db045cb2..3e8eb0bb 100644 --- a/eta.c +++ b/eta.c @@ -590,7 +590,7 @@ struct jobs_eta *get_jobs_eta(int force, size_t *size) if (!thread_number) return NULL; - *size = sizeof(*je) + THREAD_RUNSTR_SZ; + *size = sizeof(*je) + THREAD_RUNSTR_SZ + 1; je = malloc(*size); if (!je) return NULL; diff --git a/filesetup.c b/filesetup.c index 212a126b..881aeee8 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1051,6 +1051,43 @@ static int init_rand_distribution(struct thread_data *td) return 1; } +/* + * Check if the number of blocks exceeds the randomness capability of + * the selected generator. Tausworthe is 32-bit, the others are fullly + * 64-bit capable. + */ +static int check_rand_gen_limits(struct thread_data *td, struct fio_file *f, + uint64_t blocks) +{ + if (blocks <= FRAND32_MAX) + return 0; + if (td->o.random_generator != FIO_RAND_GEN_TAUSWORTHE) + return 0; + + /* + * If the user hasn't specified a random generator, switch + * to tausworthe64 with informational warning. If the user did + * specify one, just warn. + */ + log_info("fio: file %s exceeds 32-bit tausworthe random generator.\n", + f->file_name); + + if (!fio_option_is_set(&td->o, random_generator)) { + log_info("fio: Switching to tausworthe64. Use the " + "random_generator= option to get rid of this " + " warning.\n"); + td->o.random_generator = FIO_RAND_GEN_TAUSWORTHE64; + return 0; + } + + /* + * Just make this information to avoid breaking scripts. + */ + log_info("fio: Use the random_generator= option to switch to lfsr or " + "tausworthe64.\n"); + return 0; +} + int init_random_map(struct thread_data *td) { unsigned long long blocks; @@ -1067,15 +1104,8 @@ int init_random_map(struct thread_data *td) blocks = fsize / (unsigned long long) td->o.rw_min_bs; - if (blocks > FRAND32_MAX && - td->o.random_generator == FIO_RAND_GEN_TAUSWORTHE && - !fio_option_is_set(&td->o, random_generator)) { - log_err("fio: file %s exceeds 32-bit tausworthe " - "random generator. Use lfsr or " - "tausworthe64.\n", f->file_name); - td_verror(td, EINVAL, "init file random"); + if (check_rand_gen_limits(td, f, blocks)) return 1; - } if (td->o.random_generator == FIO_RAND_GEN_LFSR) { unsigned long seed; diff --git a/gettime.c b/gettime.c index ac541113..8d99900c 100644 --- a/gettime.c +++ b/gettime.c @@ -640,6 +640,8 @@ int fio_monotonic_clocktest(int debug) qsort(entries, tentries, sizeof(struct clock_entry), clock_cmp); + /* silence silly gcc */ + prev = NULL; for (failed = i = 0; i < tentries; i++) { this = &entries[i];