fio.git
6 years agoverify: don't adjust verification length based on interval when unaligned
Jens Axboe [Fri, 5 Jan 2018 20:38:40 +0000 (13:38 -0700)]
verify: don't adjust verification length based on interval when unaligned

It's perfectly fine to have a verification length that exceeds the
default verify interval when we have unaligned block sizes and
using block size ranges, since the verify interval just defaults to
the smallest blocksize.

Fixes: https://github.com/axboe/fio/issues/509
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoFix client/server "all clients" reporting
Jeff Furlong [Wed, 3 Jan 2018 23:20:38 +0000 (23:20 +0000)]
Fix client/server "all clients" reporting

In commit e883cb3501de0f99297282c18842d50aaa7fa531, the default significant figures was added.  The default value was preserved for local jobs and when client/server was used if jobs=1, but not when client/server was used if jobs > 1.  This patch restores some reporting outputs ("all clients" output for IOPS and BW) when client/server is used if > 1 jobs, for example:

OLD:
All clients: (groupid=0, jobs=2): err= 0: pid=0: Wed Jan  3 14:30:13 2018
   read: IOPS=0, BW=0 (0)(0B/5001msec)                                               <--ZERO VALUES
    slat (nsec): min=762, max=108579, avg=1058.97, stdev=221.30
    clat (nsec): min=254, max=4544.2k, avg=11297.64, stdev=8284.14
     lat (usec): min=9, max=4545, avg=12.41, stdev= 8.30
   bw (  KiB/s): min=290192, max=347160, per=49.35%, avg=303613.33, stdev=11582.87, samples=18
   iops        : min=72548, max=86790, avg=75903.33, stdev=2895.72, samples=18

NEW:
All clients: (groupid=0, jobs=2): err= 0: pid=0: Wed Jan  3 15:08:33 2018
   read: IOPS=147k, BW=575Mi (603M)(2876MiB/5001msec) <--CORRECT VALUES
    slat (nsec): min=841, max=61945, avg=1304.83, stdev=232.75
    clat (nsec): min=544, max=4487.2k, avg=11736.68, stdev=9123.64
     lat (usec): min=10, max=4489, avg=13.10, stdev= 9.13
   bw (  KiB/s): min=260945, max=305976, per=49.99%, avg=294350.22, stdev=9192.53, samples=18
   iops        : min=65236, max=76494, avg=73587.56, stdev=2298.13, samples=18

Regards,
Jeff

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoChange bluestop link to be https
Jens Axboe [Fri, 5 Jan 2018 15:30:32 +0000 (08:30 -0700)]
Change bluestop link to be https

Doesn't answer on http:// anymore.

Also include link to AppVeyor builds for Windows, as they always build
the latest and greatest.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'percentiles' of https://github.com/sitsofe/fio
Jens Axboe [Tue, 2 Jan 2018 16:05:44 +0000 (09:05 -0700)]
Merge branch 'percentiles' of https://github.com/sitsofe/fio

6 years agoinit: disable percentiles when latency gathering is disabled
Sitsofe Wheeler [Sun, 31 Dec 2017 12:42:59 +0000 (12:42 +0000)]
init: disable percentiles when latency gathering is disabled

When disable_clat/disable_lat is set also disable the corresponding
clat_percentiles/lat_percentiles option.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agostat: make lat_percentiles=1 use sample count from lat_stat
Sitsofe Wheeler [Sun, 31 Dec 2017 11:41:55 +0000 (11:41 +0000)]
stat: make lat_percentiles=1 use sample count from lat_stat

The following job

./fio --name=nolatencies --ioengine=posixaio --direct=1 --rw=randread \
 --iodepth=1 --bs=4k --filename=/tmp/fio.tmp --runtime=2s --size=50m \
 --disable_lat=0 --disable_clat=1 --disable_slat=1 --lat_percentiles=1

outputs the following:

fio-3.3
Starting 1 process

test: (groupid=0, jobs=1): err= 0: pid=7316: Sun Dec 31 11:55:46 2017
   read: IOPS=41.0k, BW=164MiB/s (172MB/s)(50.0MiB/305msec)
     lat (usec): min=8, max=132, avg=17.58, stdev= 4.36
     lat percentiles (nsec):
     |  1.00th=[    0],  5.00th=[    0], 10.00th=[    0], 20.00th=[    0],
     | 30.00th=[    0], 40.00th=[    0], 50.00th=[    0], 60.00th=[    0],
     | 70.00th=[    0], 80.00th=[    0], 90.00th=[    0], 95.00th=[    0],
     | 99.00th=[    0], 99.50th=[    0], 99.90th=[    0], 99.95th=[    0],
     | 99.99th=[    0]
  cpu          : usr=56.39%, sys=29.18%, ctx=12043, majf=0, minf=85
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwt: total=12800,0,0, short=0,0,0, dropped=0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=164MiB/s (172MB/s), 164MiB/s-164MiB/s (172MB/s-172MB/s), io=50.0MiB (52.4MB), run=305-305msec

which isn't showing total latency percentiles (lat percentiles) when it
should. Additionally there is a segfault when running the following job:

./fio --name=segfault --ioengine=posixaio --direct=1 --rw=randread \
 --iodepth=1 --bs=4k --filename=/tmp/fio.tmp --runtime=2s --size=50m \
 --disable_lat=1 --disable_clat=0 --disable_slat=1 --lat_percentiles=1

Fix these by making latency printing use the number of samples from the
correct latency type (clat_stat for lat_percentiles=0/clat_percentiles=1
and lat_stat for lat_percentiles=1/clat_percentiles=0).

Fixes https://www.spinics.net/lists/fio/msg06628.html ("fio lat reporting
").

Reported-by: Jeff Furlong <jeff.furlong@wdc.com>
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agolog: fix bad < 0 check for unsigned
Jens Axboe [Fri, 29 Dec 2017 15:45:22 +0000 (08:45 -0700)]
log: fix bad < 0 check for unsigned

Fixes: e5f9a813 ("debug: make debug=io readable with multiple threads")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agodebug: make debug=io readable with multiple threads
Robert Elliott [Fri, 29 Dec 2017 01:13:06 +0000 (01:13 +0000)]
debug: make debug=io readable with multiple threads

When multiple threads are active, debug=io prints are unreadable as the output
is interleaved. Multiple log_info_buf() calls are used to construct each line,
but there is no mutual exclusion covering multiple calls.

Change the dprint call tree to construct the entire line before passing it to
log_info_buf(), rather than make several calls.

Other nits:
* print the thread ID rather than the process ID
* change offset and length from decimal to hex
* separate offset, length, ddir, and file with , rather than / since the
  filename on the same line likely has / of its own
* change "fill_io_u" to "fill" to match the others
* change "io complete" to "complete" to match the others
* change "->prep()=%d" to "prep: io_u %p: ret=%d" to resemble the others
* change offset/buflen in an error print to better resemble the normal prints
* add "file=" prefix for the filename
* check the calloc() return values inside the valist_to_buf functions

Old:
fill_io_u: io_u 0x7feeac010b80: off=720896/len=65536/ddir=1

io       50692io       50692//dev/dax0.0io       50692fill_io_u: io_u 0x7fee98010b80: off=196608/len=65536/ddir=1io       50692io       50692
io       50692->prep(0x7fef10010b80)=0
//dev/dax0.0//dev/dax1.0io       50692io       50692io       50692io       50692->prep(0x7feeec010b80)=0
io       50692prep: io_u 0x7feec4010b80: off=1966080/len=65536/ddir=1io       50692io complete: io_u 0x7feedc010b80: off=393216/len=65536/ddir=1io
50692io       50692prep: io_u 0x7feef4010b80: off=720896/len=65536/ddir=1io       50692io       50692
io       50692io       50692prep: io_u 0x7feef0010b80: off=851968/len=65536/ddir=1//dev/dax0.0io       50692//dev/dax0.0

//dev/dax0.0
io       50692io       50692//dev/dax0.0//dev/dax0.0io       50692

New:
io       71400 queue: io_u 0x7fd0f0010b80: off=0x2f0000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71395 fill: io_u 0x7fd0fc010b80: off=0x80000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71395 prep: io_u 0x7fd0fc010b80: off=0x80000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71395 prep: io_u 0x7fd0fc010b80: ret=0
io       71395 queue: io_u 0x7fd0fc010b80: off=0x80000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71430 complete: io_u 0x7fd05c010b80: off=0x180000,len=0x10000,ddir=1,file=/dev/dax1.0
io       71400 complete: io_u 0x7fd0f0010b80: off=0x2f0000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71430 fill: io_u 0x7fd05c010b80: off=0x190000,len=0x10000,ddir=1,file=/dev/dax1.0
io       71400 fill: io_u 0x7fd0f0010b80: off=0x300000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71400 prep: io_u 0x7fd0f0010b80: off=0x300000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71400 prep: io_u 0x7fd0f0010b80: ret=0
io       71400 queue: io_u 0x7fd0f0010b80: off=0x300000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71430 prep: io_u 0x7fd05c010b80: off=0x190000,len=0x10000,ddir=1,file=/dev/dax1.0
io       71395 complete: io_u 0x7fd0fc010b80: off=0x80000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71430 prep: io_u 0x7fd05c010b80: ret=0
io       71430 queue: io_u 0x7fd05c010b80: off=0x190000,len=0x10000,ddir=1,file=/dev/dax1.0
io       71421 complete: io_u 0x7fd090010b80: off=0x320000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71419 complete: io_u 0x7fd098010b80: off=0x320000,len=0x10000,ddir=1,file=/dev/dax0.0
io       71404 complete: io_u 0x7fd0d0010b80: off=0x0,len=0x10000,ddir=1,file=/dev/dax0.0

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agolib/memcpy: fix warning on FreeBSD
Tomohiro Kusumi [Fri, 29 Dec 2017 13:38:23 +0000 (15:38 +0200)]
lib/memcpy: fix warning on FreeBSD

Include struct timeval via sys/time.h.
http://pubs.opengroup.org/onlinepubs/009604499/basedefs/sys/time.h.html

--
In file included from lib/memcpy.c:7:
lib/../fio_time.h:14:45: warning: declaration of 'struct timeval' will not be visible outside of this function [-Wvisibility]
extern uint64_t mtime_since_tv(const struct timeval *, const struct timeval *);

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'master' of https://github.com/yashi/fio
Jens Axboe [Thu, 28 Dec 2017 15:35:11 +0000 (08:35 -0700)]
Merge branch 'master' of https://github.com/yashi/fio

6 years agomutex: down_timeout: check against the base time
Yasushi SHOJI [Thu, 28 Dec 2017 01:53:47 +0000 (10:53 +0900)]
mutex: down_timeout: check against the base time

When the commit 8b6a404cdd2c40715885e562416c3db039912773 changed
timeval to timespec, it accsidentally picked timeout time `t' instead
of the current `base' time for checking timewait() really timed out.

t is base + msecs as follows:

      base = gettimeofday()
      t = base + msecs
      pthread_cond_timedwait()
      while (!done)
         if (timedout)
    if (mutex_timed_out(t, msecs))
       done = true

Thus, after a good timedout, it burns the cpu for the given msecs
seconds doing tight loop in the while shown above.  This causes 30 to
40 % CPU load on my i5-3360M 2.80GHz while fio server is running.

6 years agoMerge branch 'eta_display' of https://github.com/sitsofe/fio
Jens Axboe [Wed, 27 Dec 2017 21:05:46 +0000 (14:05 -0700)]
Merge branch 'eta_display' of https://github.com/sitsofe/fio

6 years agoMerge branch 'barak/mmap_verify_only' of https://github.com/barakp/fio
Jens Axboe [Wed, 27 Dec 2017 21:05:27 +0000 (14:05 -0700)]
Merge branch 'barak/mmap_verify_only' of https://github.com/barakp/fio

6 years agoeta: show complete status line with max job states
Sitsofe Wheeler [Sat, 23 Dec 2017 09:55:02 +0000 (09:55 +0000)]
eta: show complete status line with max job states

Make the ETA output buffer big enough to cope with the maximum possible
jobs when their states can't be compressed (i.e. when every job's state
is different to the state of the job that came before it).

Allows the following script to display the complete status line:

rw[0]='read'; rw[1]='write'; \
for i in {1..4096}; do \
  echo -e "[job$i]\nrw=${rw[$((i % 2))]}\n" \
          "runtime=15"; \
done | \
./fio --eta=always --group_reporting=1 --ioengine=null --size=1g \
 --time_based --bs=1k --thread --rate_iops=1 -

Fixes: https://github.com/axboe/fio/issues/500 ("Large number of threads
result in Seg faults")

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agoeta: fix previous line length calculation
Sitsofe Wheeler [Sat, 23 Dec 2017 08:43:54 +0000 (08:43 +0000)]
eta: fix previous line length calculation

We work out how many stale characters we haven't yet overprinted from
the previous run by comparing the number of characters that snprintf
added to the buffer in both cases. Unfortunately this doesn't account
for earlier characters that may (or may not) have already been in the
output buffer before snprintf was called...

Change the code to just use the current and previous output buffer
position to calculate the remainder of the line to be cleared.

When fio is compiled under clang with
./configure --extra-cflags="-fsanitize=address -fno-builtin" \
 --disable-optimizations

a buffer overrun is demonstrated by the following script

rw[0]='read'; rw[1]='write'; \
for i in {1..4096}; do \
  echo -e "[job$i]\nrw=${rw[$((i % 2))]}\n" \
  "ramp_time=$(((4096 - i) / 2049 * 10))\n" \
          "runtime=15"; \
done | \
./fio --group_reporting --ioengine=null --size=1g --time_based \
 --bs=512 --thread --rate_iops=2 -

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agoeta: skip clearing of remainder of line when starting a new line
Sitsofe Wheeler [Sat, 23 Dec 2017 08:39:11 +0000 (08:39 +0000)]
eta: skip clearing of remainder of line when starting a new line

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agoeta: fix run_str_condensed overflow with maximum jobs
Sitsofe Wheeler [Sat, 23 Dec 2017 08:01:01 +0000 (08:01 +0000)]
eta: fix run_str_condensed overflow with maximum jobs

When the maximum number of jobs all have a different state to their
previous job, run_str didn't have space for the terminating null. Fix
this by making run_str one character larger.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agoeta: adjust truncation case
Sitsofe Wheeler [Fri, 22 Dec 2017 11:10:35 +0000 (11:10 +0000)]
eta: adjust truncation case

c076de85fa4901683f6ce23ecdc071c17801ffad ("eta: fix buffer overflow in
ETA output") made adjustments to cope with snprintf truncation. However
since we're replacing the null added by snprintf, left only needs to be
one smaller than the output buffer. Make this change and add a comment
about what we're doing.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agoMerge branch 'eta_overflow' of https://github.com/sitsofe/fio
Jens Axboe [Thu, 21 Dec 2017 15:22:39 +0000 (08:22 -0700)]
Merge branch 'eta_overflow' of https://github.com/sitsofe/fio

6 years agoeta: fix buffer overflow in ETA output
Sitsofe Wheeler [Thu, 21 Dec 2017 12:23:36 +0000 (12:23 +0000)]
eta: fix buffer overflow in ETA output

When 900 or more jobs all have different states it is possible for the
space required to display the ETA line to be larger than the ETA output
buffer. fio initially truncates what it puts in the output buffer but
incorrectly advances where it thinks the end of the buffer is - when
truncating snprintf returns the number of characters that _would_ have
been converted if there had been enough space...

This patch fixes the post truncation calculation and adjusts the "left"
variable so there is room for the carriage return and a null terminator.

The following script reproduces the problem when fio has been compiled
with -fstack-protector or -fsanitize=address:

rw[0]='read'; rw[1]='write'; \
for i in {1..1000}; do \
 echo -e "[job$i]\nrw=${rw[$((i % 2))]}\n" \
         "ramp_time=$(((1000 - i) / 350 * 5))\n" \
         "runtime=$((60 - (i % 3) * 2))"; \
done | \
./fio --eta-newline=1s --group_reporting --ioengine=null --size=1g \
 --time_based --bs=512 --thread --rate_iops=123456 -

Fixes: https://github.com/axboe/fio/issues/500 ("Large number of threads
result in Seg faults")
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agoFio 3.3 fio-3.3
Jens Axboe [Tue, 19 Dec 2017 20:16:36 +0000 (13:16 -0700)]
Fio 3.3

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agobackend: tweaks to missed rate thinktime
Jens Axboe [Tue, 19 Dec 2017 17:17:41 +0000 (10:17 -0700)]
backend: tweaks to missed rate thinktime

shimrot says:

"May I suggest a tweak to the backend.c::handle_thinktime calculation of
"over"? That is, adjust based on the rate per byte similar to what
you've done. That is, if thinktime is greater than one op worth of
bytes, then subtract one op worth of bytes. But, if think time is
greater than one ops worth, instead add the missing the number of bytes
a full op would have exceeded the think time."

See: https://github.com/axboe/fio/issues/497#issuecomment-352816955

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoioengines: clear out ->td_ops_dlhandle if we close it
Jens Axboe [Fri, 15 Dec 2017 20:35:56 +0000 (13:35 -0700)]
ioengines: clear out ->td_ops_dlhandle if we close it

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoinit: fix missing dlhandle reference put
Jens Axboe [Fri, 15 Dec 2017 20:34:22 +0000 (13:34 -0700)]
init: fix missing dlhandle reference put

If we keep using the same engine, put the dlhandle reference that
we now hold twice.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoparse: don't check for < 0 on an unsigned type
Jens Axboe [Fri, 15 Dec 2017 16:13:28 +0000 (09:13 -0700)]
parse: don't check for < 0 on an unsigned type

We do strict errors on some builds, this breaks them. Remove the
<= 0 check, just check for a value that's too large.

Fixes: c26438ad ("parse: dump option type when using --debug=parse")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoioengines: improve "is this the same IO engine" check
Jens Axboe [Fri, 15 Dec 2017 16:08:26 +0000 (09:08 -0700)]
ioengines: improve "is this the same IO engine" check

We can't just compare the name, that assumes that name and filename
match for an IO engine. While that's generally the case for the
engines that fio ships with, it's not a requirement, and it's
definitely not true for external engines.

Fixup the check by re-loading the engine and checking the OPS
instead. That should be bullet proof.

Fixes: 800334d ("Correctly detect whether ioengine_load can exit early")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoparse: dump option type when using --debug=parse
Jens Axboe [Fri, 15 Dec 2017 15:41:03 +0000 (08:41 -0700)]
parse: dump option type when using --debug=parse

Currently we do things like:

parse    8731  __handle_option=dummy, type=10, ptr=1

for the debug parsing, and then you have to look up what that
option type is. Add names to them so we get the below instead:

parse    9170  __handle_option=dummy, type=OPT_STR_SET, ptr=1

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoAllow configurable ETA intervals
Jens Axboe [Thu, 14 Dec 2017 18:51:41 +0000 (11:51 -0700)]
Allow configurable ETA intervals

By default, fio prints ETA output every second. For some client/server
setups, it's desirable to allow a much longer interval, to avoid
spending too much time getting and printing ETA time.

Takes a normal time input, allowing usec/msec/sec etc postfixes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoclient: respect --eta=never for networked connections
Jens Axboe [Thu, 14 Dec 2017 17:58:03 +0000 (10:58 -0700)]
client: respect --eta=never for networked connections

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoserver: convert more memset to on-stack initialization
Jens Axboe [Thu, 14 Dec 2017 16:47:35 +0000 (09:47 -0700)]
server: convert more memset to on-stack initialization

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoserver: cleanup iolog pdu prep
Jens Axboe [Thu, 14 Dec 2017 16:25:10 +0000 (09:25 -0700)]
server: cleanup iolog pdu prep

We don't have to memset() the whole thing, we just need to ensure
that the members we don't assign are cleared. Remove the memset
and initialize the pdu on the stack.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoFix Windows local time
Jeff Furlong [Thu, 14 Dec 2017 01:19:09 +0000 (01:19 +0000)]
Fix Windows local time

The fio summary output shows when the job completed, but references
system time on Windows.  On Linux, local time (such as with time zone
specifics) is referenced.  This patch converts Windows system time to
local time.

Before:
fio-3.2-72-ge80d-dirty
Starting 1 thread
Jobs: 1 (f=0): [f(1)][100.0%][r=69.6MiB/s,w=0KiB/s][r=17.8k,w=0 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=1360: Wed Dec 13 23:21:16 2017 <--System Time

After:
fio-3.2-72-ge80d-dirty
Starting 1 thread
Jobs: 1 (f=0): [f(1)][100.0%][r=73.2MiB/s,w=0KiB/s][r=18.7k,w=0 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=8088: Wed Dec 13 15:22:07 2017 <--Local Time

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years ago.gitignore: ignore tags files and additional output binaries
Robert Elliott [Mon, 4 Dec 2017 20:53:16 +0000 (14:53 -0600)]
.gitignore: ignore tags files and additional output binaries

Ignore tags files used by emacs and ctags/vim.

Ignore the additional output binaries alongside fio, such as gfio
and all the programs in t/.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoserver: initialize first iolog header properly
Jens Axboe [Wed, 13 Dec 2017 15:44:34 +0000 (08:44 -0700)]
server: initialize first iolog header properly

We're sending potential stack garbage over the wire, init the
whole pdu to zeroes before filling it in. This shuts up valgrind
about using uninitialized memory.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agofio: kill td->nr_normal_files
Jens Axboe [Fri, 8 Dec 2017 19:50:28 +0000 (12:50 -0700)]
fio: kill td->nr_normal_files

It's unused.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoRemove old emails
Jens Axboe [Fri, 8 Dec 2017 19:38:27 +0000 (12:38 -0700)]
Remove old emails

Just use my private email, it's the one I prefer using anyway.
Remove the old fusionio/oracle emails, they just cause
confusion and people tend to just write to all of them at once
when reporting an issue.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agorate: fix bad math
Jens Axboe [Fri, 8 Dec 2017 18:59:38 +0000 (11:59 -0700)]
rate: fix bad math

To figure out how much data we missed when doing a thinktime sleep,
we're currently dividing by the time slept. This is wrong, it should
be multiplied by the time slept and divided by 1000000 to go from
usec to a second base.

Additionally, don't ever subtract more than a block of data, and
adjust down depending on sleep.

Fixes: 1aa39b0c ("rate: ensure IO issue restarts right after sleep")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agorate: ensure IO issue restarts right after sleep
Jens Axboe [Thu, 7 Dec 2017 16:06:04 +0000 (09:06 -0700)]
rate: ensure IO issue restarts right after sleep

If we have rate_ignore_thinktime set, we account the number of bytes
we would have done in the period of the sleep. However, we need
to subtract one block, otherwise we end up doing a rated sleep
right after the thinktime sleep.

Fixes: 1a9bf814 ("Add option to ignore thinktime for rated IO")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: rate cleanup and spelling error
Jens Axboe [Wed, 6 Dec 2017 19:30:20 +0000 (12:30 -0700)]
io_u: rate cleanup and spelling error

Fixes: 50a8ce86 ("Implement new Rate Control")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoAdd option to ignore thinktime for rated IO
Jens Axboe [Wed, 6 Dec 2017 19:27:07 +0000 (12:27 -0700)]
Add option to ignore thinktime for rated IO

By default, fio will ignore thinktime when calculating the next
time to issue and IO, if rated IO is specified. This leads to
fio entering a catch-up type of mode after doing the specified
sleep. For some workloads, that may not be useful. If someone
asks for a specific amount of IOPS and sets a thinktime, they
may want to exclude the sleep time.

Fixes: https://github.com/axboe/fio/issues/497
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agofix verify_only when using ioengine=mmap
Barak Pinhas [Tue, 5 Dec 2017 12:23:22 +0000 (14:23 +0200)]
fix verify_only when using ioengine=mmap

verify_only was opening the file with O_RDONLY and the mmap
engine was trying to mmap it with PROT_READ | PROTWRITE hence
getting -EACCESS and failing the job

6 years agoMerge branch 'wip-cleanup' of https://github.com/ZVampirEM77/fio
Jens Axboe [Sun, 3 Dec 2017 17:11:53 +0000 (10:11 -0700)]
Merge branch 'wip-cleanup' of https://github.com/ZVampirEM77/fio

6 years agoconfigure: fix typos
Enming Zhang [Sun, 3 Dec 2017 09:50:10 +0000 (17:50 +0800)]
configure: fix typos

check for rbd_invaidate_cache() --> check for rbd_invalidate_cache()

Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
6 years agosteadystate: style cleanup
Jens Axboe [Sat, 2 Dec 2017 23:29:44 +0000 (16:29 -0700)]
steadystate: style cleanup

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agosteadystate: add free helper
Jens Axboe [Sat, 2 Dec 2017 16:18:46 +0000 (09:18 -0700)]
steadystate: add free helper

Also fix a style issue.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agothread_options: drop fadvise_stream from thread_options
Vincent Fu [Fri, 1 Dec 2017 21:52:08 +0000 (16:52 -0500)]
thread_options: drop fadvise_stream from thread_options

ae8e559e got rid of the fadvise_stream option but did
not remove the corresponding member from thread_options

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agomemcpy: add hybrid
Jens Axboe [Fri, 1 Dec 2017 21:49:42 +0000 (14:49 -0700)]
memcpy: add hybrid

Use builtin memcpy for < 64 bytes, use simple variant for larger
ones. libc doesn't seem to like to use SSE, the hand rolled simple
variant uses that for larger copies.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agomemcpy: free buffer in case of failure
Jens Axboe [Fri, 1 Dec 2017 20:56:09 +0000 (13:56 -0700)]
memcpy: free buffer in case of failure

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agomemcpy: use malloc
Jens Axboe [Fri, 1 Dec 2017 18:30:49 +0000 (11:30 -0700)]
memcpy: use malloc

We don't have posix_memalign() everywhere, let's just use malloc.

Also free memory when done.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agofio_time: should include time.h
Jens Axboe [Fri, 1 Dec 2017 18:21:58 +0000 (11:21 -0700)]
fio_time: should include time.h

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoAdd basic memcpy test
Jens Axboe [Fri, 1 Dec 2017 18:13:23 +0000 (11:13 -0700)]
Add basic memcpy test

Research is ongoing in how to improve (and make deterministic) the
memcpy speed, since it's especially applicable to the persistent
memory engines.

Not documented yet.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: don't account io issue blocks for verify backlog
Jens Axboe [Fri, 1 Dec 2017 04:48:12 +0000 (21:48 -0700)]
io_u: don't account io issue blocks for verify backlog

We don't account the bytes, we should not account the blocks
either.

Fixes: ae2fafc8 ("verify: verify bytes should not add to this_io_bytes")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agooptions: warn if we exceed the supported number of split entries
Jens Axboe [Fri, 1 Dec 2017 04:29:32 +0000 (21:29 -0700)]
options: warn if we exceed the supported number of split entries

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoDocumentation: add note about how many bssplit and zones fio supports
Jens Axboe [Fri, 1 Dec 2017 04:28:15 +0000 (21:28 -0700)]
Documentation: add note about how many bssplit and zones fio supports

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoioengine: don't account verify bytes
Jens Axboe [Fri, 1 Dec 2017 03:24:54 +0000 (20:24 -0700)]
ioengine: don't account verify bytes

If we do that, we can terminate early for a readwrite+verify
backlog workload.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoclient: fix use-after-free for client timeout
Jens Axboe [Fri, 1 Dec 2017 02:50:34 +0000 (19:50 -0700)]
client: fix use-after-free for client timeout

We free the reply, but if it times out, we dereference it afterwards.
Store the opcode before calling into handle_cmd_timeout().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoengines/dev-dax: fix leak of 'sfile' in error case
Jens Axboe [Fri, 1 Dec 2017 02:48:25 +0000 (19:48 -0700)]
engines/dev-dax: fix leak of 'sfile' in error case

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agot/verify-state: fix leak in error case
Jens Axboe [Fri, 1 Dec 2017 02:47:42 +0000 (19:47 -0700)]
t/verify-state: fix leak in error case

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agobackend: make it clear that we passed 'fd' to the new thread
Jens Axboe [Fri, 1 Dec 2017 02:45:05 +0000 (19:45 -0700)]
backend: make it clear that we passed 'fd' to the new thread

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agogettime-thread: fix failure to check setaffinity return value
Jens Axboe [Fri, 1 Dec 2017 02:41:22 +0000 (19:41 -0700)]
gettime-thread: fix failure to check setaffinity return value

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoDocumentation cleanup
Jens Axboe [Fri, 1 Dec 2017 02:17:38 +0000 (19:17 -0700)]
Documentation cleanup

- Space at end-of-line for the significant_figures change
- > 80 char line section in HOWTO

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agooptions: don't overrun bssplit array
Jens Axboe [Thu, 30 Nov 2017 23:49:23 +0000 (16:49 -0700)]
options: don't overrun bssplit array

Since we now have a different number of splits we support for
zones and block size splits, make sure we pass in the right
max.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoBump support of zones to 256 max
Jens Axboe [Thu, 30 Nov 2017 23:47:27 +0000 (16:47 -0700)]
Bump support of zones to 256 max

This moves it from 64 to 256.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agosteadystate: make flags conform to usual fio standard
Jens Axboe [Thu, 30 Nov 2017 23:43:18 +0000 (16:43 -0700)]
steadystate: make flags conform to usual fio standard

__VAL are usually bit shift values, with VAL being the proper
mask. For some reason, the steadystate code uses both as
masks, fix that up.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoserver: process connection list before executing trigger
Jens Axboe [Thu, 30 Nov 2017 20:28:48 +0000 (13:28 -0700)]
server: process connection list before executing trigger

This shrinks the window a bit for allowing the backend to notice
that jobs have gone away, and notify the client.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoclient: ignore a client timeout, if the last thing we saw as a trigger
Jens Axboe [Thu, 30 Nov 2017 20:27:40 +0000 (13:27 -0700)]
client: ignore a client timeout, if the last thing we saw as a trigger

If triggers are used and are fatal to the fio backend (killing power,
etc), then we don't have time to process the stop/quit commands. We
expect the client to go away, but the backend can't let us know.

If the last thing we saw was a trigger command, don't exit in error
if the client times out and goes away.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agofio: add check rate flag
Jens Axboe [Thu, 30 Nov 2017 17:59:25 +0000 (10:59 -0700)]
fio: add check rate flag

One of the things we do a lot for each IO, is check if we should be
checking the rate. Add a specific flag for that case, so we can answer
that question very cheaply.

This is good for more than a 5% speedup for a null engine test case.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: speed up small_content_scramble()
Jens Axboe [Thu, 30 Nov 2017 16:18:37 +0000 (09:18 -0700)]
io_u: speed up small_content_scramble()

This is a hot path for write workloads, since we don't want to send the
same buffers to the device again and again. The idea is to defeat basic
dedupe/compression, but slightly modifying the buffer for each write.
small_content_scramble() does this by filling in the io_u offset into a
random spot in each 512b chunk of an io buffer, and filling in the start
time (sec,nsec) at the end of each 512b chunk.

With this change, we still do those two things, but we generate a random
cacheline within each 512b chunk, and fill the offset at the beginning
of the cacheline, and the time at the end of it.  This means that
instead of potentially dirtying 2 cachelines for each 512b chunk in an
IO buffer, we dirty just 1.

The results should still be random enough that small_content_scramble()
fullfils the promise to defeat basic dedupe and compression, but it is
lighter to run.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: cleanup check_get_trim()
Jens Axboe [Thu, 30 Nov 2017 14:03:33 +0000 (07:03 -0700)]
io_u: cleanup check_get_trim()

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: tweak small content buffer scramble
Jens Axboe [Thu, 30 Nov 2017 13:50:36 +0000 (06:50 -0700)]
io_u: tweak small content buffer scramble

We currently generate a 'random' offset in a 512b chunk to fill in
the offset. Since we don't want the later time scramble to
overwrite it, we check and adjust for that. Instead just ensure that
we generate a random offset in the first half of the 512b chunk,
then we know we never overlap.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: use nsec value for buffer scramble
Jens Axboe [Thu, 30 Nov 2017 13:26:21 +0000 (06:26 -0700)]
io_u: use nsec value for buffer scramble

Just use the nanosecond value directly, it's pointless to shift
it down and lose 10 bits with of scrambling data.

Fixes: d5d3795c ("io_u: don't do expensive int divide for buffer scramble")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agooptions: correct parser type for max_latency
Jens Axboe [Thu, 30 Nov 2017 05:11:09 +0000 (22:11 -0700)]
options: correct parser type for max_latency

It's a 64-bit type now, use the proper time conversion type.

Fixes: c3a32714 ("Change latency targets to be in nsec values internally")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoverify: convert hdr time to sec+nsec
Jens Axboe [Thu, 30 Nov 2017 05:00:35 +0000 (22:00 -0700)]
verify: convert hdr time to sec+nsec

Use the internal values instead of converting.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoverify: kill unneeded forward declaration
Jens Axboe [Thu, 30 Nov 2017 04:58:28 +0000 (21:58 -0700)]
verify: kill unneeded forward declaration

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoChange latency targets to be in nsec values internally
Jens Axboe [Thu, 30 Nov 2017 04:52:46 +0000 (21:52 -0700)]
Change latency targets to be in nsec values internally

Since all of our timekeeping is in nsec now, it's easier to convert
these at init time and not have to do it at runtime.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agooptions: make max_latency a 64-bit variable
Jens Axboe [Thu, 30 Nov 2017 04:47:43 +0000 (21:47 -0700)]
options: make max_latency a 64-bit variable

Also removes one pad in the thread options. This should bump
the protocol version, but we just did that, so let it slide.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agooptions: make it clear that max_latency is in usecs
Jens Axboe [Thu, 30 Nov 2017 04:30:21 +0000 (21:30 -0700)]
options: make it clear that max_latency is in usecs

The other latency options include this in their long name.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: do nsec -> usec converison in one spot in account_io_completion()
Jens Axboe [Thu, 30 Nov 2017 04:25:32 +0000 (21:25 -0700)]
io_u: do nsec -> usec converison in one spot in account_io_completion()

Should not matter for runtime, but it's cleaner.

What we should really do is convert the internal values to nsec, so
we don't have to do this conversion.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: don't do expensive int divide for buffer scramble
Jens Axboe [Thu, 30 Nov 2017 04:01:36 +0000 (21:01 -0700)]
io_u: don't do expensive int divide for buffer scramble

We don't need the conversion from nsec to usec to be exact, so
just shift by 10 instead.

Fixes: 8b6a404cd ("nanosecond: initial commit changing timeval to timespec")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoUnify max split zone support
Jens Axboe [Thu, 30 Nov 2017 03:51:09 +0000 (20:51 -0700)]
Unify max split zone support

We have two different defines, use the one from the networking
protocol. Add a compile time check that bssplit and zones
have the same max, so we don't inadvertently add an overflow
condition if we change one of them.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoio_u: cleanup and simplify __get_next_rand_offset_zoned_abs()
Jens Axboe [Thu, 30 Nov 2017 03:45:33 +0000 (20:45 -0700)]
io_u: cleanup and simplify __get_next_rand_offset_zoned_abs()

We can drop various variables, it's easier to read this way too.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoexamples/rand-zones.fio: add zoned_abs example
Jens Axboe [Thu, 30 Nov 2017 02:29:25 +0000 (19:29 -0700)]
examples/rand-zones.fio: add zoned_abs example

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoAdd support for absolute random zones
Jens Axboe [Thu, 30 Nov 2017 02:25:59 +0000 (19:25 -0700)]
Add support for absolute random zones

We currently support random_distribution=zoned, which allows the user
to specify a percentage of access to a zoned define as a percentage
of the file/device size. This commit adds support for zoned_abs,
which works exactly like zoned, except you give the zone size in
an absolute value.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agooptions: don't quicksort zoned distribution series
Jens Axboe [Wed, 29 Nov 2017 19:37:30 +0000 (12:37 -0700)]
options: don't quicksort zoned distribution series

If we do that, we mess up the distribution.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoRevert "Avoid irrelevant "offset extend ends" error message for chrdev"
Tomohiro Kusumi [Wed, 29 Nov 2017 09:29:22 +0000 (11:29 +0200)]
Revert "Avoid irrelevant "offset extend ends" error message for chrdev"

This reverts commit 0f34169ac64f009b193bed1c8fb6692844bf99c2.

> Commit 0f34169a broke it, moving a check from a non-character
> device path up a level to where it now triggers on a character
> device (for which the size is left set to -1ULL).
>
> This gets it working again:
>         git revert 0f34169a
>         make
>
> Tomohiro, could you help prepare a better fix?

Sorry, I'll just revert it at the moment.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoinit: did_arg cleanup
Jens Axboe [Tue, 28 Nov 2017 23:00:22 +0000 (16:00 -0700)]
init: did_arg cleanup

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoinit: remove dead code
Jens Axboe [Tue, 28 Nov 2017 21:02:11 +0000 (14:02 -0700)]
init: remove dead code

We know did_arg == 0 here, so kill the other part.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoinit: check and fail status-interval settings that are too small
Jens Axboe [Tue, 28 Nov 2017 17:11:53 +0000 (10:11 -0700)]
init: check and fail status-interval settings that are too small

Smallest possible value is 1ms, so fail any setting that yields
a value less than that.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agodocs: Add documention for RDMA ioengine options.
Stephen Bates [Thu, 23 Nov 2017 19:21:56 +0000 (12:21 -0700)]
docs: Add documention for RDMA ioengine options.

Add documentation to HOWTO and the man page for the RDMA ioengine
options as these were missing.

Signed-off-by: Stephen Bates <sbates@raithlin.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'cleanup' of https://github.com/sitsofe/fio
Jens Axboe [Thu, 23 Nov 2017 02:58:21 +0000 (19:58 -0700)]
Merge branch 'cleanup' of https://github.com/sitsofe/fio

6 years agodoc: reword buffer_compress_percentage, buffer_compress_chunk, dedupe_percentage
Sitsofe Wheeler [Wed, 22 Nov 2017 22:58:10 +0000 (22:58 +0000)]
doc: reword buffer_compress_percentage, buffer_compress_chunk, dedupe_percentage

Make the documentation for these options better reflect how buffer
compression and dedupe tuning can be used since commit
1de80624466405bccdbc4607d71cd249320da3f1 ("Default buffer_compress_chunk
to 512").

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agoHOWTO: fix up broken formatting in logging options
Sitsofe Wheeler [Wed, 22 Nov 2017 22:38:18 +0000 (22:38 +0000)]
HOWTO: fix up broken formatting in logging options

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
6 years agoadd significant_figures parameter
Jeff Furlong [Wed, 22 Nov 2017 18:38:33 +0000 (11:38 -0700)]
add significant_figures parameter

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agordma: Add bind option
Stephen Bates [Wed, 22 Nov 2017 18:24:56 +0000 (11:24 -0700)]
rdma: Add bind option

In certain configurations it can be useful to bind a rdma_cm to a
particular network interface. For example in multi-path or loopback.

Add a bindname option that the local rdma_cm will try and bind too.

The bind code is based off that used in rping [1].

[1] https://github.com/linux-rdma/rdma-core/blob/ \
    master/librdmacm/examples/rping.c

Signed-off-by: Stephen Bates <sbates@raithlin.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'libpmem'
Jens Axboe [Fri, 17 Nov 2017 16:21:19 +0000 (09:21 -0700)]
Merge branch 'libpmem'

Merge in libpmem engine, with fixes.

6 years agoexamples/libpmem.fio: clean up example
Jens Axboe [Fri, 17 Nov 2017 16:20:52 +0000 (09:20 -0700)]
examples/libpmem.fio: clean up example

Spelling errors, typos, etc.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agolibpmem: move mmap alignment to init time
Jens Axboe [Fri, 17 Nov 2017 16:19:26 +0000 (09:19 -0700)]
libpmem: move mmap alignment to init time

Also use the generally available page_size, don't need to roll our
own in there.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agolibpmem: code cleanups
Jens Axboe [Fri, 17 Nov 2017 16:16:44 +0000 (09:16 -0700)]
libpmem: code cleanups

No functional changes in this patch.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'add-libpmem-engine' of https://github.com/tishizaki/fio into libpmem
Jens Axboe [Fri, 17 Nov 2017 16:03:23 +0000 (09:03 -0700)]
Merge branch 'add-libpmem-engine' of https://github.com/tishizaki/fio into libpmem

6 years agofio: add libpmem engine
Teruaki Ishizaki [Fri, 17 Nov 2017 02:54:26 +0000 (11:54 +0900)]
fio: add libpmem engine

Adding an ioengine that access with the libpmem as memory
through a memory mmaped file on DAX filesystem.

It's very similar to the mmap engine and the dev-dax engine.

Signed-off-by: Teruaki Ishizaki <ishizaki.teruaki@lab.ntt.co.jp>
Signed-off-by: Takashi Menjo <menjo.takashi@lab.ntt.co.jp>