X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=ec1a2cace948394a6bc48c2b56a501965bac92fb;hp=e8530fec2c4da8a961692eaed7a046a357dab0e9;hb=a87ea1a869595ca57052e7645431a397d3c7d5ac;hpb=b0a711c790e099d1cf083c88ea07f1cf63838e1d diff --git a/init.c b/init.c index e8530fec..ec1a2cac 100644 --- a/init.c +++ b/init.c @@ -448,19 +448,6 @@ static void dump_opt_list(struct thread_data *td) } } -static void fio_dump_options_free(struct thread_data *td) -{ - while (!flist_empty(&td->opt_list)) { - struct print_option *p; - - p = flist_first_entry(&td->opt_list, struct print_option, list); - flist_del_init(&p->list); - free(p->name); - free(p->value); - free(p); - } -} - static void copy_opt_list(struct thread_data *dst, struct thread_data *src) { struct flist_head *entry; @@ -646,6 +633,11 @@ static int fixup_options(struct thread_data *td) ret |= 1; } + if (o->zone_mode == ZONE_MODE_ZBD && !o->create_serialize) { + log_err("fio: --zonemode=zbd and --create_serialize=0 are not compatible.\n"); + ret |= 1; + } + if (o->zone_mode == ZONE_MODE_STRIDED && !o->zone_size) { log_err("fio: --zonesize must be specified when using --zonemode=strided.\n"); ret |= 1; @@ -966,6 +958,28 @@ static int fixup_options(struct thread_data *td) o->latency_target *= 1000ULL; + /* + * Dedupe working set verifications + */ + if (o->dedupe_percentage && o->dedupe_mode == DEDUPE_MODE_WORKING_SET) { + if (!fio_option_is_set(o, size)) { + log_err("fio: pregenerated dedupe working set " + "requires size to be set\n"); + ret |= 1; + } else if (o->nr_files != 1) { + log_err("fio: dedupe working set mode supported with " + "single file per job, but %d files " + "provided\n", o->nr_files); + ret |= 1; + } else if (o->dedupe_working_set_percentage + o->dedupe_percentage > 100) { + log_err("fio: impossible to reach expected dedupe percentage %u " + "since %u percentage of size is reserved to dedupe working set " + "(those are unique pages)\n", + o->dedupe_percentage, o->dedupe_working_set_percentage); + ret |= 1; + } + } + return ret; } @@ -1039,6 +1053,7 @@ static void td_fill_rand_seeds_internal(struct thread_data *td, bool use64) init_rand_seed(&td->dedupe_state, td->rand_seeds[FIO_DEDUPE_OFF], false); init_rand_seed(&td->zone_state, td->rand_seeds[FIO_RAND_ZONE_OFF], false); init_rand_seed(&td->prio_state, td->rand_seeds[FIO_RAND_PRIO_CMDS], false); + init_rand_seed(&td->dedupe_working_set_index_state, td->rand_seeds[FIO_RAND_DEDUPE_WORKING_SET_IX], use64); if (!td_random(td)) return; @@ -1499,6 +1514,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, if (fixup_options(td)) goto err; + if (init_dedupe_working_set_seeds(td)) + goto err; + /* * Belongs to fixup_options, but o->name is not necessarily set as yet */ @@ -1565,6 +1583,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, .hist_coarseness = o->log_hist_coarseness, .log_type = IO_LOG_TYPE_LAT, .log_offset = o->log_offset, + .log_prio = o->log_prio, .log_gz = o->log_gz, .log_gz_store = o->log_gz_store, }; @@ -1598,6 +1617,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, .hist_coarseness = o->log_hist_coarseness, .log_type = IO_LOG_TYPE_HIST, .log_offset = o->log_offset, + .log_prio = o->log_prio, .log_gz = o->log_gz, .log_gz_store = o->log_gz_store, }; @@ -1629,6 +1649,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, .hist_coarseness = o->log_hist_coarseness, .log_type = IO_LOG_TYPE_BW, .log_offset = o->log_offset, + .log_prio = o->log_prio, .log_gz = o->log_gz, .log_gz_store = o->log_gz_store, }; @@ -1660,6 +1681,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, .hist_coarseness = o->log_hist_coarseness, .log_type = IO_LOG_TYPE_IOPS, .log_offset = o->log_offset, + .log_prio = o->log_prio, .log_gz = o->log_gz, .log_gz_store = o->log_gz_store, };