Improve IEC binary and SI decimal prefix handling
Use kb_base=1000 to follow international standards for unit prefixes.
PATCH 1/12 Avoid using units in option defaults
From: Robert Elliott <[email protected]>
Change option defaults and some generated option strings to specify the number of bytes without units, so they are immune to the interpretation of the units (e.g. is 1M interpreted as 1048576 or 1000000).
--- options.c | 2 +- profiles/act.c | 6 +++--- profiles/tiobench.c | 2 +- unit_tests/steadystate_tests.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
options.c +1 -1
@@ -1965,7 +1965,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .off3 = offsetof(struct thread_options, bs[DDIR_TRIM]), .minval = 1, .help = "Block size unit", - .def = "4k", + .def = "4096", .parent = "rw", .hide = 1, .interval = 512,
profiles/act.c +3 -3
@@ -144,7 +144,7 @@ static struct fio_option options[] = { .type = FIO_OPT_INT, .off1 = offsetof(struct act_options, write_size), .help = "Size of large block ops (writes)", - .def = "128k", + .def = "131072", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_ACT, },
@@ -220,7 +220,7 @@ static int act_add_dev_prep(const char *dev)return 1 ;if (act_add_opt ("filename=%s" , dev))return 1 ; -if (act_add_opt ("bs=1M" )) +if (act_add_opt ("bs=1048576" ))return 1 ;if (act_add_opt ("zero_buffers" ))return 1 ;
@@ -234,7 +234,7 @@ static int act_add_dev_prep(const char *dev)return 1 ;if (act_add_opt ("filename=%s" , dev))return 1 ; -if (act_add_opt ("bs=4k" )) +if (act_add_opt ("bs=4096" ))return 1 ;if (act_add_opt ("ioengine=libaio" ))return 1 ;
profiles/tiobench.c +1 -1
@@ -49,7 +49,7 @@ static struct fio_option options[] = { .type = FIO_OPT_INT, .off1 = offsetof(struct tiobench_options, bs), .help = "Block size in bytes", - .def = "4k", + .def = "4096", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_TIOBENCH, },
unit_tests/steadystate_tests.py +1 -1
@@ -115,7 +115,7 @@ if __name__ == '__main__': if args.read == None: if os.name == 'posix': args.read = '/dev/zero' - extra = [ "--size=128M" ] + extra = [ "--size=134217728" ] # 128 MiB else: print "ERROR: file for read testing must be specified on non-posix systems" sys.exit(1)
Signature · 1 line
2.9.3
PATCH 2/12 gfio: Improve IOPS textbox labels
In reply to Robert ElliottFrom: Robert Elliott <[email protected]>
Change the three textboxes labeled IOPS to Read IOPS, Write IOPS, and Trim IOPS, add Trim to the Blocksize label, and fix Steve's last name in the Credits.
--- gfio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
gfio.c +5 -5
@@ -1215,7 +1215,7 @@ static void about_dialog(GtkWidget *w, gpointer data) {const char *authors[] = {"Jens Axboe <[email protected]>" , -"Stephen Carmeron <[email protected]>" , +"Stephen Cameron <[email protected]>" ,NULL };const char *license[] = {
@@ -1386,7 +1386,7 @@ static GtkWidget *new_client_page(struct gui_entry *ge)g_signal_connect (ge->eta.names,"changed" ,G_CALLBACK (combo_entry_changed), ge);g_signal_connect (ge->eta.names,"destroy" ,G_CALLBACK (combo_entry_destroy), ge); ge->eta.iotype.entry =new_info_entry_in_frame (probe_box,"IO" ); - ge->eta.bs.entry =new_info_entry_in_frame (probe_box,"Blocksize (Read/Write)" ); + ge->eta.bs.entry =new_info_entry_in_frame (probe_box,"Blocksize (Read/Write/Trim)" ); ge->eta.ioengine.entry =new_info_entry_in_frame (probe_box,"IO Engine" ); ge->eta.iodepth.entry =new_info_entry_in_frame (probe_box,"IO Depth" ); ge->eta.jobs =new_info_entry_in_frame (probe_box,"Jobs" );
@@ -1395,11 +1395,11 @@ static GtkWidget *new_client_page(struct gui_entry *ge) probe_box =gtk_hbox_new (FALSE,3 );gtk_box_pack_start (GTK_BOX (probe_frame), probe_box, FALSE, FALSE,3 ); ge->eta.read_bw =new_info_entry_in_frame_rgb (probe_box,"Read BW" ,GFIO_READ_R ,GFIO_READ_G ,GFIO_READ_B ); - ge->eta.read_iops =new_info_entry_in_frame_rgb (probe_box,"IOPS" ,GFIO_READ_R ,GFIO_READ_G ,GFIO_READ_B ); + ge->eta.read_iops =new_info_entry_in_frame_rgb (probe_box,"Read IOPS" ,GFIO_READ_R ,GFIO_READ_G ,GFIO_READ_B ); ge->eta.write_bw =new_info_entry_in_frame_rgb (probe_box,"Write BW" ,GFIO_WRITE_R ,GFIO_WRITE_G ,GFIO_WRITE_B ); - ge->eta.write_iops =new_info_entry_in_frame_rgb (probe_box,"IOPS" ,GFIO_WRITE_R ,GFIO_WRITE_G ,GFIO_WRITE_B ); + ge->eta.write_iops =new_info_entry_in_frame_rgb (probe_box,"Write IOPS" ,GFIO_WRITE_R ,GFIO_WRITE_G ,GFIO_WRITE_B ); ge->eta.trim_bw =new_info_entry_in_frame_rgb (probe_box,"Trim BW" ,GFIO_TRIM_R ,GFIO_TRIM_G ,GFIO_TRIM_B ); - ge->eta.trim_iops =new_info_entry_in_frame_rgb (probe_box,"IOPS" ,GFIO_TRIM_R ,GFIO_TRIM_G ,GFIO_TRIM_B ); + ge->eta.trim_iops =new_info_entry_in_frame_rgb (probe_box,"Trim IOPS" ,GFIO_TRIM_R ,GFIO_TRIM_G ,GFIO_TRIM_B );/* * Only add this if we have a commit rate
Signature · 1 line
2.9.3
Re: [PATCH 02/12] gfio: Improve IOPS textbox labels
Quoted 5 lines · Robert Elliott
From: Robert Elliott <[email protected]>
Change the three textboxes labeled IOPS to Read IOPS, Write IOPS, and Trim IOPS, add Trim to the Blocksize label, and fix Steve's last name in the Credits.
[...]
gfio.c static void about_dialog(GtkWidget *w, gpointer data) · line 1218
Quoted 2 lines
gfio.c +1
-1- "Stephen Carmeron <[email protected]>", + "Stephen Cameron <[email protected]>",
[...]
Ha, thanks.
-- steve
PATCH 3/12 Document trim workload choices and other nits
In reply to Robert ElliottAdd some missing trim workloads (rw=trim, randtrim) to HOWTO, improve some wording about trims in HOWTO, fio.1 (the manpage), and the help text in options.c.
--- HOWTO | 7 ++++--- fio.1 | 12 ++++++------ options.c | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-)
HOWTO +4 -3
@@ -398,12 +398,13 @@ rw=str Type of io pattern. Accepted values are: read Sequential reads write Sequential writes + trim Sequential trims randwrite Random writes randread Random reads + randtrim Random trims rw,readwrite Sequential mixed reads and writes randrw Random mixed reads and writes - trimwrite Mixed trims and writes. Blocks will be - trimmed first, then written to. + trimwrite Sequential trim+write sequences Fio defaults to read if the option is not specified. For the mixed io types, the default is to split them 50/50.
@@ -444,7 +445,7 @@ kb_base=int The base unit for a kilobyte. The defacto base is 2^10, 1024. 1024 or 1000, with 1024 being the default. unified_rw_reporting=bool Fio normally reports statistics on a per - data direction basis, meaning that read, write, and trim are + data direction basis, meaning that reads, writes, and trims are accounted and reported separately. If this option is set, the fio will sum the results and report them as "mixed" instead.
fio.1 +6 -6
@@ -287,7 +287,7 @@ Sequential reads. Sequential writes. .TP .B trim -Sequential trim (Linux block devices only). +Sequential trims (Linux block devices only). .TP .B randread Random reads.
@@ -296,7 +296,7 @@ Random reads. Random writes. .TP .B randtrim -Random trim (Linux block devices only). +Random trims (Linux block devices only). .TP .B rw, readwrite Mixed sequential reads and writes.
@@ -305,8 +305,8 @@ Mixed sequential reads and writes. Mixed random reads and writes. .TP .B trimwrite -Trim and write mixed workload. Blocks will be trimmed first, then the same -blocks will be written to. +Sequential trim and write mixed workload. Blocks will be trimmed first, then +the same blocks will be written to. .RE .P Fio defaults to read if the option is not specified.
@@ -353,7 +353,7 @@ reasons. Allowed values are 1024 or 1000, with 1024 being the default. .TP .BI unified_rw_reporting \fR=\fPbool Fio normally reports statistics on a per data direction basis, meaning that -read, write, and trim are accounted and reported separately. If this option is +reads, writes, and trims are accounted and reported separately. If this option is set fio sums the results and reports them as "mixed" instead. .TP .BI randrepeat \fR=\fPbool
@@ -735,7 +735,7 @@ properly. Read, write and erase an MTD character device (e.g., /dev/mtd0). Discards are treated as erases. Depending on the underlying device type, the I/O may have to go in a certain pattern, e.g., on NAND, writing sequentially to erase blocks -and discarding before overwriting. The writetrim mode works well for this +and discarding before overwriting. The trimwrite mode works well for this constraint. .TP .B pmemblk
options.c +2 -2
@@ -2885,7 +2885,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .off1 = offsetof(struct thread_options, trim_percentage), .minval = 0, .maxval = 100, - .help = "Number of verify blocks to discard/trim", + .help = "Number of verify blocks to trim (i.e., discard)", .parent = "verify", .def = "0", .interval = 1,
@@ -2897,7 +2897,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .name = "trim_verify_zero", .lname = "Verify trim zero", .type = FIO_OPT_BOOL, - .help = "Verify that trim/discarded blocks are returned as zeroes", + .help = "Verify that trimmed (i.e., discarded) blocks are returned as zeroes", .off1 = offsetof(struct thread_options, trim_zero), .parent = "trim_percentage", .hide = 1,
Signature · 1 line
2.9.3
PATCH 4/12 tests, profiles: Use IEC prefixes for binary multiples
In reply to Robert ElliottUse IEC 80000-13 prefixes for binary multiples of bytes (KiB, MiB, etc.) rather than SI prefixes for decimal multiples of bytes (KB, MB, etc.) in places in which the code has fixed divide by 1024, 1024*1024, >>20, etc. and is clearly always using binary multiples.
--- crc/test.c | 4 ++-- profiles/act.c | 8 ++++---- profiles/tiobench.c | 4 ++-- t/btrace2fio.c | 18 +++++++++--------- t/dedupe.c | 2 +- t/genzipf.c | 13 +++++++------ t/lfsr-test.c | 2 +- t/memlock.c | 14 +++++++------- t/read-to-pipe-async.c | 4 ++-- 9 files changed, 35 insertions(+), 34 deletions(-)
crc/test.c +2 -2
@@ -338,9 +338,9 @@ int fio_crctest(const char *type)sprintf (pre,"\t" ); else sprintf(pre, "\t\t"); - printf("%s:%s%8.2f MB/sec\n", t[i].name, pre, mb_sec); + printf("%s:%s%8.2f MiB/sec\n", t[i].name, pre, mb_sec); }else -printf ("%s:inf MB/sec\n" , t[i].name); +printf ("%s:inf MiB/sec\n" , t[i].name); first =0 ; }
profiles/act.c +4 -4
@@ -130,20 +130,20 @@ static struct fio_option options[] = { }, { .name = "read-req-num-512-blocks", - .lname = "Number of 512b blocks to read", + .lname = "Number of 512B blocks to read", .type = FIO_OPT_INT, .off1 = offsetof(struct act_options, num_read_blocks), - .help = "Number of 512b blocks to read at the time", + .help = "Number of 512B blocks to read at the time", .def = "3", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_ACT, }, { .name = "large-block-op-kbytes", - .lname = "Size of large block ops (writes)", + .lname = "Size of large block ops in KiB (writes)", .type = FIO_OPT_INT, .off1 = offsetof(struct act_options, write_size), - .help = "Size of large block ops (writes)", + .help = "Size of large block ops in KiB (writes)", .def = "131072", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_ACT,
profiles/tiobench.c +2 -2
@@ -39,7 +39,7 @@ static struct fio_option options[] = { .lname = "Tiobench size", .type = FIO_OPT_STR_VAL, .off1 = offsetof(struct tiobench_options, size), - .help = "Size in MB", + .help = "Size in MiB", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_TIOBENCH, },
@@ -91,7 +91,7 @@ static struct fio_option options[] = {static int tb_prep_cmdline (void ) {/* -* tiobench uses size as MB, so multiply up +* tiobench uses size as MiB, so multiply up */ size *=1024 *1024ULL ;if (size)
t/btrace2fio.c +9 -9
@@ -62,7 +62,7 @@ struct btrace_out {uint64_t first_ttime[DDIR_RWDIR_CNT ];uint64_t last_ttime[DDIR_RWDIR_CNT ]; -uint64_t kb[DDIR_RWDIR_CNT ]; +uint64_t kib[DDIR_RWDIR_CNT ];uint64_t start_delay; };
@@ -406,7 +406,7 @@ static int handle_trace(struct blk_io_trace *t, struct btrace_pid *p) i =inflight_find (t->sector + (t->bytes >>9 ));if (i) { - i->p->o.kb[t_to_rwdir (t)] += (t->bytes >>10 ); + i->p->o.kib[t_to_rwdir (t)] += (t->bytes >>10 ); i->p->o.complete_seen =1 ;inflight_remove (i); }
@@ -556,7 +556,7 @@ static int bs_cmp(const void *ba, const void *bb)return bsb->nr - bsa->nr; } -static unsigned long o_to_kb_rate (struct btrace_out *o,int rw) +static unsigned long o_to_kib_rate (struct btrace_out *o,int rw) {uint64_t usec = (o->last_ttime[rw] - o->first_ttime[rw]) /1000ULL ;uint64_t val;
@@ -568,7 +568,7 @@ static unsigned long o_to_kb_rate(struct btrace_out *o, int rw)if (!usec)return 0 ; - val = o->kb[rw] *1000ULL ; + val = o->kib[rw] *1000ULL ;return val / usec; }
@@ -623,7 +623,7 @@ static void __output_p_ascii(struct btrace_pid *p, unsigned long *ios)printf ("\tmerges: %lu (perc=%3.2f%%)\n" , o->merges[i], perc); perc = ((float ) o->seq[i] *100.0 ) / (float ) o->ios[i];printf ("\tseq: %lu (perc=%3.2f%%)\n" , (unsigned long ) o->seq[i], perc); -printf ("\trate: %lu KB/sec\n" ,o_to_kb_rate (o, i)); +printf ("\trate: %lu KiB/sec\n" ,o_to_kib_rate (o, i));for (j =0 ; j < o->nr_bs[i]; j++) {struct bs *bs = &o->bs[i][j];
@@ -746,7 +746,7 @@ static int __output_p_fio(struct btrace_pid *p, unsigned long *ios)for (i =0 ; i <DDIR_RWDIR_CNT ; i++) {unsigned long rate; - rate =o_to_kb_rate (o, i); + rate =o_to_kib_rate (o, i);if (i)printf ("," );if (rate)
@@ -810,7 +810,7 @@ static int prune_entry(struct btrace_out *o)for (i =0 ; i <DDIR_RWDIR_CNT ; i++) {unsigned long this_rate; - this_rate =o_to_kb_rate (o, i); + this_rate =o_to_kib_rate (o, i);if (this_rate < rate_threshold) {remove_ddir (o, i); this_rate =0 ;
@@ -926,7 +926,7 @@ static int merge_entries(struct btrace_pid *pida, struct btrace_pid *pidb) oa->ios[i] += ob->ios[i]; oa->merges[i] += ob->merges[i]; oa->seq[i] += ob->seq[i]; - oa->kb[i] += ob->kb[i]; + oa->kib[i] += ob->kib[i]; oa->first_ttime[i] =min (oa->first_ttime[i], ob->first_ttime[i]); oa->last_ttime[i] =max (oa->last_ttime[i], ob->last_ttime[i]);merge_bs (&oa->bs[i], &oa->nr_bs[i], ob->bs[i], ob->nr_bs[i]);
@@ -1021,7 +1021,7 @@ static int usage(char *argv[])log_err ("\t-n\tNumber IOS threshold to ignore task\n" );log_err ("\t-f\tFio job file output\n" );log_err ("\t-d\tUse this file/device for replay\n" ); -log_err ("\t-r\tIgnore jobs with less than this KB/sec rate\n" ); +log_err ("\t-r\tIgnore jobs with less than this KiB/sec rate\n" );log_err ("\t-R\tSet rate in fio job (def=%u)\n" , set_rate);log_err ("\t-D\tCap queue depth at this value (def=%u)\n" , max_depth);log_err ("\t-c\tCollapse \"identical\" jobs (def=%u)\n" , collapse_entries);
t/dedupe.c +1 -1
@@ -363,7 +363,7 @@ static void show_progress(struct worker_thread *threads, unsigned long total) tdiff =mtime_since_now (&last_tv);if (tdiff) { this_items = (this_items *1000 ) / (tdiff *1024 ); -printf ("%3.2f%% done (%luKB/sec)\r" , perc, this_items); +printf ("%3.2f%% done (%luKiB/sec)\r" , perc, this_items); last_nitems = nitems;fio_gettime (&last_tv,NULL ); }else
t/genzipf.c +7 -6
@@ -3,8 +3,8 @@* what an access pattern would look like. * * For instance, the following would generate a zipf distribution -* with theta 1.2, using 262144 (1 GB / 4096) values and split the reporting into -* 20 buckets: +* with theta 1.2, using 262144 (1 GiB / 4096) values and split the +* reporting into 20 buckets: * * ./t/fio-genzipf -t zipf -i 1.2 -g 1 -b 4096 -o 20 *
@@ -49,7 +49,7 @@ enum { };static int dist_type =TYPE_ZIPF ; -static unsigned long gb_size =500 ; +static unsigned long gib_size =500 ;static unsigned long block_size =4096 ;static unsigned long output_nranges =DEF_NR_OUTPUT ;static double percentage;
@@ -131,7 +131,7 @@ static int parse_options(int argc, char *argv[]) }break ;case 'g' : - gb_size =strtoul (optarg,NULL ,10 ); + gib_size =strtoul (optarg,NULL ,10 );break ;case 'i' : dist_val =atof (optarg);
@@ -291,9 +291,10 @@ int main(int argc, char *argv[])return 1 ;if (output_type !=OUTPUT_CSV ) -printf ("Generating %s distribution with %f input and %lu GB size and %lu block_size.\n" , dist_types[dist_type], dist_val, gb_size, block_size); +printf ("Generating %s distribution with %f input and %lu GiB size and %lu block_size.\n" , + dist_types[dist_type], dist_val, gib_size, block_size); - nranges = gb_size *1024 *1024 *1024ULL ; + nranges = gib_size *1024 *1024 *1024ULL ; nranges /= block_size;if (dist_type ==TYPE_ZIPF )
t/lfsr-test.c +1 -1
@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) v_size = numbers *sizeof (uint8_t ); v =malloc (v_size);memset (v,0 , v_size); -printf ("\nVerification table is %lf KBs\n" , (double )(v_size) /1024 ); +printf ("\nVerification table is %lf KiB\n" , (double )(v_size) /1024 ); } v_start = v;
t/memlock.c +7 -7
@@ -4,7 +4,7 @@#include <pthread.h> static struct thread_data { -unsigned long mb; +unsigned long mib; } td;static void *worker (void *data)
@@ -15,14 +15,14 @@ static void *worker(void *data)char *buf;int i, first =1 ; - size = td->mb *1024UL *1024UL ; + size = td->mib *1024UL *1024UL ; buf =malloc (size);for (i =0 ; i <100000 ; i++) {for (index =0 ; index +4096 < size; index +=4096 )memset (&buf[index+512 ],0x89 ,512 );if (first) { -printf ("loop%d: did %lu MB\n" , i+1 , size/(1024UL *1024UL )); +printf ("loop%d: did %lu MiB\n" , i+1 , size/(1024UL *1024UL )); first =0 ; } }
@@ -31,20 +31,20 @@ static void *worker(void *data)int main (int argc,char *argv[]) { -unsigned long mb, threads; +unsigned long mib, threads;pthread_t *pthreads;int i;if (argc <3 ) { -printf ("%s: <mb per thread> <threads>\n" , argv[0 ]); +printf ("%s: <MiB per thread> <threads>\n" , argv[0 ]);return 1 ; } - mb =strtoul (argv[1 ],NULL ,10 ); + mib =strtoul (argv[1 ],NULL ,10 ); threads =strtoul (argv[2 ],NULL ,10 ); pthreads =calloc (threads,sizeof (pthread_t)); - td.mb = mb; + td.mib = mib;for (i =0 ; i < threads; i++)pthread_create (&pthreads[i],NULL , worker, &td);
t/read-to-pipe-async.c +2 -2
@@ -661,9 +661,9 @@ int main(int argc, char *argv[]) bytes /=1024 ; rate = (bytes *1000UL *1000UL ) /utime_since (&s, &re); -fprintf (stderr,"Read rate (KB/sec) : %lu\n" , rate); +fprintf (stderr,"Read rate (KiB/sec) : %lu\n" , rate); rate = (bytes *1000UL *1000UL ) /utime_since (&s, &we); -fprintf (stderr,"Write rate (KB/sec): %lu\n" , rate); +fprintf (stderr,"Write rate (KiB/sec): %lu\n" , rate);close (fd);return 0 ;
Signature · 1 line
2.9.3
PATCH 5/12 Fix unit_base kb_base mixup in thread option conversion functions
In reply to Robert ElliottDon't set unit_base, which is 1 or 8, to kb_base, which is 1000 or 1024, during the convert functions used by the initial cconv test.
--- cconv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
cconv.c +2 -2
@@ -88,7 +88,7 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->td_ddir =le32_to_cpu (top->td_ddir); o->rw_seq =le32_to_cpu (top->rw_seq); o->kb_base =le32_to_cpu (top->kb_base); - o->unit_base =le32_to_cpu (top->kb_base); + o->unit_base =le32_to_cpu (top->unit_base); o->ddir_seq_nr =le32_to_cpu (top->ddir_seq_nr); o->ddir_seq_add =le64_to_cpu (top->ddir_seq_add); o->iodepth =le32_to_cpu (top->iodepth);
@@ -336,7 +336,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->td_ddir =cpu_to_le32 (o->td_ddir); top->rw_seq =cpu_to_le32 (o->rw_seq); top->kb_base =cpu_to_le32 (o->kb_base); - top->unit_base =cpu_to_le32 (o->kb_base); + top->unit_base =cpu_to_le32 (o->unit_base); top->ddir_seq_nr =cpu_to_le32 (o->ddir_seq_nr); top->iodepth =cpu_to_le32 (o->iodepth); top->iodepth_low =cpu_to_le32 (o->iodepth_low);
Signature · 1 line
2.9.3
PATCH 6/12 Line up colons across read, write, and trim thread stats
In reply to Robert ElliottLine up the colons across the read, write, and trim thread stats rows.
Example:drive_0: (groupid=0, jobs=576): err= 0: pid=42198: Wed Dec 21 19:51:35 2016
read : io=420642MB, bw=33953MB/s, iops=8289.3K, runt= 12389msec
write: io=325276MB, bw=26177MB/s, iops=6390.9K, runt= 12426msec
trim: io=0MB, bw=0MB/s, iops=0, runt= 12426msec
becomes:drive_0: (groupid=0, jobs=576): err= 0: pid=42198: Wed Dec 21 19:51:35 2016
read: io=420642MB, bw=33953MB/s, iops=8289.3K, runt= 12389msec
write: io=325276MB, bw=26177MB/s, iops=6390.9K, runt= 12426msec
trim: io=0MB, bw=0MB/s, iops=0, runt= 12426msec
--- stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
stat.c +1 -1
@@ -380,7 +380,7 @@ static void display_lat(const char *name, unsigned long min, unsigned long max,static void show_ddir_status (struct group_run_stats *rs,struct thread_stat *ts,int ddir,struct buf_output *out) { -const char *str[] = {"read " ,"write" ,"trim" }; +const char *str[] = {" read" ,"write" ," trim" };unsigned long min, max, runt;unsigned long long bw, iops;double mean, dev;
Signature · 1 line
2.9.3
PATCH 7/12 gclient: Delete unused code
In reply to Robert ElliottDelete two #if 0 blocks from pre-2012 that have old calls to num2str without the current number of arguments and hardcode "KB/s" units.
--- gclient.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-)
gclient.c +0 -40
@@ -364,26 +364,6 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *jsprintf (tmp,"%u" , je->files_open);gtk_entry_set_text (GTK_ENTRY (ge->eta.files), tmp); -#if 0 -if (je->m_rate[0 ] || je->m_rate[1 ] || je->t_rate[0 ] || je->t_rate[1 ]) { -if (je->m_rate || je->t_rate) { -char *tr, *mr; - - mr =num2str (je->m_rate,4 ,0 , i2p); - tr =num2str (je->t_rate,4 ,0 , i2p); - gtk_entry_set_text(GTK_ENTRY(ge->eta); - p +=sprintf (p,", CR=%s/%s KB/s" , tr, mr); -free (tr); -free (mr); - }else if (je->m_iops || je->t_iops) - p +=sprintf (p,", CR=%d/%d IOPS" , je->t_iops, je->m_iops); - -gtk_entry_set_text (GTK_ENTRY (ge->eta.cr_bw),"---" ); -gtk_entry_set_text (GTK_ENTRY (ge->eta.cr_iops),"---" ); -gtk_entry_set_text (GTK_ENTRY (ge->eta.cw_bw),"---" ); -gtk_entry_set_text (GTK_ENTRY (ge->eta.cw_iops),"---" ); -#endif -if (je->eta_sec !=INT_MAX && je->nr_running) {char *iops_str[DDIR_RWDIR_CNT ];char *rate_str[DDIR_RWDIR_CNT ];
@@ -457,26 +437,6 @@ static void gfio_update_all_eta(struct jobs_eta *je)eta_to_str (eta_str, je->eta_sec); } -#if 0 -if (je->m_rate[0 ] || je->m_rate[1 ] || je->t_rate[0 ] || je->t_rate[1 ]) { -if (je->m_rate || je->t_rate) { -char *tr, *mr; - - mr =num2str (je->m_rate,4 ,0 , i2p); - tr =num2str (je->t_rate,4 ,0 , i2p); - gtk_entry_set_text(GTK_ENTRY(ui->eta); - p +=sprintf (p,", CR=%s/%s KB/s" , tr, mr); -free (tr); -free (mr); - }else if (je->m_iops || je->t_iops) - p +=sprintf (p,", CR=%d/%d IOPS" , je->t_iops, je->m_iops); - -gtk_entry_set_text (GTK_ENTRY (ui->eta.cr_bw),"---" ); -gtk_entry_set_text (GTK_ENTRY (ui->eta.cr_iops),"---" ); -gtk_entry_set_text (GTK_ENTRY (ui->eta.cw_bw),"---" ); -gtk_entry_set_text (GTK_ENTRY (ui->eta.cw_iops),"---" ); -#endif -entry_set_int_value (ui->eta.jobs, je->nr_running);if (je->eta_sec !=INT_MAX && je->nr_running) {
Signature · 1 line
2.9.3
PATCH 8/12 gclient: Use proper time units in latency buckets chart
In reply to Robert ElliottIn the Results page Latency buckets chart, use us and ms rather than u and s for the time units. This matches the use of s for seconds that is already being done.
--- gclient.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
gclient.c +5 -5
@@ -908,10 +908,10 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox, struct thread_stat *ts) {double io_u_lat[FIO_IO_U_LAT_U_NR +FIO_IO_U_LAT_M_NR ]; -const char *ranges[] = {"2u" ,"4u" ,"10u" ,"20u" ,"50u" ,"100u" , -"250u" ,"500u" ,"750u" ,"1m" ,"2m" , -"4m" ,"10m" ,"20m" ,"50m" ,"100m" , -"250m" ,"500m" ,"750m" ,"1s" ,"2s" ,">= 2s" }; +const char *ranges[] = {"2us" ,"4us" ,"10us" ,"20us" ,"50us" ,"100us" , +"250us" ,"500us" ,"750us" ,"1ms" ,"2ms" , +"4ms" ,"10ms" ,"20ms" ,"50ms" ,"100ms" , +"250ms" ,"500ms" ,"750ms" ,"1s" ,"2s" ,">= 2s" };int start, end, i;const int total =FIO_IO_U_LAT_U_NR +FIO_IO_U_LAT_M_NR ;GtkWidget *frame, *tree_view, *hbox, *completion_vbox, *drawing_area;
@@ -940,7 +940,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,return ; tree_view =gfio_output_lat_buckets (&io_u_lat[start], &ranges[start], end - start +1 ); - ge->lat_bucket_graph =setup_lat_bucket_graph ("Latency Buckets" , &io_u_lat[start], &ranges[start], end - start +1 ,700.0 ,300.0 ); + ge->lat_bucket_graph =setup_lat_bucket_graph ("Latency buckets" , &io_u_lat[start], &ranges[start], end - start +1 ,700.0 ,300.0 ); frame =gtk_frame_new ("Latency buckets" );gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE,5 );
Signature · 1 line
2.9.3
PATCH 9/12 Convert group_run_stats to use bytes instead of KiB/KB
In reply to Robert ElliottIn group_run_stats, convert these fields:
* io_kb (bytes transferred)
* agg (aggregate average bandwidth)
* min_bw
* max_bw
from tracking either KiB or KB depending on kb_base to simply tracking bytes. Rename io_kb to iobytes to match this new meaning.
This will simplify computing quantities and bandwidth rates with both IEC binary and SI decimal unit prefixes (e.g., GiB/s and GB/s) in future patches.
--- client.c | 2 +- server.c | 2 +- stat.c | 23 +++++++++-------------- stat.h | 2 +- 4 files changed, 12 insertions(+), 17 deletions(-)
client.c +1 -1
@@ -972,7 +972,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src) dst->min_run[i] =le64_to_cpu (src->min_run[i]); dst->max_bw[i] =le64_to_cpu (src->max_bw[i]); dst->min_bw[i] =le64_to_cpu (src->min_bw[i]); - dst->io_kb[i] =le64_to_cpu (src->io_kb[i]); + dst->iobytes[i] =le64_to_cpu (src->iobytes[i]); dst->agg[i] =le64_to_cpu (src->agg[i]); }
server.c +1 -1
@@ -1444,7 +1444,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src) dst->min_run[i] =cpu_to_le64 (src->min_run[i]); dst->max_bw[i] =cpu_to_le64 (src->max_bw[i]); dst->min_bw[i] =cpu_to_le64 (src->min_bw[i]); - dst->io_kb[i] =cpu_to_le64 (src->io_kb[i]); + dst->iobytes[i] =cpu_to_le64 (src->iobytes[i]); dst->agg[i] =cpu_to_le64 (src->agg[i]); }
stat.c +9 -14
@@ -291,10 +291,10 @@ void show_group_stats(struct group_run_stats *rs, struct buf_output *out)if (!rs->max_run[i])continue ; - p1 =num2str (rs->io_kb[i],6 , rs->kb_base, i2p,8 ); - p2 =num2str (rs->agg[i],6 , rs->kb_base, i2p, rs->unit_base); - p3 =num2str (rs->min_bw[i],6 , rs->kb_base, i2p, rs->unit_base); - p4 =num2str (rs->max_bw[i],6 , rs->kb_base, i2p, rs->unit_base); + p1 =num2str (rs->iobytes[i],6 ,1 , i2p,8 ); + p2 =num2str (rs->agg[i],6 ,1 , i2p, rs->unit_base); + p3 =num2str (rs->min_bw[i],6 ,1 , i2p, rs->unit_base); + p4 =num2str (rs->max_bw[i],6 ,1 , i2p, rs->unit_base); log_buf(out, "%s: io=%s, aggrb=%s/s, minb=%s/s, maxb=%s/s," " mint=%llumsec, maxt=%llumsec\n",
@@ -1418,7 +1418,7 @@ void sum_group_stats(struct group_run_stats *dst, struct group_run_stats *src)if (dst->min_bw[i] && dst->min_bw[i] > src->min_bw[i]) dst->min_bw[i] = src->min_bw[i]; - dst->io_kb[i] += src->io_kb[i]; + dst->iobytes[i] += src->iobytes[i]; dst->agg[i] += src->agg[i]; }
@@ -1696,19 +1696,14 @@ void __show_run_stats(void) rs->max_run[j] = ts->runtime[j]; bw =0 ; -if (ts->runtime[j]) { -unsigned long runt = ts->runtime[j]; -unsigned long long kb; - - kb = ts->io_bytes[j] / rs->kb_base; - bw = kb *1000 / runt; - } +if (ts->runtime[j]) + bw = ts->io_bytes[j] *1000 / ts->runtime[j];if (bw < rs->min_bw[j]) rs->min_bw[j] = bw;if (bw > rs->max_bw[j]) rs->max_bw[j] = bw; - rs->io_kb[j] += ts->io_bytes[j] / rs->kb_base; + rs->iobytes[j] += ts->io_bytes[j]; } }
@@ -1719,7 +1714,7 @@ void __show_run_stats(void)for (ddir =0 ; ddir <DDIR_RWDIR_CNT ; ddir++) {if (rs->max_run[ddir]) - rs->agg[ddir] = (rs->io_kb[ddir] *1000 ) / + rs->agg[ddir] = (rs->iobytes[ddir] *1000 ) / rs->max_run[ddir]; } }
stat.h +1 -1
@@ -7,7 +7,7 @@struct group_run_stats {uint64_t max_run[DDIR_RWDIR_CNT ], min_run[DDIR_RWDIR_CNT ];uint64_t max_bw[DDIR_RWDIR_CNT ], min_bw[DDIR_RWDIR_CNT ]; -uint64_t io_kb[DDIR_RWDIR_CNT ]; +uint64_t iobytes[DDIR_RWDIR_CNT ];uint64_t agg[DDIR_RWDIR_CNT ];uint32_t kb_base;uint32_t unit_base;
Signature · 1 line
2.9.3
Re: [PATCH 09/12] Convert group_run_stats to use bytes instead of KiB/KB
Quoted 8 lines · Robert Elliott
In
group_run_stats, convert these fields:
*io_kb(bytes transferred)
* agg (aggregate average bandwidth)
*min_bw
*max_bwfrom tracking either KiB or KB depending on
kb_baseto simply tracking bytes. Renameio_kbto iobytes to match this new meaning.
It's hopefully unlikely but have you checked this change to see that overflow isn't provoked during arithmetic? I spent a little while getting rid of a few cases prior to this patch by using clang's undefined behaviour sanitizer via -fsanitize=integer and they were more likely to occur on 32 bit platforms (which was more of a pain as linking the sanitizer on 32 bit x86 Linux was more difficult). Another minor point is should the variable rename have gone to io_bytes rather than iobytes?
Quoted 2 lines
This will simplify computing quantities and bandwidth rates with both IEC binary and SI decimal unit prefixes (e.g., GiB/s and GB/s) in future patches.
Signature · 1 line
Sitsofe | http://sucs.org/~sits/
RE: [PATCH 09/12] Convert group_run_stats to use bytes instead of KiB/KB
Quoted 19 lines
-----Original Message-----
From: Sitsofe Wheeler [mailto:[email protected]]
Sent: Thursday, December 22, 2016 2:39 AM
To: Elliott, Robert (Persistent Memory) <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 09/12] Convertgroup_run_statsto use bytes instead of KiB/KBQuoted 7 lines · Robert Elliott
In
group_run_stats, convert these fields:
*io_kb(bytes transferred)
* agg (aggregate average bandwidth)
*min_bw
*max_bwfrom tracking either KiB or KB depending on
kb_baseto simplytracking bytes.
Quoted 8 lines
Quoted 1 line
Rename
io_kbto iobytes to match this new meaning.It's hopefully unlikely but have you checked this change to see that overflow isn't provoked during arithmetic? I spent a little while getting rid of a few cases prior to this patch by using clang's undefined behaviour sanitizer via -fsanitize=integer and they were more likely to occur on 32 bit platforms (which was more of a pain as linking the sanitizer on 32 bit x86 Linux was more difficult).
I think so, but I'll review the code to make sure. I've been running overnight runs on NVDIMMs which push numbers well past the 32 bit boundary:
* read IOs 847TB (770TiB)
* read BW 33.7GB/s (31.4GiB/s)
* write IOs 419TB (381TiB)
* write BW 16.7GB/s (15.6GiB/s)
I did notice that the options integers (e.g., FIO_OPT_INT) are 32 bits, which prevents specifying a rate_min greater than 4 GiB/s. That looks more complicated to fix.
Quoted 4 lines
Another
minor point is should the variable rename have gone toio_bytesrather
than iobytes?
There's another structure (thread_data) using io_bytes, so being slightly different makes it easier to distinguish them with grep.
---
Robert Elliott, HPE Persistent Memory
PATCH 10/12 Clean up unit prefixes for binary multiples in comments and prints
In reply to Robert ElliottFrom: Robert Elliott <[email protected]>
Change comments and prints that are referring to values based on binary multiples to use IEC 80000-13 prefixes for binary multiples rather than SI prefixes for decimal multiples (e.g., KiB, MiB, and GiB rather than KB, MB, and GB).
Includes a fix for the rate_min print that was printing "KB/s" although it was really printing bytes per second.
--- README | 2 +- backend.c | 18 ++++++++---------- engines/dev-dax.c | 2 +- engines/mmap.c | 2 +- eta.c | 2 +- filesetup.c | 5 ++--- goptions.c | 2 +- memory.c | 4 ++-- stat.c | 6 +++--- 9 files changed, 20 insertions(+), 23 deletions(-)
README +1 -1
@@ -233,7 +233,7 @@ sections. The reserved 'global' section is always parsed and used. The --alloc-size switch allows one to use a larger pool size for smalloc. If running large jobs with randommap enabled, fio can run out of memory. Smalloc is an internal allocator for shared structures from a fixed size -memory pool. The pool size defaults to 16M and can grow to 8 pools. +memory pool. The pool size defaults to 16MiB and can grow to 8 pools. NOTE: While running .fio_smalloc.* backing store files are visible in /tmp.
backend.c +8 -10
@@ -180,8 +180,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 +191,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 +201,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 +212,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; } }
engines/dev-dax.c +1 -1
@@ -58,7 +58,7 @@#include "../verify.h" /* -* Limits us to 1GB of mapped files in total to model after +* Limits us to 1GiB of mapped files in total to model after * mmap engine behavior */ #define MMAP_TOTAL_SZ (1 * 1024 * 1024 * 1024UL)
engines/mmap.c +1 -1
@@ -15,7 +15,7 @@#include "../verify.h" /* -* Limits us to 1GB of mapped files in total +* Limits us to 1GiB of mapped files in total */ #define MMAP_TOTAL_SZ (1 * 1024 * 1024 * 1024UL)
eta.c +1 -1
@@ -308,7 +308,7 @@ static void calc_rate(int unified_rw_rep, unsigned long mtime, diff = io_bytes[i] - prev_io_bytes[i];if (mtime) - this_rate = ((1000 * diff) / mtime) /1024 ; + this_rate = ((1000 * diff) / mtime) /1024 ;/* KiB/s */ else this_rate =0 ;
filesetup.c +2 -3
@@ -948,9 +948,8 @@ int setup_files(struct thread_data *td)if (need_extend) { temp_stall_ts =1 ;if (output_format &FIO_OUTPUT_NORMAL ) -log_info ("%s: Laying out IO file(s) (%u file(s) /" -" %lluMB)\n" , o->name, need_extend, - extend_size >>20 ); +log_info ("%s: Laying out IO file(s) (%u file(s) / %lluMiB)\n" , + o->name, need_extend, extend_size >>20 );for_each_file (td, f, i) {unsigned long long old_len =-1ULL , extend_len =-1ULL ;
goptions.c +1 -1
@@ -826,7 +826,7 @@ static struct gopt *gopt_new_str_val(struct gopt_job_view *gjv, unsigned long long *p, unsigned int idx) {struct gopt_str_val *g; -const gchar *postfix[] = {"B" ,"KB" ,"MB" ,"GB" ,"PB" ,"TB" ,"" }; +const gchar *postfix[] = {"B" ,"KiB" ,"MiB" ,"GiB" ,"PiB" ,"TiB" ,"" };GtkWidget *label;int i;
memory.c +2 -2
@@ -33,13 +33,13 @@ int fio_pin_memory(struct thread_data *td)dprint (FD_MEM ,"pinning %llu bytes\n" , td->o.lockmem);/* -* Don't allow mlock of more than real_mem-128MB +* Don't allow mlock of more than real_mem-128MiB */ phys_mem =os_phys_mem ();if (phys_mem) {if ((td->o.lockmem +128 *1024 *1024 ) > phys_mem) { td->o.lockmem = phys_mem -128 *1024 *1024 ; -log_info ("fio: limiting mlocked memory to %lluMB\n" , +log_info ("fio: limiting mlocked memory to %lluMiB\n" , td->o.lockmem >>20 ); } }
stat.c +3 -3
@@ -812,7 +812,7 @@ static void show_ddir_status_terse(struct thread_stat *ts,if (ts->runtime[ddir]) {uint64_t runt = ts->runtime[ddir]; - bw = ((1000 * ts->io_bytes[ddir]) / runt) /1024 ; + bw = ((1000 * ts->io_bytes[ddir]) / runt) /1024 ;/* KiB/s */ iops = (1000 * (uint64_t ) ts->total_io_u[ddir]) / runt; }
@@ -896,7 +896,7 @@ static void add_ddir_status_json(struct thread_stat *ts,if (ts->runtime[ddir]) {uint64_t runt = ts->runtime[ddir]; - bw = ((1000 * ts->io_bytes[ddir]) / runt) /1024 ; + bw = ((1000 * ts->io_bytes[ddir]) / runt) /1024 ;/* KiB/s */ iops = (1000.0 * (uint64_t ) ts->total_io_u[ddir]) / runt; }
@@ -2431,7 +2431,7 @@ static int add_bw_samples(struct thread_data *td, struct timeval *t)continue ;/* No entries for interval */ if (spent) - rate = delta *1000 / spent /1024 ; + rate = delta *1000 / spent /1024 ;/* KiB/s */ else rate =0 ;
Signature · 1 line
2.9.3
RE: [PATCH 10/12] Clean up unit prefixes for binary multiples in comments and prints
Quoted 19 lines
-----Original Message-----
From: Elliott, Robert (Persistent Memory)
Sent: Thursday, December 22, 2016 12:09 AM
Subject: [PATCH 10/12] Clean up unit prefixes for binary multiples in comments and printsgoptions.c +1
-1@@ -826,7 +826,7 @@ static struct gopt *gopt_new_str_val(structgopt_job_view *gjv, unsigned long long *p, unsigned int idx) { struct gopt_str_val *g; -const gchar *postfix[] = {"B" ,"KB" ,"MB" ,"GB" ,"PB" ,"TB" , "" }; +const gchar *postfix[] = {"B" ,"KiB" ,"MiB" ,"GiB" ,"PiB" ,
Quoted 1 line
"TiB", "" };
That has PB and TB backwards, and should fix it to:
+ const gchar *postfix[] = { "B", "KiB", "MiB", "GiB", "TiB", "PiB", "" };
---
Robert Elliott, HPE Persistent Memory
PATCH 11/12 Improve IEC binary and SI decimal prefix handling
In reply to Robert ElliottUse kb_base=1000 to follow international standards for unit prefixes.
To specify power-of-10 decimal values defined in the International System of Units (SI):
Ki means kilo (K) or 1000 Mi means mega (M) or 1000**2 Gi means giga (G) or 1000**3 Ti means tera (T) or 1000**4 Pi means peta (P) or 1000**5
To specify power-of-2 binary values defined in IEC 80000-13:
k means kibi (Ki) or 1024 M means mebi (Mi) or 1024**2 G means gibi (Gi) or 1024**3 T means tebi (Ti) or 1024**4 P means pebi (Pi) or 1024**5
For example, this specifies a blocksize of 4096 bytes:
kb_base=1000 bs=4KiB
With kb_base=1024 (the default), the unit prefixes are opposite from those specified in the SI and IEC 80000-13 standards to provide compatibility with old scripts. For example, this specifies a blocksize of 4096 bytes:
kb_base=1024 bs=4K
For outputs printing quantities and bandwidths:
* eta stats only use the preferred prefix
* final stats include both (non-preferred prefix in parenthesis)
* in gfio, all windows include both
Text outputs are rearranged to try to obviously break any scripts parsing the output rather than silently confuse them. The terse and json outputs, which are intended for parsing, are unchanged.
Old:
Jobs: 576 (f=576), CR=86.4GB/576MB KB/s: [w(288),r(288)] [0.0% done] [33884MB/27114MB/0KB /s] [8471K/6778K/0 iops] [eta 06h:59m:57s]
read: io=363338MB, bw=34014MB/s, iops=8304.3K, runt= 10682msec
write: io=282447MB, bw=26225MB/s, iops=6402.7K, runt= 10770msec
READ: io=363338MB, aggrb=34014MB/s, minb=34014MB/s, maxb=34014MB/s, mint=10682msec, maxt=10682msec
WRITE: io=282447MB, aggrb=26225MB/s, minb=26225MB/s, maxb=26225MB/s, mint=10770msec, maxt=10770msec
New:
Jobs: 576 (f=576), 590MB/s-89.2GB/s: [w(288),r(288)][0.0%][r=34.2GB/s,w=26.3GB/s][r=8542k,w=6572k IOPS][eta 06h:59m:55s]
read: IOPS=8362k, BW=34.3GB/s (31.1GiB/s)(665GB/19417msec)
write: IOPS=6423k, BW=26.4GB/s (24.6GiB/s)(511GB/19431msec)
READ: bw=34.3GB/s (31.1GiB/s), 34.3GB/s-34.3GB/s (31.1GiB/s-31.1GiB/s), io=665GB (619GiB), run=19417-19417msec
WRITE: bw=26.4GB/s (24.6GiB/s), 26.4GB/s-26.4GB/s (24.6GiB/s-24.6GiB/s), io=511GB (476GiB), run=19431-19431msec
Documentation changes are in a subsequent patch.
--- eta.c | 44 ++++++++++++++------- fio.h | 7 ++++ gclient.c | 123 ++++++++++++++++++++++++++++++++++++++-------------------- init.c | 39 +++++-------------- lib/num2str.c | 57 ++++++++++++++++++++------- options.c | 8 ++-- parse.c | 40 +++++++++++++------ stat.c | 91 ++++++++++++++++++++++++++----------------- 8 files changed, 259 insertions(+), 150 deletions(-)
eta.c +31 -13
@@ -530,19 +530,28 @@ void display_thread_status(struct jobs_eta *je) } p +=sprintf (p,"Jobs: %d (f=%d)" , je->nr_running, je->files_open); -if (je->m_rate[0 ] || je->m_rate[1 ] || je->t_rate[0 ] || je->t_rate[1 ]) { + +/* rate limits, if any */ +if (je->m_rate[0 ] || je->m_rate[1 ] || je->m_rate[2 ] || + je->t_rate[0 ] || je->t_rate[1 ] || je->t_rate[2 ]) {char *tr, *mr; - mr =num2str (je->m_rate[0 ] + je->m_rate[1 ],4 ,0 , je->is_pow2,8 ); - tr =num2str (je->t_rate[0 ] + je->t_rate[1 ],4 ,0 , je->is_pow2,8 ); - p +=sprintf (p,", CR=%s/%s KB/s" , tr, mr); + mr =num2str (je->m_rate[0 ] + je->m_rate[1 ] + je->m_rate[2 ], +4 ,0 , je->is_pow2,N2S_BYTEPERSEC ); + tr =num2str (je->t_rate[0 ] + je->t_rate[1 ] + je->t_rate[2 ], +4 ,0 , je->is_pow2,N2S_BYTEPERSEC ); + + p +=sprintf (p,", %s-%s" , mr, tr);free (tr);free (mr); - }else if (je->m_iops[0 ] || je->m_iops[1 ] || je->t_iops[0 ] || je->t_iops[1 ]) { - p +=sprintf (p,", CR=%d/%d IOPS" , - je->t_iops[0 ] + je->t_iops[1 ], - je->m_iops[0 ] + je->m_iops[1 ]); + }else if (je->m_iops[0 ] || je->m_iops[1 ] || je->m_iops[2 ] || + je->t_iops[0 ] || je->t_iops[1 ] || je->t_iops[2 ]) { + p +=sprintf (p,", %d-%d IOPS" , + je->m_iops[0 ] + je->m_iops[1 ] + je->m_iops[2 ], + je->t_iops[0 ] + je->t_iops[1 ] + je->t_iops[2 ]); } + +/* current run string, % done, bandwidth, iops, eta */ if (je->eta_sec !=INT_MAX && je->nr_running) {char perc_str[32 ];char *iops_str[DDIR_RWDIR_CNT ];
@@ -553,7 +562,7 @@ void display_thread_status(struct jobs_eta *je)if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running || je->eta_sec ==-1 ) -strcpy (perc_str,"-.-% done" ); +strcpy (perc_str,"-.-%" );else {double mult =100.0 ;
@@ -562,22 +571,31 @@ void display_thread_status(struct jobs_eta *je) eta_good =1 ; perc *= mult; -sprintf (perc_str,"%3.1f%% done" , perc); +sprintf (perc_str,"%3.1f%%" , perc); }for (ddir =DDIR_READ ; ddir <DDIR_RWDIR_CNT ; ddir++) { - rate_str[ddir] =num2str (je->rate[ddir],5 , + rate_str[ddir] =num2str (je->rate[ddir],4 ,1024 , je->is_pow2, je->unit_base); - iops_str[ddir] =num2str (je->iops[ddir],4 ,1 ,0 ,0 ); + iops_str[ddir] =num2str (je->iops[ddir],4 ,1 ,0 ,N2S_NONE ); } left =sizeof (output) - (p - output) -1 ; - l =snprintf (p, left,": [%s] [%s] [%s/%s/%s /s] [%s/%s/%s iops] [eta %s]" , +if (je->rate[DDIR_TRIM ] || je->iops[DDIR_TRIM ]) + l =snprintf (p, left, +": [%s][%s][r=%s,w=%s,t=%s][r=%s,w=%s,t=%s IOPS][eta %s]" , je->run_str, perc_str, rate_str[DDIR_READ ], rate_str[DDIR_WRITE ], rate_str[DDIR_TRIM ], iops_str[DDIR_READ ], iops_str[DDIR_WRITE ], iops_str[DDIR_TRIM ], eta_str); +else + l =snprintf (p, left, +": [%s][%s][r=%s,w=%s][r=%s,w=%s IOPS][eta %s]" , + je->run_str, perc_str, + rate_str[DDIR_READ ], rate_str[DDIR_WRITE ], + iops_str[DDIR_READ ], iops_str[DDIR_WRITE ], + eta_str); p += l;if (l >=0 && l < linelen_last) p +=sprintf (p,"%*s" , linelen_last - l,"" );
fio.h +7 -0
@@ -535,6 +535,13 @@ extern uintptr_t page_size;extern int initialize_fio (char *envp[]);extern void deinitialize_fio (void ); +#define N2S_NONE 0 +#define N2S_BITPERSEC 1/* match unit_base for bit rates */ +#define N2S_PERSEC 2 +#define N2S_BIT 3 +#define N2S_BYTE 4 +#define N2S_BYTEPERSEC 8/* match unit_base for byte rates */ +#define FIO_GETOPT_JOB 0x89000000#define FIO_GETOPT_IOENGINE 0x98000000#define FIO_NR_OPTIONS (FIO_MAX_OPTS + 128)
gclient.c +81 -42
224 lines not on this page · raw message
init.c +10 -29
@@ -31,6 +31,7 @@#include "oslib/strcasestr.h" #include "crc/test.h" +#include "lib/pow2.h" const char fio_version_string[] =FIO_VERSION ;
@@ -865,27 +866,6 @@ static int fixup_options(struct thread_data *td)return ret; } -/* -* This function leaks the buffer -*/ -char *fio_uint_to_kmg (unsigned int val) -{ -char *buf =malloc (32 ); -char post[] = {0 ,'K' ,'M' ,'G' ,'P' ,'E' ,0 }; -char *p = post; - -do { -if (val &1023 ) -break ; - - val >>=10 ; - p++; - }while (*p); - -snprintf (buf,32 ,"%u%c" , val, *p); -return buf; -} -/* External engines are specified by "external:name.o") */ static const char *get_engine_name (const char *str) {
@@ -1528,15 +1508,16 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,if (!td_ioengine_flagged (td,FIO_NOIO )) {char *c1, *c2, *c3, *c4;char *c5 =NULL , *c6 =NULL ; +int i2p =is_power_of_2 (o->kb_base); - c1 =fio_uint_to_kmg (o->min_bs[DDIR_READ ]); - c2 =fio_uint_to_kmg (o->max_bs[DDIR_READ ]); - c3 =fio_uint_to_kmg (o->min_bs[DDIR_WRITE ]); - c4 =fio_uint_to_kmg (o->max_bs[DDIR_WRITE ]); + c1 =num2str (o->min_bs[DDIR_READ ],4 ,1 , i2p,N2S_BYTE ); + c2 =num2str (o->max_bs[DDIR_READ ],4 ,1 , i2p,N2S_BYTE ); + c3 =num2str (o->min_bs[DDIR_WRITE ],4 ,1 , i2p,N2S_BYTE ); + c4 =num2str (o->max_bs[DDIR_WRITE ],4 ,1 , i2p,N2S_BYTE );if (!o->bs_is_seq_rand) { - c5 =fio_uint_to_kmg (o->min_bs[DDIR_TRIM ]); - c6 =fio_uint_to_kmg (o->max_bs[DDIR_TRIM ]); + c5 =num2str (o->min_bs[DDIR_TRIM ],4 ,1 , i2p,N2S_BYTE ); + c6 =num2str (o->max_bs[DDIR_TRIM ],4 ,1 , i2p,N2S_BYTE ); } log_info("%s: (g=%d): rw=%s, ", td->o.name,
@@ -1544,10 +1525,10 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, ddir_str(o->td_ddir));if (o->bs_is_seq_rand) -log_info ("bs(seq/rand)=%s-%s/%s-%s, " , +log_info ("bs=%s-%s,%s-%s, bs_is_seq_rand, " , c1, c2, c3, c4);else -log_info ("bs=%s-%s/%s-%s/%s-%s, " , +log_info ("bs=%s-%s,%s-%s,%s-%s, " , c1, c2, c3, c4, c5, c6); log_info("ioengine=%s, iodepth=%u\n",
lib/num2str.c +42 -15
95 lines not on this page · raw message
options.c +4 -4
@@ -4180,20 +4180,20 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .posval = { { .ival = "1024", .oval = 1024, - .help = "Use 1024 as the K base", + .help = "Inputs invert IEC and SI prefixes (for compatibility); outputs prefer binary", }, { .ival = "1000", .oval = 1000, - .help = "Use 1000 as the K base", + .help = "Inputs use IEC and SI prefixes; outputs prefer SI", }, }, - .help = "How many bytes per KB for reporting (1000 or 1024)", + .help = "Unit prefix interpretation for quantities of data (IEC and SI)", .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_INVALID, }, { .name = "unit_base", - .lname = "Base unit for reporting (Bits or Bytes)", + .lname = "Unit for quantities of data (Bits or Bytes)", .type = FIO_OPT_INT, .off1 = offsetof(struct thread_options, unit_base), .prio = 1,
parse.c +29 -11
@@ -207,32 +207,50 @@ static unsigned long long __get_mult_bytes(const char *p, void *data, } } +/* If kb_base is 1000, use true units. +* If kb_base is 1024, use opposite units. +*/ if (!strncmp ("pib" , c,3 )) { pow =5 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; }else if (!strncmp ("tib" , c,3 )) { pow =4 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; }else if (!strncmp ("gib" , c,3 )) { pow =3 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; }else if (!strncmp ("mib" , c,3 )) { pow =2 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; }else if (!strncmp ("kib" , c,3 )) { pow =1 ; - mult =1000 ; - }else if (!strncmp ("p" , c,1 ) || !strncmp ("pb" , c,2 )) +if (kb_base ==1000 ) + mult =1024 ; + }else if (!strncmp ("p" , c,1 ) || !strncmp ("pb" , c,2 )) { pow =5 ; -else if (!strncmp ("t" , c,1 ) || !strncmp ("tb" , c,2 )) +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("t" , c,1 ) || !strncmp ("tb" , c,2 )) { pow =4 ; -else if (!strncmp ("g" , c,1 ) || !strncmp ("gb" , c,2 )) +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("g" , c,1 ) || !strncmp ("gb" , c,2 )) { pow =3 ; -else if (!strncmp ("m" , c,1 ) || !strncmp ("mb" , c,2 )) +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("m" , c,1 ) || !strncmp ("mb" , c,2 )) { pow =2 ; -else if (!strncmp ("k" , c,1 ) || !strncmp ("kb" , c,2 )) +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("k" , c,1 ) || !strncmp ("kb" , c,2 )) { pow =1 ; -else if (!strncmp ("%" , c,1 )) { +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("%" , c,1 )) { *percent =1 ;free (c);return ret;
stat.c +55 -36
171 lines not on this page · raw message
Signature · 1 line
2.9.3
Quoted 6 lines
-----Original Message-----
From: Elliott, Robert (Persistent Memory)
Sent: Thursday, December 22, 2016 12:09 AM
Subject: [PATCH 11/12] Improve IEC binary and SI decimal prefix handling
...
Quoted 22 lines
parse.c +7
-3@@ -207,32 +207,50 @@ static unsigned long long __get_mult_bytes(const char *p, void *data, } } +/* If kb_base is 1000, use true units. +* If kb_base is 1024, use opposite units. +*/ if (!strncmp ("pib" , c,3 )) { pow =5 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; }else if (!strncmp ("tib" , c,3 )) { pow =4 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; }else if (!strncmp ("gib" , c,3 )) { pow =3 ; - mult =1000 ;
parse.c static unsigned long long · line 225
Quoted 10 lines
parse.c +4
-2+if (kb_base ==1000 ) + mult =1024 ; }else if (!strncmp ("mib" , c,3 )) { pow =2 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; }else if (!strncmp ("kib" , c,3 )) { pow =1 ; - mult =1000 ;
The following added if statements are in the wrong place and really belong above. Corrected in v2.
Quoted 32 lines
parse.c +18
-6- }else if (!strncmp ("p" , c,1 ) || !strncmp ("pb" , c,2 )) +if (kb_base ==1000 ) + mult =1024 ; + }else if (!strncmp ("p" , c,1 ) || !strncmp ("pb" , c,2 )) { pow =5 ; -else if (!strncmp ("t" , c,1 ) || !strncmp ("tb" , c,2 )) +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("t" , c,1 ) || !strncmp ("tb" , c,2 )) { pow =4 ; -else if (!strncmp ("g" , c,1 ) || !strncmp ("gb" , c,2 )) +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("g" , c,1 ) || !strncmp ("gb" , c,2 )) { pow =3 ; -else if (!strncmp ("m" , c,1 ) || !strncmp ("mb" , c,2 )) +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("m" , c,1 ) || !strncmp ("mb" , c,2 )) { pow =2 ; -else if (!strncmp ("k" , c,1 ) || !strncmp ("kb" , c,2 )) +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("k" , c,1 ) || !strncmp ("kb" , c,2 )) { pow =1 ; -else if (!strncmp ("%" , c,1 )) { +if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("%" , c,1 )) { *percent =1 ;free (c);return ret;
PATCH 12/12 Documentation for IEC binary and SI decimal prefix handling
In reply to Robert ElliottDocumentation for the previous patch improving IEC and SI decimal prefix handling (e.g., KiB, MiB, GiB vs. KB, MB, GB).
Includes updates to int, kb_base, and the parameters using int to express quantities of data (e.g., bs, ba, bsrange, bssplit).
Includes updates to parameters that accept comma-separated values (usually ints) for reads, writes, and trims; trims were often not mentioned.
--- HOWTO | 292 ++++++++++++++++++++++++++++++++++++++++++------------------------ fio.1 | 193 +++++++++++++++++++++++++++++-------------- 2 files changed, 320 insertions(+), 165 deletions(-)
HOWTO +187 -105
@@ -116,7 +116,7 @@ section residing above it. If the first character in a line is a ';' or a '#', the entire line is discarded as a comment. So let's look at a really simple job file that defines two processes, each -randomly reading from a 128MB file. +randomly reading from a 128MiB file. ; -- start job file -- [global]
@@ -154,9 +154,9 @@ numjobs=4 Here we have no global section, as we only have one job defined anyway. We want to use async io here, with a depth of 4 for each file. We also -increased the buffer size used to 32KB and define numjobs to 4 to +increased the buffer size used to 32KiB and define numjobs to 4 to fork 4 identical jobs. The result is 4 processes each randomly writing -to their own 64MB file. Instead of using the above job file, you could +to their own 64MiB file. Instead of using the above job file, you could have given the parameters on the command line. For this case, you would specify:
@@ -276,20 +276,70 @@ time Integer with possible time suffix. In seconds unless otherwise specified, use eg 10m for 10 minutes. Accepts s/m/h for seconds, minutes, and hours, and accepts 'ms' (or 'msec') for milliseconds, and 'us' (or 'usec') for microseconds. -int SI integer. A whole number value, which may contain a suffix - describing the base of the number. Accepted suffixes are k/m/g/t/p, - meaning kilo, mega, giga, tera, and peta. The suffix is not case - sensitive, and you may also include trailing 'b' (eg 'kb' is the same - as 'k'). So if you want to specify 4096, you could either write - out '4096' or just give 4k. The suffixes signify base 2 values, so - 1024 is 1k and 1024k is 1m and so on, unless the suffix is explicitly - set to a base 10 value using 'kib', 'mib', 'gib', etc. If that is the - case, then 1000 is used as the multiplier. This can be handy for - disks, since manufacturers generally use base 10 values when listing - the capacity of a drive. If the option accepts an upper and lower - range, use a colon ':' or minus '-' to separate such values. May also - include a prefix to indicate numbers base. If 0x is used, the number - is assumed to be hexadecimal. See irange. + +int Integer. A whole number value, which may contain an integer prefix + and an integer suffix. + [integer prefix]number[integer suffix] + + The optional integer prefix specifies the number's base. The default + is decimal. 0x specifies hexadecimal. + + The optional integer suffix specifies the number's units, and includes + an optional unit prefix and an optional unit. For quantities of data, + the default unit is bytes. For quantities of time, the default unit + is seconds. + + With kb_base=1000, fio follows international standards for unit prefixes. + To specify power-of-10 decimal values defined in the International + System of Units (SI): + Ki means kilo (K) or 1000 + Mi means mega (M) or 1000**2 + Gi means giga (G) or 1000**3 + Ti means tera (T) or 1000**4 + Pi means peta (P) or 1000**5 + + To specify power-of-2 binary values defined in IEC 80000-13: + k means kibi (Ki) or 1024 + M means mebi (Mi) or 1024**2 + G means gibi (Gi) or 1024**3 + T means tebi (Ti) or 1024**4 + P means pebi (Pi) or 1024**5 + + With kb_base=1024 (the default), the unit prefixes are opposite from + those specified in the SI and IEC 80000-13 standards to provide + compatibility with old scripts. For example, 4k means 4096. + + For quantities of data, an optional unit of 'B' may be included + (e.g., 'kB' is the same as 'k'). + + The integer suffix is not case sensitive (e.g., m/mi mean mebi/mega, + not milli). 'b' and 'B' both mean byte, not bit. + + Examples with kb_base=1000: + 4 KiB: 4096, 4096b, 4096B, 4ki, 4kib, 4kiB, 4Ki, 4KiB + 1 MiB: 1048576, 1mi, 1024ki + 1 MB: 1000000, 1m, 1000k + 1 TiB: 1073741824, 1ti, 1024mi, 1048576ki + 1 TB: 1000000000, 1t, 1000m, 1000000k + + Examples with kb_base=1024 (default): + 4 KiB: 4096, 4096b, 4096B, 4k, 4kb, 4kB, 4K, 4KB + 1 MiB: 1048576, 1m, 1024k + 1 MB: 1000000, 1mi, 1000ki + 1 TiB: 1073741824, 1t, 1024m, 1048576k + 1 TB: 1000000000, 1ti, 1000mi, 1000000ki + + To specify times (units are not case sensitive): + D means days + H means hours + M mean minutes + s or sec means seconds (default) + ms or msec means milliseconds + us or usec means microseconds + + If the option accepts an upper and lower range, use a colon ':' or + minus '-' to separate such values. See irange. + bool Boolean. Usually parsed as an integer, however only defined for true and false (1 and 0). irange Integer range with suffix. Allows value range to be given, such
@@ -439,10 +489,24 @@ rw_sequencer=str If an offset modifier is given by appending a number to the same offset 8 number of times before generating a new offset. -kb_base=int The base unit for a kilobyte. The defacto base is 2^10, 1024. - Storage manufacturers like to use 10^3 or 1000 as a base - ten unit instead, for obvious reasons. Allow values are - 1024 or 1000, with 1024 being the default. +kb_base=int Select the interpretation of unit prefixes in input parameters. + 1000 = Inputs comply with IEC 80000-13 and the International + System of Units (SI). Use: + - power-of-2 values with IEC prefixes (e.g., KiB) + - power-of-10 values with SI prefixes (e.g., kB) + 1024 = Compatibility mode (default). To avoid breaking + old scripts: + - power-of-2 values with SI prefixes + - power-of-10 values with IEC prefixes + See bs= for more details on input parameters. + + Outputs always use correct prefixes. Most outputs include + both side-by-side, like: + bw=2383.3kB/s (2327.4KiB/s) + If only one value is reported, then kb_base selects the + one to use: + 1000 = SI prefixes + 1024 = IEC prefixes unified_rw_reporting=bool Fio normally reports statistics on a per data direction basis, meaning that reads, writes, and trims are
@@ -510,11 +574,11 @@ io_limit=int Normally fio operates within the region set by 'size', which means that the 'size' option sets both the region and size of IO to be performed. Sometimes that is not what you want. With this option, it is possible to define just the amount of IO - that fio should do. For instance, if 'size' is set to 20G and - 'io_size' is set to 5G, fio will perform IO within the first - 20G but exit when 5G have been done. The opposite is also - possible - if 'size' is set to 20G, and 'io_size' is set to - 40G, then fio will do 40G of IO within the 0..20G region. + that fio should do. For instance, if 'size' is set to 20GiB and + 'io_size' is set to 5GiB, fio will perform IO within the first + 20GiB but exit when 5GiB have been done. The opposite is also + possible - if 'size' is set to 20GiB, and 'io_size' is set to + 40GiB, then fio will do 40GiB of IO within the 0..20GiB region. filesize=int Individual file sizes. May be a range, in which case fio will select sizes for files at random within the given range
@@ -537,36 +601,36 @@ fill_fs=bool Sets size to something really large and waits for ENOSPC (no Additionally, writing beyond end-of-device will not return ENOSPC there. -blocksize=int -bs=int The block size used for the io units. Defaults to 4k. Values - can be given for both read and writes. If a single int is - given, it will apply to both. If a second int is specified - after a comma, it will apply to writes only. In other words, - the format is either bs=read_and_write or bs=read,write,trim. - bs=4k,8k will thus use 4k blocks for reads, 8k blocks for - writes, and 8k for trims. You can terminate the list with - a trailing comma. bs=4k,8k, would use the default value for - trims.. If you only wish to set the write size, you - can do so by passing an empty read size - bs=,8k will set - 8k for writes and leave the read default value. - -blockalign=int -ba=int At what boundary to align random IO offsets. Defaults to - the same as 'blocksize' the minimum blocksize given. - Minimum alignment is typically 512b for using direct IO, - though it usually depends on the hardware block size. This - option is mutually exclusive with using a random map for - files, so it will turn off that option. - -blocksize_range=irange -bsrange=irange Instead of giving a single block size, specify a range - and fio will mix the issued io block sizes. The issued - io unit will always be a multiple of the minimum value - given (also see bs_unaligned). Applies to both reads and - writes, however a second range can be given after a comma. - See bs=. - -bssplit=str Sometimes you want even finer grained control of the +blocksize=int[,int][,int] +bs=int[,int][,int] + The block size in bytes used for I/O units. Default: 4096. + A single value applies to reads, writes, and trims. + Comma-separated values may be specified for reads, writes, + and trims. A value not terminated in a comma applies to + subsequent types. + + Examples: + bs=256k means 256k for reads, writes and trims + bs=8k,32k means 8k for reads, 32k for writes and trims + bs=8k,32k, means 8k for reads, 32k for writes, and + default for trims + bs=,8k means default for reads, 8k for writes and trims + bs=,8k, means default for reads, 8k for writes, and + default for writes + +blocksize_range=irange[,irange][,irange] +bsrange=irange[,irange][,irange] + A range of block sizes in bytes for I/O units. + The issued I/O unit will always be a multiple of the minimum + size, unless blocksize_unaligned is set. + + Comma-separated ranges may be specified for reads, writes, + and trims as described in 'blocksize'. + + Example: bsrange=1k-4k,2k-8k + +bssplit=str[,str][,str] + Sometimes you want even finer grained control of the block sizes issued, not just an even split between them. This option allows you to weight various block sizes, so that you are able to define a specific amount of
@@ -590,24 +654,37 @@ bssplit=str Sometimes you want even finer grained control of the always add up to 100, if bssplit is given a range that adds up to more, it will error out. - bssplit also supports giving separate splits to reads and - writes. The format is identical to what bs= accepts. You - have to separate the read and write parts with a comma. So - if you want a workload that has 50% 2k reads and 50% 4k reads, + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. + + If you want a workload that has 50% 2k reads and 50% 4k reads, while having 90% 4k writes and 10% 8k writes, you would specify: bssplit=2k/50:4k/50,4k/90:8k/10 blocksize_unaligned -bs_unaligned If this option is given, any byte size value within bsrange - may be used as a block range. This typically wont work with - direct IO, as that normally requires sector alignment. +bs_unaligned If set, fio will issue I/O units with any size within + blocksize_range, not just multiples of the minimum size. + This typically won't work with direct I/O, as that normally + requires sector alignment. bs_is_seq_rand If this option is set, fio will use the normal read,write - blocksize settings as sequential,random instead. Any random - read or write will use the WRITE blocksize settings, and any - sequential read or write will use the READ blocksize setting. + blocksize settings as sequential,random blocksize settings + instead. Any random read or write will use the WRITE blocksize + settings, and any sequential read or write will use the READ + blocksize settings. + +blockalign=int[,int][,int] +ba=int[,int][,int] + Boundary to which fio will align random I/O units. + Default: 'blocksize'. + Minimum alignment is typically 512b for using direct IO, + though it usually depends on the hardware block size. This + option is mutually exclusive with using a random map for + files, so it will turn off that option. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. zero_buffers If this option is given, fio will init the IO buffers to all zeroes. The default is to fill them with random data.
@@ -837,7 +914,7 @@ ioengine=str Defines how the job issues io to the file. The following filename, eg ioengine=external:/tmp/foo.o to load ioengine foo.o in /tmp. -iodepth=int This defines how many io units to keep in flight against +iodepth=int This defines how many I/O units to keep in flight against the file. The default is 1 for each file defined in this job, can be overridden with a larger value for higher concurrency. Note that increasing iodepth beyond 1 will not
@@ -990,7 +1067,8 @@ rwmixwrite=int How large a percentage of the mix should be writes. If both if fio is asked to limit reads or writes to a certain rate. If that is the case, then the distribution may be skewed. -random_distribution=str:float By default, fio will use a completely uniform +random_distribution=str:float[,str:float][,str:float] + By default, fio will use a completely uniform random distribution when asked to perform random IO. Sometimes it is useful to skew the distribution in specific ways, ensuring that some parts of the data is more hot than others.
@@ -1032,14 +1110,15 @@ random_distribution=str:float By default, fio will use a completely uniform specify separate zones for reads, writes, and trims. If just one set is given, it'll apply to all of them. -percentage_random=int For a random workload, set how big a percentage should +percentage_random=int[,int][,int] + For a random workload, set how big a percentage should be random. This defaults to 100%, in which case the workload is fully random. It can be set from anywhere from 0 to 100. Setting it to 0 would make the workload fully sequential. Any setting in between will result in a random mix of sequential - and random IO, at the given percentages. It is possible to - set different values for reads, writes, and trim. To do so, - simply use a comma separated list. See blocksize. + and random IO, at the given percentages. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. norandommap Normally fio will cover every block of the file when doing random IO. If this option is given, fio will just get a
@@ -1111,29 +1190,32 @@ thinktime_blocks=int other words, this setting effectively caps the queue depth if the latter is larger. -rate=int Cap the bandwidth used by this job. The number is in bytes/sec, - the normal suffix rules apply. You can use rate=500k to limit - reads and writes to 500k each, or you can specify read and - writes separately. Using rate=1m,500k would limit reads to - 1MB/sec and writes to 500KB/sec. Capping only reads or - writes can be done with rate=,500k or rate=500k,. The former - will only limit writes (to 500KB/sec), the latter will only - limit reads. - -rate_min=int Tell fio to do whatever it can to maintain at least this - bandwidth. Failing to meet this requirement, will cause - the job to exit. The same format as rate is used for - read vs write separation. - -rate_iops=int Cap the bandwidth to this number of IOPS. Basically the same +rate=int[,int][,int] + Cap the bandwidth used by this job. The number is in bytes/sec, + the normal suffix rules apply. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. + +rate_min=int[,int][,int] + Tell fio to do whatever it can to maintain at least this + bandwidth. Failing to meet this requirement will cause + the job to exit. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. + +rate_iops=int[,int][,int] + Cap the bandwidth to this number of IOPS. Basically the same as rate, just specified independently of bandwidth. If the job is given a block size range instead of a fixed value, - the smallest block size is used as the metric. The same format - as rate is used for read vs write separation. + the smallest block size is used as the metric. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. -rate_iops_min=int If fio doesn't meet this rate of IO, it will cause - the job to exit. The same format as rate is used for read vs - write separation. +rate_iops_min=int[,int][,int] + If fio doesn't meet this rate of IO, it will cause + the job to exit. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. rate_process=str This option controls how fio manages rated IO submissions. The default is 'linear', which submits IO in a
@@ -1280,7 +1362,7 @@ sync=bool Use sync io for buffered writes. For the majority of the io engines, this means using O_SYNC. iomem=str -mem=str Fio can use various types of memory as the io unit buffer. +mem=str Fio can use various types of memory as the I/O unit buffer. The allowed values are: malloc Use memory from malloc(3) as the buffers.
@@ -1308,7 +1390,7 @@ mem=str Fio can use various types of memory as the io unit buffer. that for shmhuge and mmaphuge to work, the system must have free huge pages allocated. This can normally be checked and set by reading/writing /proc/sys/vm/nr_hugepages on a - Linux system. Fio assumes a huge page is 4MB in size. So + Linux system. Fio assumes a huge page is 4MiB in size. So to calculate the number of huge pages you need for a given job file, add up the io depth of all jobs (normally one unless iodepth= is used) and multiply by the maximum bs set. Then
@@ -1322,7 +1404,7 @@ mem=str Fio can use various types of memory as the io unit buffer. you would use mem=mmaphuge:/huge/somefile. iomem_align=int This indicates the memory alignment of the IO memory buffers. - Note that the given alignment is applied to the first IO unit + Note that the given alignment is applied to the first I/O unit buffer, if using iodepth the alignment of the following buffers are given by the bs used. In other words, if using a bs that is a multiple of the page sized in the system, all buffers will
@@ -1332,7 +1414,7 @@ iomem_align=int This indicates the memory alignment of the IO memory buffers. hugepage-size=int Defines the size of a huge page. Must at least be equal - to the system setting, see /proc/meminfo. Defaults to 4MB. + to the system setting, see /proc/meminfo. Defaults to 4MiB. Should probably always be a multiple of megabytes, so using hugepage-size=Xm is the preferred way to set this to avoid setting a non-pow-2 bad value.
@@ -2024,7 +2106,7 @@ be the starting port number since fio will use a range of ports. fio spits out a lot of output. While running, fio will display the status of the jobs created. An example of that would be: -Threads: 1: [_r] [24.8% done] [ 13509/ 8334 kb/s] [eta 00h:01m:31s] +Jobs: 1: [_r] [24.8% done] [r=20992KiB/s,w=24064KiB/s,t=0KiB/s] [r=82,w=94,t=0 iops] [eta 00h:01m:31s] The characters inside the square brackets denote the current status of each thread. The possible values (in typical life cycle order) are:
@@ -2053,7 +2135,7 @@ Fio will condense the thread string as not to take up more space on the command line as is needed. For instance, if you have 10 readers and 10 writers running, the output would look like this: -Jobs: 20 (f=20): [R(10),W(10)] [4.0% done] [2103MB/0KB/0KB /s] [538K/0/0 iops] [eta 57m:36s] +Jobs: 20 (f=20): [R(10),W(10)] [4.0% done] [r=20992KiB/s,w=24064KiB/s,t=0KiB/s] [r=82,w=94,t=0 iops] [eta 57m:36s] Fio will still maintain the ordering, though. So the above means that jobs 1..10 are readers, and 11..20 are writers.
@@ -2071,10 +2153,10 @@ each thread, group of threads, and disks in that order. For each data direction, the output looks like: Client1 (g=0): err= 0: - write: io= 32MB, bw= 666KB/s, iops=89 , runt= 50320msec + write: io= 32MiB, bw= 666KiB/s, iops=89 , runt= 50320msec slat (msec): min= 0, max= 136, avg= 0.03, stdev= 1.92 clat (msec): min= 0, max= 631, avg=48.50, stdev=86.82 - bw (KB/s) : min= 0, max= 1196, per=51.00%, avg=664.02, stdev=681.68 + bw (KiB/s) : min= 0, max= 1196, per=51.00%, avg=664.02, stdev=681.68 cpu : usr=1.49%, sys=0.25%, ctx=7969, majf=0, minf=17 IO depths : 1=0.1%, 2=0.3%, 4=0.5%, 8=99.0%, 16=0.0%, 32=0.0%, >32=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
@@ -2193,19 +2275,19 @@ Split up, the format is as follows: terse version, fio version, jobname, groupid, error READ status: - Total IO (KB), bandwidth (KB/sec), IOPS, runtime (msec) + Total IO (KiB), bandwidth (KiB/sec), IOPS, runtime (msec) Submission latency: min, max, mean, stdev (usec) Completion latency: min, max, mean, stdev (usec) Completion latency percentiles: 20 fields (see below) Total latency: min, max, mean, stdev (usec) - Bw (KB/s): min, max, aggregate percentage of total, mean, stdev + Bw (KiB/s): min, max, aggregate percentage of total, mean, stdev WRITE status: - Total IO (KB), bandwidth (KB/sec), IOPS, runtime (msec) + Total IO (KiB), bandwidth (KiB/sec), IOPS, runtime (msec) Submission latency: min, max, mean, stdev (usec) Completion latency: min, max, mean, stdev(usec) Completion latency percentiles: 20 fields (see below) Total latency: min, max, mean, stdev (usec) - Bw (KB/s): min, max, aggregate percentage of total, mean, stdev + Bw (KiB/s): min, max, aggregate percentage of total, mean, stdev CPU usage: user, system, context switches, major faults, minor faults IO depths: <=1, 2, 4, 8, 16, 32, >=64 IO latencies microseconds: <=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000
@@ -2396,7 +2478,7 @@ Time for the log entry is always in milliseconds. The value logged depends on the type of log, it will be one of the following: Latency log Value is latency in usecs - Bandwidth log Value is in KB/sec + Bandwidth log Value is in KiB/sec IOPS log Value is IOPS Data direction is one of the following:
fio.1 +133 -60
279 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH v2 1/12 Avoid using units in option defaults
In reply to Robert ElliottFrom: Robert Elliott <[email protected]>
Change option defaults and some generated option strings to specify the number of bytes without units, so they are immune to the interpretation of the units (e.g. is 1M interpreted as 1048576 or 1000000).
--- options.c | 2 +- profiles/act.c | 6 +++--- profiles/tiobench.c | 2 +- unit_tests/steadystate_tests.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
options.c +1 -1
@@ -1965,7 +1965,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .off3 = offsetof(struct thread_options, bs[DDIR_TRIM]), .minval = 1, .help = "Block size unit", - .def = "4k", + .def = "4096", .parent = "rw", .hide = 1, .interval = 512,
profiles/act.c +3 -3
@@ -144,7 +144,7 @@ static struct fio_option options[] = { .type = FIO_OPT_INT, .off1 = offsetof(struct act_options, write_size), .help = "Size of large block ops (writes)", - .def = "128k", + .def = "131072", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_ACT, },
@@ -220,7 +220,7 @@ static int act_add_dev_prep(const char *dev)return 1 ;if (act_add_opt ("filename=%s" , dev))return 1 ; -if (act_add_opt ("bs=1M" )) +if (act_add_opt ("bs=1048576" ))return 1 ;if (act_add_opt ("zero_buffers" ))return 1 ;
@@ -234,7 +234,7 @@ static int act_add_dev_prep(const char *dev)return 1 ;if (act_add_opt ("filename=%s" , dev))return 1 ; -if (act_add_opt ("bs=4k" )) +if (act_add_opt ("bs=4096" ))return 1 ;if (act_add_opt ("ioengine=libaio" ))return 1 ;
profiles/tiobench.c +1 -1
@@ -49,7 +49,7 @@ static struct fio_option options[] = { .type = FIO_OPT_INT, .off1 = offsetof(struct tiobench_options, bs), .help = "Block size in bytes", - .def = "4k", + .def = "4096", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_TIOBENCH, },
unit_tests/steadystate_tests.py +1 -1
@@ -115,7 +115,7 @@ if __name__ == '__main__': if args.read == None: if os.name == 'posix': args.read = '/dev/zero' - extra = [ "--size=128M" ] + extra = [ "--size=134217728" ] # 128 MiB else: print "ERROR: file for read testing must be specified on non-posix systems" sys.exit(1)
Signature · 1 line
2.9.3
PATCH v2 2/12 gfio: Improve IOPS textbox labels
From: Robert Elliott <[email protected]>
Change the three textboxes labeled IOPS to Read IOPS, Write IOPS, and Trim IOPS, add Trim to the Blocksize label, and fix Steve's last name in the Credits.
--- gfio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
gfio.c +5 -5
@@ -1215,7 +1215,7 @@ static void about_dialog(GtkWidget *w, gpointer data) {const char *authors[] = {"Jens Axboe <[email protected]>" , -"Stephen Carmeron <[email protected]>" , +"Stephen Cameron <[email protected]>" ,NULL };const char *license[] = {
@@ -1386,7 +1386,7 @@ static GtkWidget *new_client_page(struct gui_entry *ge)g_signal_connect (ge->eta.names,"changed" ,G_CALLBACK (combo_entry_changed), ge);g_signal_connect (ge->eta.names,"destroy" ,G_CALLBACK (combo_entry_destroy), ge); ge->eta.iotype.entry =new_info_entry_in_frame (probe_box,"IO" ); - ge->eta.bs.entry =new_info_entry_in_frame (probe_box,"Blocksize (Read/Write)" ); + ge->eta.bs.entry =new_info_entry_in_frame (probe_box,"Blocksize (Read/Write/Trim)" ); ge->eta.ioengine.entry =new_info_entry_in_frame (probe_box,"IO Engine" ); ge->eta.iodepth.entry =new_info_entry_in_frame (probe_box,"IO Depth" ); ge->eta.jobs =new_info_entry_in_frame (probe_box,"Jobs" );
@@ -1395,11 +1395,11 @@ static GtkWidget *new_client_page(struct gui_entry *ge) probe_box =gtk_hbox_new (FALSE,3 );gtk_box_pack_start (GTK_BOX (probe_frame), probe_box, FALSE, FALSE,3 ); ge->eta.read_bw =new_info_entry_in_frame_rgb (probe_box,"Read BW" ,GFIO_READ_R ,GFIO_READ_G ,GFIO_READ_B ); - ge->eta.read_iops =new_info_entry_in_frame_rgb (probe_box,"IOPS" ,GFIO_READ_R ,GFIO_READ_G ,GFIO_READ_B ); + ge->eta.read_iops =new_info_entry_in_frame_rgb (probe_box,"Read IOPS" ,GFIO_READ_R ,GFIO_READ_G ,GFIO_READ_B ); ge->eta.write_bw =new_info_entry_in_frame_rgb (probe_box,"Write BW" ,GFIO_WRITE_R ,GFIO_WRITE_G ,GFIO_WRITE_B ); - ge->eta.write_iops =new_info_entry_in_frame_rgb (probe_box,"IOPS" ,GFIO_WRITE_R ,GFIO_WRITE_G ,GFIO_WRITE_B ); + ge->eta.write_iops =new_info_entry_in_frame_rgb (probe_box,"Write IOPS" ,GFIO_WRITE_R ,GFIO_WRITE_G ,GFIO_WRITE_B ); ge->eta.trim_bw =new_info_entry_in_frame_rgb (probe_box,"Trim BW" ,GFIO_TRIM_R ,GFIO_TRIM_G ,GFIO_TRIM_B ); - ge->eta.trim_iops =new_info_entry_in_frame_rgb (probe_box,"IOPS" ,GFIO_TRIM_R ,GFIO_TRIM_G ,GFIO_TRIM_B ); + ge->eta.trim_iops =new_info_entry_in_frame_rgb (probe_box,"Trim IOPS" ,GFIO_TRIM_R ,GFIO_TRIM_G ,GFIO_TRIM_B );/* * Only add this if we have a commit rate
Signature · 1 line
2.9.3
PATCH v2 3/12 Document trim workload choices and other nits
In reply to Robert ElliottAdd some missing trim workloads (rw=trim, randtrim) to HOWTO, improve some wording about trims in HOWTO, fio.1 (the manpage), and the help text in options.c.
--- HOWTO | 7 ++++--- fio.1 | 12 ++++++------ options.c | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-)
HOWTO +4 -3
@@ -398,12 +398,13 @@ rw=str Type of io pattern. Accepted values are: read Sequential reads write Sequential writes + trim Sequential trims randwrite Random writes randread Random reads + randtrim Random trims rw,readwrite Sequential mixed reads and writes randrw Random mixed reads and writes - trimwrite Mixed trims and writes. Blocks will be - trimmed first, then written to. + trimwrite Sequential trim+write sequences Fio defaults to read if the option is not specified. For the mixed io types, the default is to split them 50/50.
@@ -444,7 +445,7 @@ kb_base=int The base unit for a kilobyte. The defacto base is 2^10, 1024. 1024 or 1000, with 1024 being the default. unified_rw_reporting=bool Fio normally reports statistics on a per - data direction basis, meaning that read, write, and trim are + data direction basis, meaning that reads, writes, and trims are accounted and reported separately. If this option is set, the fio will sum the results and report them as "mixed" instead.
fio.1 +6 -6
@@ -287,7 +287,7 @@ Sequential reads. Sequential writes. .TP .B trim -Sequential trim (Linux block devices only). +Sequential trims (Linux block devices only). .TP .B randread Random reads.
@@ -296,7 +296,7 @@ Random reads. Random writes. .TP .B randtrim -Random trim (Linux block devices only). +Random trims (Linux block devices only). .TP .B rw, readwrite Mixed sequential reads and writes.
@@ -305,8 +305,8 @@ Mixed sequential reads and writes. Mixed random reads and writes. .TP .B trimwrite -Trim and write mixed workload. Blocks will be trimmed first, then the same -blocks will be written to. +Sequential trim and write mixed workload. Blocks will be trimmed first, then +the same blocks will be written to. .RE .P Fio defaults to read if the option is not specified.
@@ -353,7 +353,7 @@ reasons. Allowed values are 1024 or 1000, with 1024 being the default. .TP .BI unified_rw_reporting \fR=\fPbool Fio normally reports statistics on a per data direction basis, meaning that -read, write, and trim are accounted and reported separately. If this option is +reads, writes, and trims are accounted and reported separately. If this option is set fio sums the results and reports them as "mixed" instead. .TP .BI randrepeat \fR=\fPbool
@@ -735,7 +735,7 @@ properly. Read, write and erase an MTD character device (e.g., /dev/mtd0). Discards are treated as erases. Depending on the underlying device type, the I/O may have to go in a certain pattern, e.g., on NAND, writing sequentially to erase blocks -and discarding before overwriting. The writetrim mode works well for this +and discarding before overwriting. The trimwrite mode works well for this constraint. .TP .B pmemblk
options.c +2 -2
@@ -2885,7 +2885,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .off1 = offsetof(struct thread_options, trim_percentage), .minval = 0, .maxval = 100, - .help = "Number of verify blocks to discard/trim", + .help = "Number of verify blocks to trim (i.e., discard)", .parent = "verify", .def = "0", .interval = 1,
@@ -2897,7 +2897,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .name = "trim_verify_zero", .lname = "Verify trim zero", .type = FIO_OPT_BOOL, - .help = "Verify that trim/discarded blocks are returned as zeroes", + .help = "Verify that trimmed (i.e., discarded) blocks are returned as zeroes", .off1 = offsetof(struct thread_options, trim_zero), .parent = "trim_percentage", .hide = 1,
Signature · 1 line
2.9.3
PATCH v2 4/12 tests, profiles: Use IEC prefixes for binary multiples
In reply to Robert ElliottUse IEC 80000-13 prefixes for binary multiples of bytes (KiB, MiB, etc.) rather than SI prefixes for decimal multiples of bytes (KB, MB, etc.) in places in which the code has fixed divide by 1024, 1024*1024, >>20, etc. and is clearly always using binary multiples.
--- crc/test.c | 4 ++-- profiles/act.c | 8 ++++---- profiles/tiobench.c | 4 ++-- t/btrace2fio.c | 18 +++++++++--------- t/dedupe.c | 2 +- t/genzipf.c | 13 +++++++------ t/lfsr-test.c | 2 +- t/memlock.c | 14 +++++++------- t/read-to-pipe-async.c | 4 ++-- 9 files changed, 35 insertions(+), 34 deletions(-)
crc/test.c +2 -2
@@ -338,9 +338,9 @@ int fio_crctest(const char *type)sprintf (pre,"\t" ); else sprintf(pre, "\t\t"); - printf("%s:%s%8.2f MB/sec\n", t[i].name, pre, mb_sec); + printf("%s:%s%8.2f MiB/sec\n", t[i].name, pre, mb_sec); }else -printf ("%s:inf MB/sec\n" , t[i].name); +printf ("%s:inf MiB/sec\n" , t[i].name); first =0 ; }
profiles/act.c +4 -4
@@ -130,20 +130,20 @@ static struct fio_option options[] = { }, { .name = "read-req-num-512-blocks", - .lname = "Number of 512b blocks to read", + .lname = "Number of 512B blocks to read", .type = FIO_OPT_INT, .off1 = offsetof(struct act_options, num_read_blocks), - .help = "Number of 512b blocks to read at the time", + .help = "Number of 512B blocks to read at the time", .def = "3", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_ACT, }, { .name = "large-block-op-kbytes", - .lname = "Size of large block ops (writes)", + .lname = "Size of large block ops in KiB (writes)", .type = FIO_OPT_INT, .off1 = offsetof(struct act_options, write_size), - .help = "Size of large block ops (writes)", + .help = "Size of large block ops in KiB (writes)", .def = "131072", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_ACT,
profiles/tiobench.c +2 -2
@@ -39,7 +39,7 @@ static struct fio_option options[] = { .lname = "Tiobench size", .type = FIO_OPT_STR_VAL, .off1 = offsetof(struct tiobench_options, size), - .help = "Size in MB", + .help = "Size in MiB", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_TIOBENCH, },
@@ -91,7 +91,7 @@ static struct fio_option options[] = {static int tb_prep_cmdline (void ) {/* -* tiobench uses size as MB, so multiply up +* tiobench uses size as MiB, so multiply up */ size *=1024 *1024ULL ;if (size)
t/btrace2fio.c +9 -9
@@ -62,7 +62,7 @@ struct btrace_out {uint64_t first_ttime[DDIR_RWDIR_CNT ];uint64_t last_ttime[DDIR_RWDIR_CNT ]; -uint64_t kb[DDIR_RWDIR_CNT ]; +uint64_t kib[DDIR_RWDIR_CNT ];uint64_t start_delay; };
@@ -406,7 +406,7 @@ static int handle_trace(struct blk_io_trace *t, struct btrace_pid *p) i =inflight_find (t->sector + (t->bytes >>9 ));if (i) { - i->p->o.kb[t_to_rwdir (t)] += (t->bytes >>10 ); + i->p->o.kib[t_to_rwdir (t)] += (t->bytes >>10 ); i->p->o.complete_seen =1 ;inflight_remove (i); }
@@ -556,7 +556,7 @@ static int bs_cmp(const void *ba, const void *bb)return bsb->nr - bsa->nr; } -static unsigned long o_to_kb_rate (struct btrace_out *o,int rw) +static unsigned long o_to_kib_rate (struct btrace_out *o,int rw) {uint64_t usec = (o->last_ttime[rw] - o->first_ttime[rw]) /1000ULL ;uint64_t val;
@@ -568,7 +568,7 @@ static unsigned long o_to_kb_rate(struct btrace_out *o, int rw)if (!usec)return 0 ; - val = o->kb[rw] *1000ULL ; + val = o->kib[rw] *1000ULL ;return val / usec; }
@@ -623,7 +623,7 @@ static void __output_p_ascii(struct btrace_pid *p, unsigned long *ios)printf ("\tmerges: %lu (perc=%3.2f%%)\n" , o->merges[i], perc); perc = ((float ) o->seq[i] *100.0 ) / (float ) o->ios[i];printf ("\tseq: %lu (perc=%3.2f%%)\n" , (unsigned long ) o->seq[i], perc); -printf ("\trate: %lu KB/sec\n" ,o_to_kb_rate (o, i)); +printf ("\trate: %lu KiB/sec\n" ,o_to_kib_rate (o, i));for (j =0 ; j < o->nr_bs[i]; j++) {struct bs *bs = &o->bs[i][j];
@@ -746,7 +746,7 @@ static int __output_p_fio(struct btrace_pid *p, unsigned long *ios)for (i =0 ; i <DDIR_RWDIR_CNT ; i++) {unsigned long rate; - rate =o_to_kb_rate (o, i); + rate =o_to_kib_rate (o, i);if (i)printf ("," );if (rate)
@@ -810,7 +810,7 @@ static int prune_entry(struct btrace_out *o)for (i =0 ; i <DDIR_RWDIR_CNT ; i++) {unsigned long this_rate; - this_rate =o_to_kb_rate (o, i); + this_rate =o_to_kib_rate (o, i);if (this_rate < rate_threshold) {remove_ddir (o, i); this_rate =0 ;
@@ -926,7 +926,7 @@ static int merge_entries(struct btrace_pid *pida, struct btrace_pid *pidb) oa->ios[i] += ob->ios[i]; oa->merges[i] += ob->merges[i]; oa->seq[i] += ob->seq[i]; - oa->kb[i] += ob->kb[i]; + oa->kib[i] += ob->kib[i]; oa->first_ttime[i] =min (oa->first_ttime[i], ob->first_ttime[i]); oa->last_ttime[i] =max (oa->last_ttime[i], ob->last_ttime[i]);merge_bs (&oa->bs[i], &oa->nr_bs[i], ob->bs[i], ob->nr_bs[i]);
@@ -1021,7 +1021,7 @@ static int usage(char *argv[])log_err ("\t-n\tNumber IOS threshold to ignore task\n" );log_err ("\t-f\tFio job file output\n" );log_err ("\t-d\tUse this file/device for replay\n" ); -log_err ("\t-r\tIgnore jobs with less than this KB/sec rate\n" ); +log_err ("\t-r\tIgnore jobs with less than this KiB/sec rate\n" );log_err ("\t-R\tSet rate in fio job (def=%u)\n" , set_rate);log_err ("\t-D\tCap queue depth at this value (def=%u)\n" , max_depth);log_err ("\t-c\tCollapse \"identical\" jobs (def=%u)\n" , collapse_entries);
t/dedupe.c +1 -1
@@ -363,7 +363,7 @@ static void show_progress(struct worker_thread *threads, unsigned long total) tdiff =mtime_since_now (&last_tv);if (tdiff) { this_items = (this_items *1000 ) / (tdiff *1024 ); -printf ("%3.2f%% done (%luKB/sec)\r" , perc, this_items); +printf ("%3.2f%% done (%luKiB/sec)\r" , perc, this_items); last_nitems = nitems;fio_gettime (&last_tv,NULL ); }else
t/genzipf.c +7 -6
@@ -3,8 +3,8 @@* what an access pattern would look like. * * For instance, the following would generate a zipf distribution -* with theta 1.2, using 262144 (1 GB / 4096) values and split the reporting into -* 20 buckets: +* with theta 1.2, using 262144 (1 GiB / 4096) values and split the +* reporting into 20 buckets: * * ./t/fio-genzipf -t zipf -i 1.2 -g 1 -b 4096 -o 20 *
@@ -49,7 +49,7 @@ enum { };static int dist_type =TYPE_ZIPF ; -static unsigned long gb_size =500 ; +static unsigned long gib_size =500 ;static unsigned long block_size =4096 ;static unsigned long output_nranges =DEF_NR_OUTPUT ;static double percentage;
@@ -131,7 +131,7 @@ static int parse_options(int argc, char *argv[]) }break ;case 'g' : - gb_size =strtoul (optarg,NULL ,10 ); + gib_size =strtoul (optarg,NULL ,10 );break ;case 'i' : dist_val =atof (optarg);
@@ -291,9 +291,10 @@ int main(int argc, char *argv[])return 1 ;if (output_type !=OUTPUT_CSV ) -printf ("Generating %s distribution with %f input and %lu GB size and %lu block_size.\n" , dist_types[dist_type], dist_val, gb_size, block_size); +printf ("Generating %s distribution with %f input and %lu GiB size and %lu block_size.\n" , + dist_types[dist_type], dist_val, gib_size, block_size); - nranges = gb_size *1024 *1024 *1024ULL ; + nranges = gib_size *1024 *1024 *1024ULL ; nranges /= block_size;if (dist_type ==TYPE_ZIPF )
t/lfsr-test.c +1 -1
@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) v_size = numbers *sizeof (uint8_t ); v =malloc (v_size);memset (v,0 , v_size); -printf ("\nVerification table is %lf KBs\n" , (double )(v_size) /1024 ); +printf ("\nVerification table is %lf KiB\n" , (double )(v_size) /1024 ); } v_start = v;
t/memlock.c +7 -7
@@ -4,7 +4,7 @@#include <pthread.h> static struct thread_data { -unsigned long mb; +unsigned long mib; } td;static void *worker (void *data)
@@ -15,14 +15,14 @@ static void *worker(void *data)char *buf;int i, first =1 ; - size = td->mb *1024UL *1024UL ; + size = td->mib *1024UL *1024UL ; buf =malloc (size);for (i =0 ; i <100000 ; i++) {for (index =0 ; index +4096 < size; index +=4096 )memset (&buf[index+512 ],0x89 ,512 );if (first) { -printf ("loop%d: did %lu MB\n" , i+1 , size/(1024UL *1024UL )); +printf ("loop%d: did %lu MiB\n" , i+1 , size/(1024UL *1024UL )); first =0 ; } }
@@ -31,20 +31,20 @@ static void *worker(void *data)int main (int argc,char *argv[]) { -unsigned long mb, threads; +unsigned long mib, threads;pthread_t *pthreads;int i;if (argc <3 ) { -printf ("%s: <mb per thread> <threads>\n" , argv[0 ]); +printf ("%s: <MiB per thread> <threads>\n" , argv[0 ]);return 1 ; } - mb =strtoul (argv[1 ],NULL ,10 ); + mib =strtoul (argv[1 ],NULL ,10 ); threads =strtoul (argv[2 ],NULL ,10 ); pthreads =calloc (threads,sizeof (pthread_t)); - td.mb = mb; + td.mib = mib;for (i =0 ; i < threads; i++)pthread_create (&pthreads[i],NULL , worker, &td);
t/read-to-pipe-async.c +2 -2
@@ -661,9 +661,9 @@ int main(int argc, char *argv[]) bytes /=1024 ; rate = (bytes *1000UL *1000UL ) /utime_since (&s, &re); -fprintf (stderr,"Read rate (KB/sec) : %lu\n" , rate); +fprintf (stderr,"Read rate (KiB/sec) : %lu\n" , rate); rate = (bytes *1000UL *1000UL ) /utime_since (&s, &we); -fprintf (stderr,"Write rate (KB/sec): %lu\n" , rate); +fprintf (stderr,"Write rate (KiB/sec): %lu\n" , rate);close (fd);return 0 ;
Signature · 1 line
2.9.3
PATCH v2 5/12 Fix unit_base kb_base mixup in thread option conversion functions
In reply to Robert ElliottDon't set unit_base, which is 1 or 8, to kb_base, which is 1000 or 1024, during the convert functions used by the initial cconv test.
--- cconv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
cconv.c +2 -2
@@ -88,7 +88,7 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->td_ddir =le32_to_cpu (top->td_ddir); o->rw_seq =le32_to_cpu (top->rw_seq); o->kb_base =le32_to_cpu (top->kb_base); - o->unit_base =le32_to_cpu (top->kb_base); + o->unit_base =le32_to_cpu (top->unit_base); o->ddir_seq_nr =le32_to_cpu (top->ddir_seq_nr); o->ddir_seq_add =le64_to_cpu (top->ddir_seq_add); o->iodepth =le32_to_cpu (top->iodepth);
@@ -336,7 +336,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->td_ddir =cpu_to_le32 (o->td_ddir); top->rw_seq =cpu_to_le32 (o->rw_seq); top->kb_base =cpu_to_le32 (o->kb_base); - top->unit_base =cpu_to_le32 (o->kb_base); + top->unit_base =cpu_to_le32 (o->unit_base); top->ddir_seq_nr =cpu_to_le32 (o->ddir_seq_nr); top->iodepth =cpu_to_le32 (o->iodepth); top->iodepth_low =cpu_to_le32 (o->iodepth_low);
Signature · 1 line
2.9.3
PATCH v2 6/12 Line up colons across read, write, and trim thread stats
In reply to Robert ElliottLine up the colons across the read, write, and trim thread stats rows.
Example:drive_0: (groupid=0, jobs=576): err= 0: pid=42198: Wed Dec 21 19:51:35 2016
read : io=420642MB, bw=33953MB/s, iops=8289.3K, runt= 12389msec
write: io=325276MB, bw=26177MB/s, iops=6390.9K, runt= 12426msec
trim: io=0MB, bw=0MB/s, iops=0, runt= 12426msec
becomes:drive_0: (groupid=0, jobs=576): err= 0: pid=42198: Wed Dec 21 19:51:35 2016
read: io=420642MB, bw=33953MB/s, iops=8289.3K, runt= 12389msec
write: io=325276MB, bw=26177MB/s, iops=6390.9K, runt= 12426msec
trim: io=0MB, bw=0MB/s, iops=0, runt= 12426msec
--- stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
stat.c +1 -1
@@ -380,7 +380,7 @@ static void display_lat(const char *name, unsigned long min, unsigned long max,static void show_ddir_status (struct group_run_stats *rs,struct thread_stat *ts,int ddir,struct buf_output *out) { -const char *str[] = {"read " ,"write" ,"trim" }; +const char *str[] = {" read" ,"write" ," trim" };unsigned long min, max, runt;unsigned long long bw, iops;double mean, dev;
Signature · 1 line
2.9.3
PATCH v2 7/12 gclient: Delete unused code
In reply to Robert ElliottDelete two #if 0 blocks from pre-2012 that have old calls to num2str without the current number of arguments and hardcode "KB/s" units.
--- gclient.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-)
gclient.c +0 -40
@@ -364,26 +364,6 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *jsprintf (tmp,"%u" , je->files_open);gtk_entry_set_text (GTK_ENTRY (ge->eta.files), tmp); -#if 0 -if (je->m_rate[0 ] || je->m_rate[1 ] || je->t_rate[0 ] || je->t_rate[1 ]) { -if (je->m_rate || je->t_rate) { -char *tr, *mr; - - mr =num2str (je->m_rate,4 ,0 , i2p); - tr =num2str (je->t_rate,4 ,0 , i2p); - gtk_entry_set_text(GTK_ENTRY(ge->eta); - p +=sprintf (p,", CR=%s/%s KB/s" , tr, mr); -free (tr); -free (mr); - }else if (je->m_iops || je->t_iops) - p +=sprintf (p,", CR=%d/%d IOPS" , je->t_iops, je->m_iops); - -gtk_entry_set_text (GTK_ENTRY (ge->eta.cr_bw),"---" ); -gtk_entry_set_text (GTK_ENTRY (ge->eta.cr_iops),"---" ); -gtk_entry_set_text (GTK_ENTRY (ge->eta.cw_bw),"---" ); -gtk_entry_set_text (GTK_ENTRY (ge->eta.cw_iops),"---" ); -#endif -if (je->eta_sec !=INT_MAX && je->nr_running) {char *iops_str[DDIR_RWDIR_CNT ];char *rate_str[DDIR_RWDIR_CNT ];
@@ -457,26 +437,6 @@ static void gfio_update_all_eta(struct jobs_eta *je)eta_to_str (eta_str, je->eta_sec); } -#if 0 -if (je->m_rate[0 ] || je->m_rate[1 ] || je->t_rate[0 ] || je->t_rate[1 ]) { -if (je->m_rate || je->t_rate) { -char *tr, *mr; - - mr =num2str (je->m_rate,4 ,0 , i2p); - tr =num2str (je->t_rate,4 ,0 , i2p); - gtk_entry_set_text(GTK_ENTRY(ui->eta); - p +=sprintf (p,", CR=%s/%s KB/s" , tr, mr); -free (tr); -free (mr); - }else if (je->m_iops || je->t_iops) - p +=sprintf (p,", CR=%d/%d IOPS" , je->t_iops, je->m_iops); - -gtk_entry_set_text (GTK_ENTRY (ui->eta.cr_bw),"---" ); -gtk_entry_set_text (GTK_ENTRY (ui->eta.cr_iops),"---" ); -gtk_entry_set_text (GTK_ENTRY (ui->eta.cw_bw),"---" ); -gtk_entry_set_text (GTK_ENTRY (ui->eta.cw_iops),"---" ); -#endif -entry_set_int_value (ui->eta.jobs, je->nr_running);if (je->eta_sec !=INT_MAX && je->nr_running) {
Signature · 1 line
2.9.3
PATCH v2 8/12 gclient: Use proper time units in latency buckets chart
In reply to Robert ElliottIn the Results page Latency buckets chart, use us and ms rather than u and s for the time units. This matches the use of s for seconds that is already being done.
--- gclient.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
gclient.c +5 -5
@@ -908,10 +908,10 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox, struct thread_stat *ts) {double io_u_lat[FIO_IO_U_LAT_U_NR +FIO_IO_U_LAT_M_NR ]; -const char *ranges[] = {"2u" ,"4u" ,"10u" ,"20u" ,"50u" ,"100u" , -"250u" ,"500u" ,"750u" ,"1m" ,"2m" , -"4m" ,"10m" ,"20m" ,"50m" ,"100m" , -"250m" ,"500m" ,"750m" ,"1s" ,"2s" ,">= 2s" }; +const char *ranges[] = {"2us" ,"4us" ,"10us" ,"20us" ,"50us" ,"100us" , +"250us" ,"500us" ,"750us" ,"1ms" ,"2ms" , +"4ms" ,"10ms" ,"20ms" ,"50ms" ,"100ms" , +"250ms" ,"500ms" ,"750ms" ,"1s" ,"2s" ,">= 2s" };int start, end, i;const int total =FIO_IO_U_LAT_U_NR +FIO_IO_U_LAT_M_NR ;GtkWidget *frame, *tree_view, *hbox, *completion_vbox, *drawing_area;
@@ -940,7 +940,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,return ; tree_view =gfio_output_lat_buckets (&io_u_lat[start], &ranges[start], end - start +1 ); - ge->lat_bucket_graph =setup_lat_bucket_graph ("Latency Buckets" , &io_u_lat[start], &ranges[start], end - start +1 ,700.0 ,300.0 ); + ge->lat_bucket_graph =setup_lat_bucket_graph ("Latency buckets" , &io_u_lat[start], &ranges[start], end - start +1 ,700.0 ,300.0 ); frame =gtk_frame_new ("Latency buckets" );gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE,5 );
Signature · 1 line
2.9.3
PATCH v2 9/12 Convert group_run_stats to use bytes instead of KiB/KB
In reply to Robert ElliottIn group_run_stats, convert these fields:
* io_kb (bytes transferred)
* agg (aggregate average bandwidth)
* min_bw
* max_bw
from tracking either KiB or KB depending on kb_base to simply tracking bytes. Rename io_kb to iobytes to match this new meaning.
This will simplify computing quantities and bandwidth rates with both IEC binary and SI decimal unit prefixes (e.g., GiB/s and GB/s) in future patches.
--- client.c | 2 +- server.c | 2 +- stat.c | 23 +++++++++-------------- stat.h | 2 +- 4 files changed, 12 insertions(+), 17 deletions(-)
client.c +1 -1
@@ -972,7 +972,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src) dst->min_run[i] =le64_to_cpu (src->min_run[i]); dst->max_bw[i] =le64_to_cpu (src->max_bw[i]); dst->min_bw[i] =le64_to_cpu (src->min_bw[i]); - dst->io_kb[i] =le64_to_cpu (src->io_kb[i]); + dst->iobytes[i] =le64_to_cpu (src->iobytes[i]); dst->agg[i] =le64_to_cpu (src->agg[i]); }
server.c +1 -1
@@ -1444,7 +1444,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src) dst->min_run[i] =cpu_to_le64 (src->min_run[i]); dst->max_bw[i] =cpu_to_le64 (src->max_bw[i]); dst->min_bw[i] =cpu_to_le64 (src->min_bw[i]); - dst->io_kb[i] =cpu_to_le64 (src->io_kb[i]); + dst->iobytes[i] =cpu_to_le64 (src->iobytes[i]); dst->agg[i] =cpu_to_le64 (src->agg[i]); }
stat.c +9 -14
@@ -291,10 +291,10 @@ void show_group_stats(struct group_run_stats *rs, struct buf_output *out)if (!rs->max_run[i])continue ; - p1 =num2str (rs->io_kb[i],6 , rs->kb_base, i2p,8 ); - p2 =num2str (rs->agg[i],6 , rs->kb_base, i2p, rs->unit_base); - p3 =num2str (rs->min_bw[i],6 , rs->kb_base, i2p, rs->unit_base); - p4 =num2str (rs->max_bw[i],6 , rs->kb_base, i2p, rs->unit_base); + p1 =num2str (rs->iobytes[i],6 ,1 , i2p,8 ); + p2 =num2str (rs->agg[i],6 ,1 , i2p, rs->unit_base); + p3 =num2str (rs->min_bw[i],6 ,1 , i2p, rs->unit_base); + p4 =num2str (rs->max_bw[i],6 ,1 , i2p, rs->unit_base); log_buf(out, "%s: io=%s, aggrb=%s/s, minb=%s/s, maxb=%s/s," " mint=%llumsec, maxt=%llumsec\n",
@@ -1418,7 +1418,7 @@ void sum_group_stats(struct group_run_stats *dst, struct group_run_stats *src)if (dst->min_bw[i] && dst->min_bw[i] > src->min_bw[i]) dst->min_bw[i] = src->min_bw[i]; - dst->io_kb[i] += src->io_kb[i]; + dst->iobytes[i] += src->iobytes[i]; dst->agg[i] += src->agg[i]; }
@@ -1696,19 +1696,14 @@ void __show_run_stats(void) rs->max_run[j] = ts->runtime[j]; bw =0 ; -if (ts->runtime[j]) { -unsigned long runt = ts->runtime[j]; -unsigned long long kb; - - kb = ts->io_bytes[j] / rs->kb_base; - bw = kb *1000 / runt; - } +if (ts->runtime[j]) + bw = ts->io_bytes[j] *1000 / ts->runtime[j];if (bw < rs->min_bw[j]) rs->min_bw[j] = bw;if (bw > rs->max_bw[j]) rs->max_bw[j] = bw; - rs->io_kb[j] += ts->io_bytes[j] / rs->kb_base; + rs->iobytes[j] += ts->io_bytes[j]; } }
@@ -1719,7 +1714,7 @@ void __show_run_stats(void)for (ddir =0 ; ddir <DDIR_RWDIR_CNT ; ddir++) {if (rs->max_run[ddir]) - rs->agg[ddir] = (rs->io_kb[ddir] *1000 ) / + rs->agg[ddir] = (rs->iobytes[ddir] *1000 ) / rs->max_run[ddir]; } }
stat.h +1 -1
@@ -7,7 +7,7 @@struct group_run_stats {uint64_t max_run[DDIR_RWDIR_CNT ], min_run[DDIR_RWDIR_CNT ];uint64_t max_bw[DDIR_RWDIR_CNT ], min_bw[DDIR_RWDIR_CNT ]; -uint64_t io_kb[DDIR_RWDIR_CNT ]; +uint64_t iobytes[DDIR_RWDIR_CNT ];uint64_t agg[DDIR_RWDIR_CNT ];uint32_t kb_base;uint32_t unit_base;
Signature · 1 line
2.9.3
PATCH v2 10/12 Clean up unit prefixes for binary multiples in comments and prints
In reply to Robert ElliottFrom: Robert Elliott <[email protected]>
Change comments and prints that are referring to values based on binary multiples to use IEC 80000-13 prefixes for binary multiples rather than SI prefixes for decimal multiples (e.g., KiB, MiB, and GiB rather than KB, MB, and GB).
Includes a fix for the rate_min print that was printing "KB/s" although it was really printing bytes per second.
Includes a fix for goptions confusing the PB and TB units (while changing them to PiB and TiB).
--- README | 2 +- backend.c | 18 ++++++++---------- engines/dev-dax.c | 2 +- engines/mmap.c | 2 +- eta.c | 2 +- filesetup.c | 5 ++--- goptions.c | 2 +- memory.c | 4 ++-- stat.c | 6 +++--- 9 files changed, 20 insertions(+), 23 deletions(-)
README +1 -1
@@ -233,7 +233,7 @@ sections. The reserved 'global' section is always parsed and used. The --alloc-size switch allows one to use a larger pool size for smalloc. If running large jobs with randommap enabled, fio can run out of memory. Smalloc is an internal allocator for shared structures from a fixed size -memory pool. The pool size defaults to 16M and can grow to 8 pools. +memory pool. The pool size defaults to 16MiB and can grow to 8 pools. NOTE: While running .fio_smalloc.* backing store files are visible in /tmp.
backend.c +8 -10
@@ -180,8 +180,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 +191,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 +201,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 +212,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; } }
engines/dev-dax.c +1 -1
@@ -58,7 +58,7 @@#include "../verify.h" /* -* Limits us to 1GB of mapped files in total to model after +* Limits us to 1GiB of mapped files in total to model after * mmap engine behavior */ #define MMAP_TOTAL_SZ (1 * 1024 * 1024 * 1024UL)
engines/mmap.c +1 -1
@@ -15,7 +15,7 @@#include "../verify.h" /* -* Limits us to 1GB of mapped files in total +* Limits us to 1GiB of mapped files in total */ #define MMAP_TOTAL_SZ (1 * 1024 * 1024 * 1024UL)
eta.c +1 -1
@@ -308,7 +308,7 @@ static void calc_rate(int unified_rw_rep, unsigned long mtime, diff = io_bytes[i] - prev_io_bytes[i];if (mtime) - this_rate = ((1000 * diff) / mtime) /1024 ; + this_rate = ((1000 * diff) / mtime) /1024 ;/* KiB/s */ else this_rate =0 ;
filesetup.c +2 -3
@@ -948,9 +948,8 @@ int setup_files(struct thread_data *td)if (need_extend) { temp_stall_ts =1 ;if (output_format &FIO_OUTPUT_NORMAL ) -log_info ("%s: Laying out IO file(s) (%u file(s) /" -" %lluMB)\n" , o->name, need_extend, - extend_size >>20 ); +log_info ("%s: Laying out IO file(s) (%u file(s) / %lluMiB)\n" , + o->name, need_extend, extend_size >>20 );for_each_file (td, f, i) {unsigned long long old_len =-1ULL , extend_len =-1ULL ;
goptions.c +1 -1
@@ -826,7 +826,7 @@ static struct gopt *gopt_new_str_val(struct gopt_job_view *gjv, unsigned long long *p, unsigned int idx) {struct gopt_str_val *g; -const gchar *postfix[] = {"B" ,"KB" ,"MB" ,"GB" ,"PB" ,"TB" ,"" }; +const gchar *postfix[] = {"B" ,"KiB" ,"MiB" ,"GiB" ,"PiB" ,"PiB" ,"" };GtkWidget *label;int i;
memory.c +2 -2
@@ -33,13 +33,13 @@ int fio_pin_memory(struct thread_data *td)dprint (FD_MEM ,"pinning %llu bytes\n" , td->o.lockmem);/* -* Don't allow mlock of more than real_mem-128MB +* Don't allow mlock of more than real_mem-128MiB */ phys_mem =os_phys_mem ();if (phys_mem) {if ((td->o.lockmem +128 *1024 *1024 ) > phys_mem) { td->o.lockmem = phys_mem -128 *1024 *1024 ; -log_info ("fio: limiting mlocked memory to %lluMB\n" , +log_info ("fio: limiting mlocked memory to %lluMiB\n" , td->o.lockmem >>20 ); } }
stat.c +3 -3
@@ -812,7 +812,7 @@ static void show_ddir_status_terse(struct thread_stat *ts,if (ts->runtime[ddir]) {uint64_t runt = ts->runtime[ddir]; - bw = ((1000 * ts->io_bytes[ddir]) / runt) /1024 ; + bw = ((1000 * ts->io_bytes[ddir]) / runt) /1024 ;/* KiB/s */ iops = (1000 * (uint64_t ) ts->total_io_u[ddir]) / runt; }
@@ -896,7 +896,7 @@ static void add_ddir_status_json(struct thread_stat *ts,if (ts->runtime[ddir]) {uint64_t runt = ts->runtime[ddir]; - bw = ((1000 * ts->io_bytes[ddir]) / runt) /1024 ; + bw = ((1000 * ts->io_bytes[ddir]) / runt) /1024 ;/* KiB/s */ iops = (1000.0 * (uint64_t ) ts->total_io_u[ddir]) / runt; }
@@ -2431,7 +2431,7 @@ static int add_bw_samples(struct thread_data *td, struct timeval *t)continue ;/* No entries for interval */ if (spent) - rate = delta *1000 / spent /1024 ; + rate = delta *1000 / spent /1024 ;/* KiB/s */ else rate =0 ;
Signature · 1 line
2.9.3
PATCH v2 11/12 Improve IEC binary and SI decimal prefix handling
In reply to Robert ElliottFrom: Robert Elliott <[email protected]>
Use kb_base=1000 to follow international standards for unit prefixes.
To specify power-of-10 decimal values defined in the International System of Units (SI):
Ki means kilo (K) or 1000 Mi means mega (M) or 1000**2 Gi means giga (G) or 1000**3 Ti means tera (T) or 1000**4 Pi means peta (P) or 1000**5
To specify power-of-2 binary values defined in IEC 80000-13:
k means kibi (Ki) or 1024 M means mebi (Mi) or 1024**2 G means gibi (Gi) or 1024**3 T means tebi (Ti) or 1024**4 P means pebi (Pi) or 1024**5
For example, this specifies a blocksize of 4096 bytes:
kb_base=1000 bs=4KiB
With kb_base=1024 (the default), the unit prefixes are opposite from those specified in the SI and IEC 80000-13 standards to provide compatibility with old scripts. For example, this specifies a blocksize of 4096 bytes:
kb_base=1024 bs=4K
For outputs printing quantities and bandwidths:
* eta stats only use the preferred prefix
* final stats include both (non-preferred prefix in parenthesis)
* in gfio, all windows include both
Text outputs are rearranged to try to obviously break any scripts parsing the output rather than silently confuse them. The terse and json outputs, which are intended for parsing, are unchanged.
Old:
Jobs: 576 (f=576), CR=86.4GB/576MB KB/s: [w(288),r(288)] [0.0% done] [33884MB/27114MB/0KB /s] [8471K/6778K/0 iops] [eta 06h:59m:57s]
read: io=363338MB, bw=34014MB/s, iops=8304.3K, runt= 10682msec
write: io=282447MB, bw=26225MB/s, iops=6402.7K, runt= 10770msec
READ: io=363338MB, aggrb=34014MB/s, minb=34014MB/s, maxb=34014MB/s, mint=10682msec, maxt=10682msec
WRITE: io=282447MB, aggrb=26225MB/s, minb=26225MB/s, maxb=26225MB/s, mint=10770msec, maxt=10770msec
New:
Jobs: 576 (f=576), 590MB/s-89.2GB/s: [w(288),r(288)][0.0%][r=34.2GB/s,w=26.3GB/s][r=8542k,w=6572k IOPS][eta 06h:59m:55s]
read: IOPS=8362k, BW=34.3GB/s (31.1GiB/s)(665GB/19417msec)
write: IOPS=6423k, BW=26.4GB/s (24.6GiB/s)(511GB/19431msec)
READ: bw=34.3GB/s (31.1GiB/s), 34.3GB/s-34.3GB/s (31.1GiB/s-31.1GiB/s), io=665GB (619GiB), run=19417-19417msec
WRITE: bw=26.4GB/s (24.6GiB/s), 26.4GB/s-26.4GB/s (24.6GiB/s-24.6GiB/s), io=511GB (476GiB), run=19431-19431msec
Documentation changes are in a subsequent patch.
--- eta.c | 44 ++++++++++++++------- fio.h | 7 ++++ gclient.c | 123 ++++++++++++++++++++++++++++++++++++++-------------------- init.c | 39 +++++-------------- lib/num2str.c | 57 ++++++++++++++++++++------- options.c | 8 ++-- parse.c | 40 +++++++++++++------ stat.c | 91 ++++++++++++++++++++++++++----------------- 8 files changed, 259 insertions(+), 150 deletions(-)
eta.c +31 -13
@@ -530,19 +530,28 @@ void display_thread_status(struct jobs_eta *je) } p +=sprintf (p,"Jobs: %d (f=%d)" , je->nr_running, je->files_open); -if (je->m_rate[0 ] || je->m_rate[1 ] || je->t_rate[0 ] || je->t_rate[1 ]) { + +/* rate limits, if any */ +if (je->m_rate[0 ] || je->m_rate[1 ] || je->m_rate[2 ] || + je->t_rate[0 ] || je->t_rate[1 ] || je->t_rate[2 ]) {char *tr, *mr; - mr =num2str (je->m_rate[0 ] + je->m_rate[1 ],4 ,0 , je->is_pow2,8 ); - tr =num2str (je->t_rate[0 ] + je->t_rate[1 ],4 ,0 , je->is_pow2,8 ); - p +=sprintf (p,", CR=%s/%s KB/s" , tr, mr); + mr =num2str (je->m_rate[0 ] + je->m_rate[1 ] + je->m_rate[2 ], +4 ,0 , je->is_pow2,N2S_BYTEPERSEC ); + tr =num2str (je->t_rate[0 ] + je->t_rate[1 ] + je->t_rate[2 ], +4 ,0 , je->is_pow2,N2S_BYTEPERSEC ); + + p +=sprintf (p,", %s-%s" , mr, tr);free (tr);free (mr); - }else if (je->m_iops[0 ] || je->m_iops[1 ] || je->t_iops[0 ] || je->t_iops[1 ]) { - p +=sprintf (p,", CR=%d/%d IOPS" , - je->t_iops[0 ] + je->t_iops[1 ], - je->m_iops[0 ] + je->m_iops[1 ]); + }else if (je->m_iops[0 ] || je->m_iops[1 ] || je->m_iops[2 ] || + je->t_iops[0 ] || je->t_iops[1 ] || je->t_iops[2 ]) { + p +=sprintf (p,", %d-%d IOPS" , + je->m_iops[0 ] + je->m_iops[1 ] + je->m_iops[2 ], + je->t_iops[0 ] + je->t_iops[1 ] + je->t_iops[2 ]); } + +/* current run string, % done, bandwidth, iops, eta */ if (je->eta_sec !=INT_MAX && je->nr_running) {char perc_str[32 ];char *iops_str[DDIR_RWDIR_CNT ];
@@ -553,7 +562,7 @@ void display_thread_status(struct jobs_eta *je)if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running || je->eta_sec ==-1 ) -strcpy (perc_str,"-.-% done" ); +strcpy (perc_str,"-.-%" );else {double mult =100.0 ;
@@ -562,22 +571,31 @@ void display_thread_status(struct jobs_eta *je) eta_good =1 ; perc *= mult; -sprintf (perc_str,"%3.1f%% done" , perc); +sprintf (perc_str,"%3.1f%%" , perc); }for (ddir =DDIR_READ ; ddir <DDIR_RWDIR_CNT ; ddir++) { - rate_str[ddir] =num2str (je->rate[ddir],5 , + rate_str[ddir] =num2str (je->rate[ddir],4 ,1024 , je->is_pow2, je->unit_base); - iops_str[ddir] =num2str (je->iops[ddir],4 ,1 ,0 ,0 ); + iops_str[ddir] =num2str (je->iops[ddir],4 ,1 ,0 ,N2S_NONE ); } left =sizeof (output) - (p - output) -1 ; - l =snprintf (p, left,": [%s] [%s] [%s/%s/%s /s] [%s/%s/%s iops] [eta %s]" , +if (je->rate[DDIR_TRIM ] || je->iops[DDIR_TRIM ]) + l =snprintf (p, left, +": [%s][%s][r=%s,w=%s,t=%s][r=%s,w=%s,t=%s IOPS][eta %s]" , je->run_str, perc_str, rate_str[DDIR_READ ], rate_str[DDIR_WRITE ], rate_str[DDIR_TRIM ], iops_str[DDIR_READ ], iops_str[DDIR_WRITE ], iops_str[DDIR_TRIM ], eta_str); +else + l =snprintf (p, left, +": [%s][%s][r=%s,w=%s][r=%s,w=%s IOPS][eta %s]" , + je->run_str, perc_str, + rate_str[DDIR_READ ], rate_str[DDIR_WRITE ], + iops_str[DDIR_READ ], iops_str[DDIR_WRITE ], + eta_str); p += l;if (l >=0 && l < linelen_last) p +=sprintf (p,"%*s" , linelen_last - l,"" );
fio.h +7 -0
@@ -535,6 +535,13 @@ extern uintptr_t page_size;extern int initialize_fio (char *envp[]);extern void deinitialize_fio (void ); +#define N2S_NONE 0 +#define N2S_BITPERSEC 1/* match unit_base for bit rates */ +#define N2S_PERSEC 2 +#define N2S_BIT 3 +#define N2S_BYTE 4 +#define N2S_BYTEPERSEC 8/* match unit_base for byte rates */ +#define FIO_GETOPT_JOB 0x89000000#define FIO_GETOPT_IOENGINE 0x98000000#define FIO_NR_OPTIONS (FIO_MAX_OPTS + 128)
gclient.c +81 -42
224 lines not on this page · raw message
init.c +10 -29
@@ -31,6 +31,7 @@#include "oslib/strcasestr.h" #include "crc/test.h" +#include "lib/pow2.h" const char fio_version_string[] =FIO_VERSION ;
@@ -865,27 +866,6 @@ static int fixup_options(struct thread_data *td)return ret; } -/* -* This function leaks the buffer -*/ -char *fio_uint_to_kmg (unsigned int val) -{ -char *buf =malloc (32 ); -char post[] = {0 ,'K' ,'M' ,'G' ,'P' ,'E' ,0 }; -char *p = post; - -do { -if (val &1023 ) -break ; - - val >>=10 ; - p++; - }while (*p); - -snprintf (buf,32 ,"%u%c" , val, *p); -return buf; -} -/* External engines are specified by "external:name.o") */ static const char *get_engine_name (const char *str) {
@@ -1528,15 +1508,16 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,if (!td_ioengine_flagged (td,FIO_NOIO )) {char *c1, *c2, *c3, *c4;char *c5 =NULL , *c6 =NULL ; +int i2p =is_power_of_2 (o->kb_base); - c1 =fio_uint_to_kmg (o->min_bs[DDIR_READ ]); - c2 =fio_uint_to_kmg (o->max_bs[DDIR_READ ]); - c3 =fio_uint_to_kmg (o->min_bs[DDIR_WRITE ]); - c4 =fio_uint_to_kmg (o->max_bs[DDIR_WRITE ]); + c1 =num2str (o->min_bs[DDIR_READ ],4 ,1 , i2p,N2S_BYTE ); + c2 =num2str (o->max_bs[DDIR_READ ],4 ,1 , i2p,N2S_BYTE ); + c3 =num2str (o->min_bs[DDIR_WRITE ],4 ,1 , i2p,N2S_BYTE ); + c4 =num2str (o->max_bs[DDIR_WRITE ],4 ,1 , i2p,N2S_BYTE );if (!o->bs_is_seq_rand) { - c5 =fio_uint_to_kmg (o->min_bs[DDIR_TRIM ]); - c6 =fio_uint_to_kmg (o->max_bs[DDIR_TRIM ]); + c5 =num2str (o->min_bs[DDIR_TRIM ],4 ,1 , i2p,N2S_BYTE ); + c6 =num2str (o->max_bs[DDIR_TRIM ],4 ,1 , i2p,N2S_BYTE ); } log_info("%s: (g=%d): rw=%s, ", td->o.name,
@@ -1544,10 +1525,10 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, ddir_str(o->td_ddir));if (o->bs_is_seq_rand) -log_info ("bs(seq/rand)=%s-%s/%s-%s, " , +log_info ("bs=%s-%s,%s-%s, bs_is_seq_rand, " , c1, c2, c3, c4);else -log_info ("bs=%s-%s/%s-%s/%s-%s, " , +log_info ("bs=%s-%s,%s-%s,%s-%s, " , c1, c2, c3, c4, c5, c6); log_info("ioengine=%s, iodepth=%u\n",
lib/num2str.c +42 -15
95 lines not on this page · raw message
options.c +4 -4
@@ -4180,20 +4180,20 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .posval = { { .ival = "1024", .oval = 1024, - .help = "Use 1024 as the K base", + .help = "Inputs invert IEC and SI prefixes (for compatibility); outputs prefer binary", }, { .ival = "1000", .oval = 1000, - .help = "Use 1000 as the K base", + .help = "Inputs use IEC and SI prefixes; outputs prefer SI", }, }, - .help = "How many bytes per KB for reporting (1000 or 1024)", + .help = "Unit prefix interpretation for quantities of data (IEC and SI)", .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_INVALID, }, { .name = "unit_base", - .lname = "Base unit for reporting (Bits or Bytes)", + .lname = "Unit for quantities of data (Bits or Bytes)", .type = FIO_OPT_INT, .off1 = offsetof(struct thread_options, unit_base), .prio = 1,
parse.c +29 -11
@@ -207,32 +207,50 @@ static unsigned long long __get_mult_bytes(const char *p, void *data, } } +/* If kb_base is 1000, use true units. +* If kb_base is 1024, use opposite units. +*/ if (!strncmp ("pib" , c,3 )) { pow =5 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; +else if (kb_base ==1024 ) + mult =1000 ; }else if (!strncmp ("tib" , c,3 )) { pow =4 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; +else if (kb_base ==1024 ) + mult =1000 ; }else if (!strncmp ("gib" , c,3 )) { pow =3 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; +else if (kb_base ==1024 ) + mult =1000 ; }else if (!strncmp ("mib" , c,3 )) { pow =2 ; - mult =1000 ; +if (kb_base ==1000 ) + mult =1024 ; +else if (kb_base ==1024 ) + mult =1000 ; }else if (!strncmp ("kib" , c,3 )) { pow =1 ; - mult =1000 ; - }else if (!strncmp ("p" , c,1 ) || !strncmp ("pb" , c,2 )) +if (kb_base ==1000 ) + mult =1024 ; +else if (kb_base ==1024 ) + mult =1000 ; + }else if (!strncmp ("p" , c,1 ) || !strncmp ("pb" , c,2 )) { pow =5 ; -else if (!strncmp ("t" , c,1 ) || !strncmp ("tb" , c,2 )) + }else if (!strncmp ("t" , c,1 ) || !strncmp ("tb" , c,2 )) { pow =4 ; -else if (!strncmp ("g" , c,1 ) || !strncmp ("gb" , c,2 )) + }else if (!strncmp ("g" , c,1 ) || !strncmp ("gb" , c,2 )) { pow =3 ; -else if (!strncmp ("m" , c,1 ) || !strncmp ("mb" , c,2 )) + }else if (!strncmp ("m" , c,1 ) || !strncmp ("mb" , c,2 )) { pow =2 ; -else if (!strncmp ("k" , c,1 ) || !strncmp ("kb" , c,2 )) + }else if (!strncmp ("k" , c,1 ) || !strncmp ("kb" , c,2 )) { pow =1 ; -else if (!strncmp ("%" , c,1 )) { + }else if (!strncmp ("%" , c,1 )) { *percent =1 ;free (c);return ret;
stat.c +55 -36
171 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH v2 12/12 Documentation for IEC binary and SI decimal prefix handling
In reply to Robert ElliottDocumentation for the previous patch improving IEC and SI decimal prefix handling (e.g., KiB, MiB, GiB vs. KB, MB, GB).
Includes updates to int, kb_base, and the parameters using int to express quantities of data (e.g., bs, ba, bsrange, bssplit).
Includes updates to parameters that accept comma-separated values (usually ints) for reads, writes, and trims; trims were often not mentioned.
--- HOWTO | 292 ++++++++++++++++++++++++++++++++++++++++++------------------------ fio.1 | 193 +++++++++++++++++++++++++++++-------------- 2 files changed, 320 insertions(+), 165 deletions(-)
HOWTO +187 -105
@@ -116,7 +116,7 @@ section residing above it. If the first character in a line is a ';' or a '#', the entire line is discarded as a comment. So let's look at a really simple job file that defines two processes, each -randomly reading from a 128MB file. +randomly reading from a 128MiB file. ; -- start job file -- [global]
@@ -154,9 +154,9 @@ numjobs=4 Here we have no global section, as we only have one job defined anyway. We want to use async io here, with a depth of 4 for each file. We also -increased the buffer size used to 32KB and define numjobs to 4 to +increased the buffer size used to 32KiB and define numjobs to 4 to fork 4 identical jobs. The result is 4 processes each randomly writing -to their own 64MB file. Instead of using the above job file, you could +to their own 64MiB file. Instead of using the above job file, you could have given the parameters on the command line. For this case, you would specify:
@@ -276,20 +276,70 @@ time Integer with possible time suffix. In seconds unless otherwise specified, use eg 10m for 10 minutes. Accepts s/m/h for seconds, minutes, and hours, and accepts 'ms' (or 'msec') for milliseconds, and 'us' (or 'usec') for microseconds. -int SI integer. A whole number value, which may contain a suffix - describing the base of the number. Accepted suffixes are k/m/g/t/p, - meaning kilo, mega, giga, tera, and peta. The suffix is not case - sensitive, and you may also include trailing 'b' (eg 'kb' is the same - as 'k'). So if you want to specify 4096, you could either write - out '4096' or just give 4k. The suffixes signify base 2 values, so - 1024 is 1k and 1024k is 1m and so on, unless the suffix is explicitly - set to a base 10 value using 'kib', 'mib', 'gib', etc. If that is the - case, then 1000 is used as the multiplier. This can be handy for - disks, since manufacturers generally use base 10 values when listing - the capacity of a drive. If the option accepts an upper and lower - range, use a colon ':' or minus '-' to separate such values. May also - include a prefix to indicate numbers base. If 0x is used, the number - is assumed to be hexadecimal. See irange. + +int Integer. A whole number value, which may contain an integer prefix + and an integer suffix. + [integer prefix]number[integer suffix] + + The optional integer prefix specifies the number's base. The default + is decimal. 0x specifies hexadecimal. + + The optional integer suffix specifies the number's units, and includes + an optional unit prefix and an optional unit. For quantities of data, + the default unit is bytes. For quantities of time, the default unit + is seconds. + + With kb_base=1000, fio follows international standards for unit prefixes. + To specify power-of-10 decimal values defined in the International + System of Units (SI): + Ki means kilo (K) or 1000 + Mi means mega (M) or 1000**2 + Gi means giga (G) or 1000**3 + Ti means tera (T) or 1000**4 + Pi means peta (P) or 1000**5 + + To specify power-of-2 binary values defined in IEC 80000-13: + k means kibi (Ki) or 1024 + M means mebi (Mi) or 1024**2 + G means gibi (Gi) or 1024**3 + T means tebi (Ti) or 1024**4 + P means pebi (Pi) or 1024**5 + + With kb_base=1024 (the default), the unit prefixes are opposite from + those specified in the SI and IEC 80000-13 standards to provide + compatibility with old scripts. For example, 4k means 4096. + + For quantities of data, an optional unit of 'B' may be included + (e.g., 'kB' is the same as 'k'). + + The integer suffix is not case sensitive (e.g., m/mi mean mebi/mega, + not milli). 'b' and 'B' both mean byte, not bit. + + Examples with kb_base=1000: + 4 KiB: 4096, 4096b, 4096B, 4ki, 4kib, 4kiB, 4Ki, 4KiB + 1 MiB: 1048576, 1mi, 1024ki + 1 MB: 1000000, 1m, 1000k + 1 TiB: 1073741824, 1ti, 1024mi, 1048576ki + 1 TB: 1000000000, 1t, 1000m, 1000000k + + Examples with kb_base=1024 (default): + 4 KiB: 4096, 4096b, 4096B, 4k, 4kb, 4kB, 4K, 4KB + 1 MiB: 1048576, 1m, 1024k + 1 MB: 1000000, 1mi, 1000ki + 1 TiB: 1073741824, 1t, 1024m, 1048576k + 1 TB: 1000000000, 1ti, 1000mi, 1000000ki + + To specify times (units are not case sensitive): + D means days + H means hours + M mean minutes + s or sec means seconds (default) + ms or msec means milliseconds + us or usec means microseconds + + If the option accepts an upper and lower range, use a colon ':' or + minus '-' to separate such values. See irange. + bool Boolean. Usually parsed as an integer, however only defined for true and false (1 and 0). irange Integer range with suffix. Allows value range to be given, such
@@ -439,10 +489,24 @@ rw_sequencer=str If an offset modifier is given by appending a number to the same offset 8 number of times before generating a new offset. -kb_base=int The base unit for a kilobyte. The defacto base is 2^10, 1024. - Storage manufacturers like to use 10^3 or 1000 as a base - ten unit instead, for obvious reasons. Allow values are - 1024 or 1000, with 1024 being the default. +kb_base=int Select the interpretation of unit prefixes in input parameters. + 1000 = Inputs comply with IEC 80000-13 and the International + System of Units (SI). Use: + - power-of-2 values with IEC prefixes (e.g., KiB) + - power-of-10 values with SI prefixes (e.g., kB) + 1024 = Compatibility mode (default). To avoid breaking + old scripts: + - power-of-2 values with SI prefixes + - power-of-10 values with IEC prefixes + See bs= for more details on input parameters. + + Outputs always use correct prefixes. Most outputs include + both side-by-side, like: + bw=2383.3kB/s (2327.4KiB/s) + If only one value is reported, then kb_base selects the + one to use: + 1000 = SI prefixes + 1024 = IEC prefixes unified_rw_reporting=bool Fio normally reports statistics on a per data direction basis, meaning that reads, writes, and trims are
@@ -510,11 +574,11 @@ io_limit=int Normally fio operates within the region set by 'size', which means that the 'size' option sets both the region and size of IO to be performed. Sometimes that is not what you want. With this option, it is possible to define just the amount of IO - that fio should do. For instance, if 'size' is set to 20G and - 'io_size' is set to 5G, fio will perform IO within the first - 20G but exit when 5G have been done. The opposite is also - possible - if 'size' is set to 20G, and 'io_size' is set to - 40G, then fio will do 40G of IO within the 0..20G region. + that fio should do. For instance, if 'size' is set to 20GiB and + 'io_size' is set to 5GiB, fio will perform IO within the first + 20GiB but exit when 5GiB have been done. The opposite is also + possible - if 'size' is set to 20GiB, and 'io_size' is set to + 40GiB, then fio will do 40GiB of IO within the 0..20GiB region. filesize=int Individual file sizes. May be a range, in which case fio will select sizes for files at random within the given range
@@ -537,36 +601,36 @@ fill_fs=bool Sets size to something really large and waits for ENOSPC (no Additionally, writing beyond end-of-device will not return ENOSPC there. -blocksize=int -bs=int The block size used for the io units. Defaults to 4k. Values - can be given for both read and writes. If a single int is - given, it will apply to both. If a second int is specified - after a comma, it will apply to writes only. In other words, - the format is either bs=read_and_write or bs=read,write,trim. - bs=4k,8k will thus use 4k blocks for reads, 8k blocks for - writes, and 8k for trims. You can terminate the list with - a trailing comma. bs=4k,8k, would use the default value for - trims.. If you only wish to set the write size, you - can do so by passing an empty read size - bs=,8k will set - 8k for writes and leave the read default value. - -blockalign=int -ba=int At what boundary to align random IO offsets. Defaults to - the same as 'blocksize' the minimum blocksize given. - Minimum alignment is typically 512b for using direct IO, - though it usually depends on the hardware block size. This - option is mutually exclusive with using a random map for - files, so it will turn off that option. - -blocksize_range=irange -bsrange=irange Instead of giving a single block size, specify a range - and fio will mix the issued io block sizes. The issued - io unit will always be a multiple of the minimum value - given (also see bs_unaligned). Applies to both reads and - writes, however a second range can be given after a comma. - See bs=. - -bssplit=str Sometimes you want even finer grained control of the +blocksize=int[,int][,int] +bs=int[,int][,int] + The block size in bytes used for I/O units. Default: 4096. + A single value applies to reads, writes, and trims. + Comma-separated values may be specified for reads, writes, + and trims. A value not terminated in a comma applies to + subsequent types. + + Examples: + bs=256k means 256k for reads, writes and trims + bs=8k,32k means 8k for reads, 32k for writes and trims + bs=8k,32k, means 8k for reads, 32k for writes, and + default for trims + bs=,8k means default for reads, 8k for writes and trims + bs=,8k, means default for reads, 8k for writes, and + default for writes + +blocksize_range=irange[,irange][,irange] +bsrange=irange[,irange][,irange] + A range of block sizes in bytes for I/O units. + The issued I/O unit will always be a multiple of the minimum + size, unless blocksize_unaligned is set. + + Comma-separated ranges may be specified for reads, writes, + and trims as described in 'blocksize'. + + Example: bsrange=1k-4k,2k-8k + +bssplit=str[,str][,str] + Sometimes you want even finer grained control of the block sizes issued, not just an even split between them. This option allows you to weight various block sizes, so that you are able to define a specific amount of
@@ -590,24 +654,37 @@ bssplit=str Sometimes you want even finer grained control of the always add up to 100, if bssplit is given a range that adds up to more, it will error out. - bssplit also supports giving separate splits to reads and - writes. The format is identical to what bs= accepts. You - have to separate the read and write parts with a comma. So - if you want a workload that has 50% 2k reads and 50% 4k reads, + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. + + If you want a workload that has 50% 2k reads and 50% 4k reads, while having 90% 4k writes and 10% 8k writes, you would specify: bssplit=2k/50:4k/50,4k/90:8k/10 blocksize_unaligned -bs_unaligned If this option is given, any byte size value within bsrange - may be used as a block range. This typically wont work with - direct IO, as that normally requires sector alignment. +bs_unaligned If set, fio will issue I/O units with any size within + blocksize_range, not just multiples of the minimum size. + This typically won't work with direct I/O, as that normally + requires sector alignment. bs_is_seq_rand If this option is set, fio will use the normal read,write - blocksize settings as sequential,random instead. Any random - read or write will use the WRITE blocksize settings, and any - sequential read or write will use the READ blocksize setting. + blocksize settings as sequential,random blocksize settings + instead. Any random read or write will use the WRITE blocksize + settings, and any sequential read or write will use the READ + blocksize settings. + +blockalign=int[,int][,int] +ba=int[,int][,int] + Boundary to which fio will align random I/O units. + Default: 'blocksize'. + Minimum alignment is typically 512b for using direct IO, + though it usually depends on the hardware block size. This + option is mutually exclusive with using a random map for + files, so it will turn off that option. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. zero_buffers If this option is given, fio will init the IO buffers to all zeroes. The default is to fill them with random data.
@@ -837,7 +914,7 @@ ioengine=str Defines how the job issues io to the file. The following filename, eg ioengine=external:/tmp/foo.o to load ioengine foo.o in /tmp. -iodepth=int This defines how many io units to keep in flight against +iodepth=int This defines how many I/O units to keep in flight against the file. The default is 1 for each file defined in this job, can be overridden with a larger value for higher concurrency. Note that increasing iodepth beyond 1 will not
@@ -990,7 +1067,8 @@ rwmixwrite=int How large a percentage of the mix should be writes. If both if fio is asked to limit reads or writes to a certain rate. If that is the case, then the distribution may be skewed. -random_distribution=str:float By default, fio will use a completely uniform +random_distribution=str:float[,str:float][,str:float] + By default, fio will use a completely uniform random distribution when asked to perform random IO. Sometimes it is useful to skew the distribution in specific ways, ensuring that some parts of the data is more hot than others.
@@ -1032,14 +1110,15 @@ random_distribution=str:float By default, fio will use a completely uniform specify separate zones for reads, writes, and trims. If just one set is given, it'll apply to all of them. -percentage_random=int For a random workload, set how big a percentage should +percentage_random=int[,int][,int] + For a random workload, set how big a percentage should be random. This defaults to 100%, in which case the workload is fully random. It can be set from anywhere from 0 to 100. Setting it to 0 would make the workload fully sequential. Any setting in between will result in a random mix of sequential - and random IO, at the given percentages. It is possible to - set different values for reads, writes, and trim. To do so, - simply use a comma separated list. See blocksize. + and random IO, at the given percentages. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. norandommap Normally fio will cover every block of the file when doing random IO. If this option is given, fio will just get a
@@ -1111,29 +1190,32 @@ thinktime_blocks=int other words, this setting effectively caps the queue depth if the latter is larger. -rate=int Cap the bandwidth used by this job. The number is in bytes/sec, - the normal suffix rules apply. You can use rate=500k to limit - reads and writes to 500k each, or you can specify read and - writes separately. Using rate=1m,500k would limit reads to - 1MB/sec and writes to 500KB/sec. Capping only reads or - writes can be done with rate=,500k or rate=500k,. The former - will only limit writes (to 500KB/sec), the latter will only - limit reads. - -rate_min=int Tell fio to do whatever it can to maintain at least this - bandwidth. Failing to meet this requirement, will cause - the job to exit. The same format as rate is used for - read vs write separation. - -rate_iops=int Cap the bandwidth to this number of IOPS. Basically the same +rate=int[,int][,int] + Cap the bandwidth used by this job. The number is in bytes/sec, + the normal suffix rules apply. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. + +rate_min=int[,int][,int] + Tell fio to do whatever it can to maintain at least this + bandwidth. Failing to meet this requirement will cause + the job to exit. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. + +rate_iops=int[,int][,int] + Cap the bandwidth to this number of IOPS. Basically the same as rate, just specified independently of bandwidth. If the job is given a block size range instead of a fixed value, - the smallest block size is used as the metric. The same format - as rate is used for read vs write separation. + the smallest block size is used as the metric. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. -rate_iops_min=int If fio doesn't meet this rate of IO, it will cause - the job to exit. The same format as rate is used for read vs - write separation. +rate_iops_min=int[,int][,int] + If fio doesn't meet this rate of IO, it will cause + the job to exit. + Comma-separated values may be specified for reads, writes, + and trims as described in 'blocksize'. rate_process=str This option controls how fio manages rated IO submissions. The default is 'linear', which submits IO in a
@@ -1280,7 +1362,7 @@ sync=bool Use sync io for buffered writes. For the majority of the io engines, this means using O_SYNC. iomem=str -mem=str Fio can use various types of memory as the io unit buffer. +mem=str Fio can use various types of memory as the I/O unit buffer. The allowed values are: malloc Use memory from malloc(3) as the buffers.
@@ -1308,7 +1390,7 @@ mem=str Fio can use various types of memory as the io unit buffer. that for shmhuge and mmaphuge to work, the system must have free huge pages allocated. This can normally be checked and set by reading/writing /proc/sys/vm/nr_hugepages on a - Linux system. Fio assumes a huge page is 4MB in size. So + Linux system. Fio assumes a huge page is 4MiB in size. So to calculate the number of huge pages you need for a given job file, add up the io depth of all jobs (normally one unless iodepth= is used) and multiply by the maximum bs set. Then
@@ -1322,7 +1404,7 @@ mem=str Fio can use various types of memory as the io unit buffer. you would use mem=mmaphuge:/huge/somefile. iomem_align=int This indicates the memory alignment of the IO memory buffers. - Note that the given alignment is applied to the first IO unit + Note that the given alignment is applied to the first I/O unit buffer, if using iodepth the alignment of the following buffers are given by the bs used. In other words, if using a bs that is a multiple of the page sized in the system, all buffers will
@@ -1332,7 +1414,7 @@ iomem_align=int This indicates the memory alignment of the IO memory buffers. hugepage-size=int Defines the size of a huge page. Must at least be equal - to the system setting, see /proc/meminfo. Defaults to 4MB. + to the system setting, see /proc/meminfo. Defaults to 4MiB. Should probably always be a multiple of megabytes, so using hugepage-size=Xm is the preferred way to set this to avoid setting a non-pow-2 bad value.
@@ -2024,7 +2106,7 @@ be the starting port number since fio will use a range of ports. fio spits out a lot of output. While running, fio will display the status of the jobs created. An example of that would be: -Threads: 1: [_r] [24.8% done] [ 13509/ 8334 kb/s] [eta 00h:01m:31s] +Jobs: 1: [_r] [24.8% done] [r=20992KiB/s,w=24064KiB/s,t=0KiB/s] [r=82,w=94,t=0 iops] [eta 00h:01m:31s] The characters inside the square brackets denote the current status of each thread. The possible values (in typical life cycle order) are:
@@ -2053,7 +2135,7 @@ Fio will condense the thread string as not to take up more space on the command line as is needed. For instance, if you have 10 readers and 10 writers running, the output would look like this: -Jobs: 20 (f=20): [R(10),W(10)] [4.0% done] [2103MB/0KB/0KB /s] [538K/0/0 iops] [eta 57m:36s] +Jobs: 20 (f=20): [R(10),W(10)] [4.0% done] [r=20992KiB/s,w=24064KiB/s,t=0KiB/s] [r=82,w=94,t=0 iops] [eta 57m:36s] Fio will still maintain the ordering, though. So the above means that jobs 1..10 are readers, and 11..20 are writers.
@@ -2071,10 +2153,10 @@ each thread, group of threads, and disks in that order. For each data direction, the output looks like: Client1 (g=0): err= 0: - write: io= 32MB, bw= 666KB/s, iops=89 , runt= 50320msec + write: io= 32MiB, bw= 666KiB/s, iops=89 , runt= 50320msec slat (msec): min= 0, max= 136, avg= 0.03, stdev= 1.92 clat (msec): min= 0, max= 631, avg=48.50, stdev=86.82 - bw (KB/s) : min= 0, max= 1196, per=51.00%, avg=664.02, stdev=681.68 + bw (KiB/s) : min= 0, max= 1196, per=51.00%, avg=664.02, stdev=681.68 cpu : usr=1.49%, sys=0.25%, ctx=7969, majf=0, minf=17 IO depths : 1=0.1%, 2=0.3%, 4=0.5%, 8=99.0%, 16=0.0%, 32=0.0%, >32=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
@@ -2193,19 +2275,19 @@ Split up, the format is as follows: terse version, fio version, jobname, groupid, error READ status: - Total IO (KB), bandwidth (KB/sec), IOPS, runtime (msec) + Total IO (KiB), bandwidth (KiB/sec), IOPS, runtime (msec) Submission latency: min, max, mean, stdev (usec) Completion latency: min, max, mean, stdev (usec) Completion latency percentiles: 20 fields (see below) Total latency: min, max, mean, stdev (usec) - Bw (KB/s): min, max, aggregate percentage of total, mean, stdev + Bw (KiB/s): min, max, aggregate percentage of total, mean, stdev WRITE status: - Total IO (KB), bandwidth (KB/sec), IOPS, runtime (msec) + Total IO (KiB), bandwidth (KiB/sec), IOPS, runtime (msec) Submission latency: min, max, mean, stdev (usec) Completion latency: min, max, mean, stdev(usec) Completion latency percentiles: 20 fields (see below) Total latency: min, max, mean, stdev (usec) - Bw (KB/s): min, max, aggregate percentage of total, mean, stdev + Bw (KiB/s): min, max, aggregate percentage of total, mean, stdev CPU usage: user, system, context switches, major faults, minor faults IO depths: <=1, 2, 4, 8, 16, 32, >=64 IO latencies microseconds: <=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000
@@ -2396,7 +2478,7 @@ Time for the log entry is always in milliseconds. The value logged depends on the type of log, it will be one of the following: Latency log Value is latency in usecs - Bandwidth log Value is in KB/sec + Bandwidth log Value is in KiB/sec IOPS log Value is IOPS Data direction is one of the following:
fio.1 +133 -60
279 lines not on this page · raw message
Signature · 1 line
2.9.3
Re: [PATCH v2 01/12] Avoid using units in option defaults
In reply to Robert ElliottQuoted 6 lines · Robert Elliott
From: Robert Elliott <[email protected]>
Change option defaults and some generated option strings to specify the number of bytes without units, so they are immune to the interpretation of the units (e.g. is 1M interpreted as 1048576 or 1000000).
Applied the whole series, thanks.
Signature · 1 line
Jens Axboe