X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=956ff5f0a48b5a98699b43704788697cdf5f0487;hp=4fe1dce8b9b8a306ff30e8afcdf9f88a6ec06474;hb=faf5c880f6ddcd44ff896ba1cf3da38b23fe0f39;hpb=16edf25dba269ee9e8239130e75b690440b1e120 diff --git a/init.c b/init.c index 4fe1dce8..956ff5f0 100644 --- a/init.c +++ b/init.c @@ -81,7 +81,7 @@ static struct fio_option options[] = { .help = "IO engine to use", .def = "sync", .posval = { "sync", "libaio", "posixaio", "mmap", "splice", - "sg", "null", "net", }, + "sg", "null", "net", "syslet-rw" }, }, { .name = "iodepth", @@ -90,6 +90,12 @@ static struct fio_option options[] = { .help = "Amount of IO buffers to keep in flight", .def = "1", }, + { + .name = "iodepth_low", + .type = FIO_OPT_INT, + .off1 = td_var_offset(iodepth_low), + .help = "Low water mark for queuing depth", + }, { .name = "size", .type = FIO_OPT_STR_VAL, @@ -330,6 +336,13 @@ static struct fio_option options[] = { .help = "Idle time between IO buffers (usec)", .def = "0", }, + { + .name = "thinktime_spin", + .type = FIO_OPT_INT, + .off1 = td_var_offset(thinktime_spin), + .help = "Start thinktime by spinning this amount (usec)", + .def = "0", + }, { .name = "thinktime_blocks", .type = FIO_OPT_INT, @@ -631,6 +644,18 @@ static void fixup_options(struct thread_data *td) */ if (td->filetype == FIO_TYPE_CHAR && td->odirect) td->odirect = 0; + + /* + * thinktime_spin must be less than thinktime + */ + if (td->thinktime_spin > td->thinktime) + td->thinktime_spin = td->thinktime; + + /* + * The low water mark cannot be bigger than the iodepth + */ + if (td->iodepth_low > td->iodepth || !td->iodepth_low) + td->iodepth_low = td->iodepth; } /* @@ -639,7 +664,7 @@ static void fixup_options(struct thread_data *td) static char *to_kmg(unsigned int val) { char *buf = malloc(32); - char post[] = { 0, 'K', 'M', 'G', 'P', 0 }; + char post[] = { 0, 'K', 'M', 'G', 'P', 'E', 0 }; char *p = post; do { @@ -679,7 +704,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) td->io_ops->flags |= FIO_RAWIO; td->filetype = FIO_TYPE_FILE; - if (!stat(jobname, &sb)) { + if (td->filename && !lstat(td->filename, &sb)) { if (S_ISBLK(sb.st_mode)) td->filetype = FIO_TYPE_BD; else if (S_ISCHR(sb.st_mode)) @@ -739,9 +764,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) fio_sem_init(&td->mutex, 0); - td->clat_stat[0].min_val = td->clat_stat[1].min_val = ULONG_MAX; - td->slat_stat[0].min_val = td->slat_stat[1].min_val = ULONG_MAX; - td->bw_stat[0].min_val = td->bw_stat[1].min_val = ULONG_MAX; + td->ts.clat_stat[0].min_val = td->ts.clat_stat[1].min_val = ULONG_MAX; + td->ts.slat_stat[0].min_val = td->ts.slat_stat[1].min_val = ULONG_MAX; + td->ts.bw_stat[0].min_val = td->ts.bw_stat[1].min_val = ULONG_MAX; if (td->stonewall && td->thread_number > 1) groupid++; @@ -752,11 +777,11 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) goto err; if (td->write_lat_log) { - setup_log(&td->slat_log); - setup_log(&td->clat_log); + setup_log(&td->ts.slat_log); + setup_log(&td->ts.clat_log); } if (td->write_bw_log) - setup_log(&td->bw_log); + setup_log(&td->ts.bw_log); if (!td->name) td->name = strdup(jobname); @@ -845,11 +870,11 @@ int init_random_state(struct thread_data *td) return 0; if (td->rand_repeatable) - seeds[3] = FIO_RANDSEED; + seeds[3] = FIO_RANDSEED * td->thread_number; if (!td->norandommap) { for_each_file(td, f, i) { - blocks = (f->file_size + td->rw_min_bs - 1) / td->rw_min_bs; + blocks = (f->real_file_size + td->rw_min_bs - 1) / td->rw_min_bs; num_maps = (blocks + BLOCKS_PER_MAP-1)/ BLOCKS_PER_MAP; f->file_map = malloc(num_maps * sizeof(long)); f->num_maps = num_maps; @@ -882,6 +907,8 @@ static int is_empty_or_comment(char *line) for (i = 0; i < strlen(line); i++) { if (line[i] == ';') return 1; + if (line[i] == '#') + return 1; if (!isspace(line[i]) && !iscntrl(line[i])) return 0; }