fio.git
5 years agodoc: improve readonly option description
Vincent Fu [Mon, 18 Jun 2018 15:48:17 +0000 (09:48 -0600)]
doc: improve readonly option description

Make explicit that --readonly also prevents trim workloads
Drop the mention of the check in the I/O engine core because
fio_ro_check() is run even without the readonly option

5 years agooptions: check for conflict between trims and readonly option
Vincent Fu [Fri, 15 Jun 2018 21:52:43 +0000 (15:52 -0600)]
options: check for conflict between trims and readonly option

When processing the readwrite option, make sure that trim operations
are not requested if readonly is set.

5 years agoinit: abort write and trim jobs when --readonly option is present
Vincent Fu [Fri, 15 Jun 2018 21:17:38 +0000 (15:17 -0600)]
init: abort write and trim jobs when --readonly option is present

Check for conflicts between --readonly and the job's data direction
in fixup_options(). rw_verify() in options.c only detects this
conflict if --readonly precedes --readwrite on the command line.

5 years agoinit: ensure that fatal errors in fixup_options are always propogated to caller
Vincent Fu [Fri, 15 Jun 2018 21:11:10 +0000 (15:11 -0600)]
init: ensure that fatal errors in fixup_options are always propogated to caller

When warnings_fatal = 0, fatal problems detected in fixup_options
may not always be propogated back to the caller. This patch ensures
that the caller will always be notified about fatal problems.

5 years agofilesetup: make trim jobs respect --readonly during file open
Vincent Fu [Fri, 15 Jun 2018 21:05:28 +0000 (15:05 -0600)]
filesetup: make trim jobs respect --readonly during file open

Open files for trim workloads with the O_RDWR access mode only when
the --readonly option is absent.

5 years agofio.h: also check trim operations in fio_ro_check
Vincent Fu [Fri, 15 Jun 2018 21:00:25 +0000 (15:00 -0600)]
fio.h: also check trim operations in fio_ro_check

IO engines call fio_ro_check to ensure that the data direction
set in the thread data structure permits writes before proceeding
with a write io_u. This patch makes fio_ro_check ensure that the
data direction also permits trims before proceeding with a trim
io_u.

5 years agoclient: close dup'ed descriptor if fdopen() fails
Jens Axboe [Fri, 15 Jun 2018 15:18:04 +0000 (09:18 -0600)]
client: close dup'ed descriptor if fdopen() fails

The saga continues... Ensure that we close the dup'ed descriptor,
if we give up due to fdopen() failure.

Reported-by: Bart Van Assche <bart.vanassche@wdc.com>
Fixes: ec9e13345f3f ("client: check return of dup(2)")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: check return of dup(2)
Jens Axboe [Fri, 15 Jun 2018 15:10:48 +0000 (09:10 -0600)]
client: check return of dup(2)

If dup(2) fails, we can't pass it to fdopen.

Fixes: b4f5e72f1383 ("client: parse env variables before sending job-file contents to server")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: parse env variables before sending job-file contents to server
Tomohiro Kusumi [Fri, 15 Jun 2018 14:58:22 +0000 (08:58 -0600)]
client: parse env variables before sending job-file contents to server

Fixes "fio environment var bug".
https://www.spinics.net/lists/fio/msg07093.html

Add read_ini_data() to parse and expand env variables within job-file
before sending to server. By doing this, clients can control parameters
embedded within the job-file, without server side having to set them
separately.

Reported-by: Jeff Furlong <jeff.furlong@wdc.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Minor fixups from Jens.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agorand: make randX_upto() do the end value increment
Jens Axboe [Tue, 12 Jun 2018 17:43:29 +0000 (11:43 -0600)]
rand: make randX_upto() do the end value increment

We should not do it in the caller, the functions that need
fixing are really rand32/64_upto() instead.

Also move a (now) misplaced comment.

Fixes: c6fc6d2ab2c2 ("rand: ensure that rand_between() can reach max value")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agorand: ensure that rand_between() can reach max value
Jens Axboe [Tue, 12 Jun 2018 17:37:16 +0000 (11:37 -0600)]
rand: ensure that rand_between() can reach max value

We need to add 1, otherwise the maximum generated value will
be end -1. The API is both inclusive.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoinit: use o-> instead of td->o
Jens Axboe [Tue, 12 Jun 2018 14:51:07 +0000 (08:51 -0600)]
init: use o-> instead of td->o

We already have the options pointer, just use it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoinit: kill get_rand_start_delay()
Jens Axboe [Tue, 12 Jun 2018 14:47:08 +0000 (08:47 -0600)]
init: kill get_rand_start_delay()

It's now useless, just call rand_between().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agorand: cleanup rand_between() and helpers
Jens Axboe [Tue, 12 Jun 2018 14:42:49 +0000 (08:42 -0600)]
rand: cleanup rand_between() and helpers

Make the 32/64-bit helper just return a random number up to a certain
value, and let the generic helper handle the range part.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agorand: add rand64_between()
Jens Axboe [Tue, 12 Jun 2018 14:10:47 +0000 (08:10 -0600)]
rand: add rand64_between()

For some reason we only had the 32-bit variant, and there's
a use case for the 64-bit version. Add that, and add a
32/64 agnostic helper that can be called.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoFix start delay being the same across threads
Jens Axboe [Tue, 12 Jun 2018 02:02:10 +0000 (20:02 -0600)]
Fix start delay being the same across threads

Two issues here:

1) We copy the start_delay into the original thread, which ends up
   offsetting job 2..N off the thread 1 start delay
2) We don't initialize the start delay random seed prior to
   generating the offsets

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agostat: fix --bandwidth-log segfault
Igor Konopko [Fri, 8 Jun 2018 08:26:25 +0000 (10:26 +0200)]
stat: fix --bandwidth-log segfault

Since bandwidth log has no corresponding thread data
and pending struct, we cannot access any fields inside it.

Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoidle-prof: Fix segment fault issue when run with '--idle-prof' and multiple output...
Friendy.Su@sony.com [Fri, 8 Jun 2018 02:27:25 +0000 (20:27 -0600)]
idle-prof: Fix segment fault issue when run with '--idle-prof' and multiple output format normal,json

Original issue:

./fio --output-format=normal,json --idle-prof=system jobfile.job

job1: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=sync, iodepth=1
fio-3.7-19-ga43f
Starting 1 process
Segmentation fault (core dumped)

Fix solution:

do fio_idle_prof_cleanup() after all formats of output shown.

Signed-off-by: friendy-su <friendy.su@sony.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoFix variable shadowing
Jens Axboe [Tue, 5 Jun 2018 19:44:47 +0000 (13:44 -0600)]
Fix variable shadowing

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoiolog: remove 'td' from trim_io_piece()
Jens Axboe [Tue, 5 Jun 2018 19:34:47 +0000 (13:34 -0600)]
iolog: remove 'td' from trim_io_piece()

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: remove 'cmd' argument to stop handler
Jens Axboe [Tue, 5 Jun 2018 19:33:50 +0000 (13:33 -0600)]
client: remove 'cmd' argument to stop handler

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agooptions: remove unused function parameters
Jens Axboe [Tue, 5 Jun 2018 19:30:57 +0000 (13:30 -0600)]
options: remove unused function parameters

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agolog: fix signedness issue
Jens Axboe [Tue, 5 Jun 2018 19:37:56 +0000 (13:37 -0600)]
log: fix signedness issue

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agogettime: remove 'is_thread' variable to local clock init
Jens Axboe [Tue, 5 Jun 2018 19:19:33 +0000 (13:19 -0600)]
gettime: remove 'is_thread' variable to local clock init

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agox86: don't need 'level' passed to amd/intel init functions
Jens Axboe [Tue, 5 Jun 2018 19:18:02 +0000 (13:18 -0600)]
x86: don't need 'level' passed to amd/intel init functions

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoCleanup should_check_rate()
Jens Axboe [Tue, 5 Jun 2018 19:21:36 +0000 (13:21 -0600)]
Cleanup should_check_rate()

Don't need to check direction for __should_check_rate(), so
clean up the logic.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agofallocate: use 'offset' parameter
Jens Axboe [Tue, 5 Jun 2018 19:15:27 +0000 (13:15 -0600)]
fallocate: use 'offset' parameter

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'make-nowarn-snprintf-call-va-end' of https://github.com/bvanassche/fio
Jens Axboe [Tue, 5 Jun 2018 17:20:45 +0000 (11:20 -0600)]
Merge branch 'make-nowarn-snprintf-call-va-end' of https://github.com/bvanassche/fio

* 'make-nowarn-snprintf-call-va-end' of https://github.com/bvanassche/fio:
  Make nowarn_snprintf() call va_end()

5 years agoMake nowarn_snprintf() call va_end()
Bart Van Assche [Tue, 5 Jun 2018 17:15:18 +0000 (19:15 +0200)]
Make nowarn_snprintf() call va_end()

This patch suppresses the following Coverity complaint:

CID 175867:  API usage errors  (VARARGS)
    va_end was not called for "args".

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agoMove nowarn_snprintf.h to lib/
Jens Axboe [Tue, 5 Jun 2018 17:11:03 +0000 (11:11 -0600)]
Move nowarn_snprintf.h to lib/

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'suppress-gcc-8-warnings' of https://github.com/bvanassche/fio
Jens Axboe [Tue, 5 Jun 2018 16:44:51 +0000 (10:44 -0600)]
Merge branch 'suppress-gcc-8-warnings' of https://github.com/bvanassche/fio

* 'suppress-gcc-8-warnings' of https://github.com/bvanassche/fio:
  Suppress gcc 8 compiler warnings

5 years agoSuppress gcc 8 compiler warnings
Bart Van Assche [Tue, 5 Jun 2018 16:16:30 +0000 (18:16 +0200)]
Suppress gcc 8 compiler warnings

Introduce a new function nowarn_snprintf() that behaves identically
to snprintf() except that it does not make gcc complain about potential
truncation of the output buffer.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agoMerge branch 'appveyor' of https://github.com/bvanassche/fio
Jens Axboe [Tue, 5 Jun 2018 14:32:20 +0000 (08:32 -0600)]
Merge branch 'appveyor' of https://github.com/bvanassche/fio

* 'appveyor' of https://github.com/bvanassche/fio:
  Rename appveyor.yml into .appveyor.yml

5 years agoMerge branch 'remove-show-run-stats' of https://github.com/bvanassche/fio
Jens Axboe [Tue, 5 Jun 2018 14:29:21 +0000 (08:29 -0600)]
Merge branch 'remove-show-run-stats' of https://github.com/bvanassche/fio

* 'remove-show-run-stats' of https://github.com/bvanassche/fio:
  Remove show_run_stats() because it has no callers

5 years agoRename appveyor.yml into .appveyor.yml
Bart Van Assche [Tue, 5 Jun 2018 08:27:23 +0000 (10:27 +0200)]
Rename appveyor.yml into .appveyor.yml

Make the appveyor.yml file less visible because it is not a fio source
code file.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agoRemove show_run_stats() because it has no callers
Bart Van Assche [Tue, 5 Jun 2018 07:08:50 +0000 (09:08 +0200)]
Remove show_run_stats() because it has no callers

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agoFix issue with rate_process=poisson and ramp time
Jens Axboe [Mon, 4 Jun 2018 19:51:47 +0000 (13:51 -0600)]
Fix issue with rate_process=poisson and ramp time

Fix from shimrot

Fixes: https://github.com/axboe/fio/issues/596
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoFio 3.7 fio-3.7
Jens Axboe [Fri, 1 Jun 2018 19:21:56 +0000 (13:21 -0600)]
Fio 3.7

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoio_u: ensure to invalidate cache on time_based random reads
Jens Axboe [Thu, 31 May 2018 15:05:59 +0000 (09:05 -0600)]
io_u: ensure to invalidate cache on time_based random reads

We need to do this with the file reset and retrieval of a
new offset, not of it fails.

Fixes: 0bcf41cdc22df ("io_u: re-invalidate cache when looping around without file open/close")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoFix typo in bssplit documentation
Jens Axboe [Fri, 25 May 2018 14:14:50 +0000 (08:14 -0600)]
Fix typo in bssplit documentation

One of the examples uses a ',' where it should be a ':' to
behave like described.

Reported-by: Konstantin Ruvinsky <konstantin.ruvinsky@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agomake fio scripts python3-ready (part 2)
Bill O'Donnell [Tue, 22 May 2018 17:49:09 +0000 (12:49 -0500)]
make fio scripts python3-ready (part 2)

NOTE: this patch (part 2) is in addition to commit 5eac3b00238b
(this patch was missed on that submit/commit (part 1)).

Many distributions are moving to python3 by default.  This is
another patch to make the python scripts in fio python3-ready.

Conversion was facilitated with automated tools.

The modified scripts pass rudimentary testing when run under
python2.7 as well as python3.

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'sg-verify2' of https://github.com/vincentkfu/fio
Jens Axboe [Fri, 18 May 2018 19:34:36 +0000 (13:34 -0600)]
Merge branch 'sg-verify2' of https://github.com/vincentkfu/fio

* 'sg-verify2' of https://github.com/vincentkfu/fio:
  docs: add documentation for sg ioengine WRITE SAME, WRITE AND VERIFY command support
  engines/sg: add support for WRITE AND VERIFY, WRITE SAME

5 years agodocs: add documentation for sg ioengine WRITE SAME, WRITE AND VERIFY command support
Vincent Fu [Thu, 17 May 2018 14:08:03 +0000 (10:08 -0400)]
docs: add documentation for sg ioengine WRITE SAME, WRITE AND VERIFY command support

5 years agoengines/sg: add support for WRITE AND VERIFY, WRITE SAME
Vincent Fu [Wed, 16 May 2018 23:17:47 +0000 (19:17 -0400)]
engines/sg: add support for WRITE AND VERIFY, WRITE SAME

Add an sg ioengine option to treat write IO as either WRITE AND VERIFY
or WRITE SAME commands

The new ioengine option sg_write_mode can take 3 values:

write (default)
  WRITE opcodes are issued as usual
verify
  WRITE AND VERIFY opcodes are issued
same
  WRITE SAME opcodes are issued

WRITE AND VERIFY opcodes are issued with the BYTCHK bit set to 0. This
directs the device to carry out a medium verification with no data
comparison.

WRITE SAME transfers a single block of data to the device and writes
this same block of data to a contiguous sequence of LBAs beginning at
the specified offset.

fio's block size parameter specifies the amount of data written with
each command. However, the amount of data actually transferred to the
device is equal to the device's block (sector) size. For a device with
512 byte sectors, blocksize=8k will write 16 sectors with each command.
fio will still generate 8k of data for each command but only the first
512 bytes will be used and transferred to the device.

5 years agomake fio scripts python3-ready
Bill O'Donnell [Fri, 4 May 2018 19:43:40 +0000 (14:43 -0500)]
make fio scripts python3-ready

Many distributions are moving to python3 by default.  Here's
an attempt to make the python scripts in fio python3-ready.

Conversion was facilitated with automated tools. A few areas
were hand fixed: remove superfluous parentheses introduced by
2to3 converter in print function calls, shebang modifications
to use environment variable for python version, and byte-string
decode correction in steadystate_tests.py following 2to3
conversion.

The modified scripts pass rudimentary testing when run under
python2.7 as well as python3.

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'master' of https://github.com/majianpeng/fio
Jens Axboe [Tue, 15 May 2018 01:40:32 +0000 (19:40 -0600)]
Merge branch 'master' of https://github.com/majianpeng/fio

* 'master' of https://github.com/majianpeng/fio:
  This partly revert 97bb54c9606c(add __load_ioengine() to separate ioengine loading from td context)

5 years agoThis partly revert 97bb54c9606c(add __load_ioengine() to separate ioengine loading...
Jianpeng Ma [Mon, 14 May 2018 16:14:01 +0000 (00:14 +0800)]
This partly revert 97bb54c9606c(add __load_ioengine() to separate ioengine loading from td context)

In commit 97bb54c9606c, it change load_ioengine to __load_ioengine in
func fio_show_ioengine_help. The different between load_ioengine and
__load_ioengine is load_ioengine include __load_ioengine and if
__load_ioengine failed it will do dlopen_ioengine to find ioengine.
For external ioengine, if no dlopen_ioengine it can't find, etc
libfio_ceph_objectstore.so in Ceph project.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
5 years agoiolog: default to good return
Jens Axboe [Fri, 27 Apr 2018 04:45:04 +0000 (22:45 -0600)]
iolog: default to good return

We should only return failure if we attempted to load a log
and failed.

Fixes: b153f94a22d8 ("iolog/blktrace: boolean conversion")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoiolog/blktrace: boolean conversion
Jens Axboe [Fri, 27 Apr 2018 04:41:03 +0000 (22:41 -0600)]
iolog/blktrace: boolean conversion

They don't return error numbers, so switch to true/false for good/bad
return.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoblktrace: make sure to account SYNC/TRIM at load time
Jens Axboe [Fri, 27 Apr 2018 04:19:23 +0000 (22:19 -0600)]
blktrace: make sure to account SYNC/TRIM at load time

We currently only check for reads or writes, but it's OK to have
a workload that doesn't contain reads or writes. Only error if
we found no reads/writes/trims/syncs at all.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoUpdate documentation for 'replay_skip'
Jens Axboe [Thu, 26 Apr 2018 21:50:10 +0000 (15:50 -0600)]
Update documentation for 'replay_skip'

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMakefile: ensure we kill all object files
Jens Axboe [Thu, 26 Apr 2018 21:46:08 +0000 (15:46 -0600)]
Makefile: ensure we kill all object files

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoblktrace: add 'reply_skip' option
Jens Axboe [Thu, 26 Apr 2018 21:27:05 +0000 (15:27 -0600)]
blktrace: add 'reply_skip' option

Allows the user to skip certain IO types. Useful for replaying
workloads with trim on a device that doesn't support it, for
instance. Or just replaying parts of a workload (eg just writes,
or just reads).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoblktrace: kill zero sized write test
Jens Axboe [Thu, 26 Apr 2018 21:10:42 +0000 (15:10 -0600)]
blktrace: kill zero sized write test

Turns out they were flushes. Get rid of the check and turn it into
an assert.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoblktrace: handle flush/sync replay
Jens Axboe [Thu, 26 Apr 2018 21:01:40 +0000 (15:01 -0600)]
blktrace: handle flush/sync replay

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoblktrace: change barrier to a flush
Jens Axboe [Thu, 26 Apr 2018 20:52:03 +0000 (14:52 -0600)]
blktrace: change barrier to a flush

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoiolog: always use calloc() and always init both lists
Jens Axboe [Thu, 26 Apr 2018 20:44:18 +0000 (14:44 -0600)]
iolog: always use calloc() and always init both lists

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoblktrace: ignore 0 byte writes
Jens Axboe [Thu, 26 Apr 2018 19:23:10 +0000 (13:23 -0600)]
blktrace: ignore 0 byte writes

They cause fio to exit replay, but then retry since we didn't meet
our IO limit. When we retry, we attempt to close files that the
trace already closed, and we crash.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoblktrace: don't re-clear ipo
Jens Axboe [Thu, 26 Apr 2018 19:22:15 +0000 (13:22 -0600)]
blktrace: don't re-clear ipo

We overwrite the init of the list entry.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agot/*: missing statics
Jens Axboe [Tue, 24 Apr 2018 20:03:02 +0000 (14:03 -0600)]
t/*: missing statics

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoengines/libaio: don't sleep for 0 reap return for 0 event check
Jens Axboe [Tue, 24 Apr 2018 14:00:23 +0000 (08:00 -0600)]
engines/libaio: don't sleep for 0 reap return for 0 event check

If we have set iodepth_batch_complete_min to 0, then we should
not sleep for completion checking. If we do sleep, reduce the
sleep to 10usec, 100usec is a lot on modern devices.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoconfigure: use proper CONFIG_ prefix for asprintf/vasprintf
Jens Axboe [Sat, 21 Apr 2018 01:13:31 +0000 (19:13 -0600)]
configure: use proper CONFIG_ prefix for asprintf/vasprintf

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoengines: fixup fio_q_status style violations
Jens Axboe [Fri, 20 Apr 2018 15:46:19 +0000 (09:46 -0600)]
engines: fixup fio_q_status style violations

Commit d3b07186b1d4 broke lines in an unconventional manner, and
not consistently. Fix those up.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Fri, 20 Apr 2018 15:37:18 +0000 (09:37 -0600)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Introduce enum fio_q_status
  Remove dead code from fio_io_sync()
  gfapi: Make fio_gf_queue() set the I/O unit error status instead of returning -EINVAL
  Change return type of td_io_commit() into void
  Simplify num2str()
  Introduce enum n2s_unit
  Declare stat_calc_lat_nu() static

6 years agoIntroduce enum fio_q_status
Bart Van Assche [Tue, 17 Apr 2018 17:04:15 +0000 (10:04 -0700)]
Introduce enum fio_q_status

Introduce a new enumeration type fio_q_status. This patch does not
change any functionality but makes it clear which variables and
return values represent a queuing status value. Bump FIO_IOOPS_VERSION
because this patch changes the I/O engine API.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agoRemove dead code from fio_io_sync()
Bart Van Assche [Wed, 18 Apr 2018 20:06:59 +0000 (13:06 -0700)]
Remove dead code from fio_io_sync()

Due to the previous patch it is now guaranteed that the I/O engine
queue function returns a FIO_Q_* value. These values are >= 0.
Hence remove the code that depends on the queue function returning
a negative value.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agogfapi: Make fio_gf_queue() set the I/O unit error status instead of returning -EINVAL
Bart Van Assche [Wed, 18 Apr 2018 15:30:25 +0000 (08:30 -0700)]
gfapi: Make fio_gf_queue() set the I/O unit error status instead of returning -EINVAL

This makes the gfapi I/O engine more uniform with other I/O engines.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agoChange return type of td_io_commit() into void
Bart Van Assche [Tue, 17 Apr 2018 17:05:56 +0000 (10:05 -0700)]
Change return type of td_io_commit() into void

Since td_io_commit() always returns 0, change its return type from
int into void. This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agoSimplify num2str()
Bart Van Assche [Wed, 4 Apr 2018 22:14:18 +0000 (15:14 -0700)]
Simplify num2str()

Instead of translating the N2S_* constants into an array index inside
num2str(), make the N2S_* constants identical to the array index used
inside num2str(). This patch does not change the behavior of num2str().

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agoIntroduce enum n2s_unit
Bart Van Assche [Wed, 4 Apr 2018 21:36:40 +0000 (14:36 -0700)]
Introduce enum n2s_unit

This patch does not change any functionality but makes num2str() slightly
easier to read.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agoDeclare stat_calc_lat_nu() static
Bart Van Assche [Tue, 17 Apr 2018 23:08:54 +0000 (16:08 -0700)]
Declare stat_calc_lat_nu() static

This was suggested by the sparse static analyzer.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agoRemove verifysort/verifysort_nr from documentation
Jens Axboe [Wed, 18 Apr 2018 16:52:00 +0000 (10:52 -0600)]
Remove verifysort/verifysort_nr from documentation

They have been deprecated.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoiolog: update stale comment
Jens Axboe [Wed, 18 Apr 2018 14:12:07 +0000 (08:12 -0600)]
iolog: update stale comment

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoDeprecate verifysort and verifysort_nr
Jens Axboe [Wed, 18 Apr 2018 03:50:55 +0000 (21:50 -0600)]
Deprecate verifysort and verifysort_nr

It was an optimization to read back verifies in a sorted order,
for rotational storage. But I don't think the option makes much
sense, and I've never heard of anyone using it. Mark it as
deprecated, and always verify in the same order that IO was
written.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoparse: add support for soft deprecated options
Jens Axboe [Wed, 18 Apr 2018 03:49:51 +0000 (21:49 -0600)]
parse: add support for soft deprecated options

The currently deprecated option types will fail parsing. But we
can also have options where we don't care, log an error for those
but continue executing the job.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoinit: ensure that read/write use the same random seed for verify
Jens Axboe [Tue, 17 Apr 2018 23:48:43 +0000 (17:48 -0600)]
init: ensure that read/write use the same random seed for verify

If we are verifying, then reads need to use the same blockrange
random trim as writes. Otherwise doing a deferred verify of
a write job may not yield the same block size ranges, causing
verify to fail.

Example of failed job:

$ cat job.fio
[global]
ioengine=sync
verify=md5
bsrange=1k-16k
rw=randwrite
randseed=50
size=10m
filename=foo

[write]
rw=randwrite
do_verify=0
write_iolog=wlog

[read]
rw=randread
do_verify=1
verify_fatal=1
verify_dump=1
write_iolog=rlog

$ fio --section=write job.fio
$ fio --section=read job.fio

Fixes: https://github.com/axboe/fio/issues/582
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'nvml-to-pmdk' of https://github.com/sscargal/fio
Jens Axboe [Tue, 17 Apr 2018 01:40:46 +0000 (19:40 -0600)]
Merge branch 'nvml-to-pmdk' of https://github.com/sscargal/fio

* 'nvml-to-pmdk' of https://github.com/sscargal/fio:
  NVML references renamed to PMDK

6 years agoNVML references renamed to PMDK
sscargal [Mon, 16 Apr 2018 22:47:47 +0000 (16:47 -0600)]
NVML references renamed to PMDK

6 years agoFio 3.6 fio-3.6
Jens Axboe [Mon, 16 Apr 2018 15:22:37 +0000 (09:22 -0600)]
Fio 3.6

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agocconv: add conversion for 'replay_time_scale'
Jens Axboe [Sat, 14 Apr 2018 22:26:17 +0000 (16:26 -0600)]
cconv: add conversion for 'replay_time_scale'

This was forgotten in the previous commit.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoAdd 'replay_time_scale' option
Jens Axboe [Sat, 14 Apr 2018 22:23:33 +0000 (16:23 -0600)]
Add 'replay_time_scale' option

This allows the user to scale the replay speed of an IO trace. It
defaults to 100, meaning run at 100% the original rate. If set to
50, fio will replay at 50% the original IO rate. If set to 400,
fio will replay at 4x the original rate. And so on.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoiolog: fix issue with replay rate
Jens Axboe [Sat, 14 Apr 2018 21:22:10 +0000 (15:22 -0600)]
iolog: fix issue with replay rate

We attempt to keep the replay rate accurate, but we mistakenly use
the 'delay' value which we have decremented along the way. Store
the original and use that for the stall detection.

This fixes replays going quicker than they should.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'proc_group' of https://github.com/sitsofe/fio
Jens Axboe [Fri, 13 Apr 2018 23:25:35 +0000 (17:25 -0600)]
Merge branch 'proc_group' of https://github.com/sitsofe/fio

* 'proc_group' of https://github.com/sitsofe/fio:
  doc: add cpus_allowed reference to log_compression_cpus
  appveyor: make 32 bit build target XP + minor fixes
  configure/Makefile: make Cygwin force less
  doc: add Windows processor group behaviour and Windows target option
  windows: target Windows 7 and add support for more than 64 CPUs
  windows: prepare for Windows build split
  windows: update EULA

6 years agoos/os-dragonfly: sync with header file changes in upstream
Tomohiro Kusumi [Tue, 10 Apr 2018 15:35:32 +0000 (00:35 +0900)]
os/os-dragonfly: sync with header file changes in upstream

IOCTLTRIM was moved and renamed to a different header file,
so conditionally include previous or current header depending on
__DragonFly_version.

Some details in below commit messages.
In short, they have had IOCTLTRIM in a wrong header, and they
decided to fix/change it since fio was the only application using
IOCTLTRIM within their userspace package collections.

<sys/ioctl_compat.h>: Add a reminder comment about IOCTLTRIM.
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7226e3530be4df743a5cfe61f602b0c4bd436ee9

Move the IOCTLTRIM ioctl to a better header and rename it to DAIOCTRIM.
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/32506cfa691f80faa47486d6f94a98ae12387eeb

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agostat: remove dead 'nr_uninit' assignment
Jens Axboe [Mon, 9 Apr 2018 14:10:40 +0000 (08:10 -0600)]
stat: remove dead 'nr_uninit' assignment

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoinit: fix memory leak in error handling
Jens Axboe [Mon, 9 Apr 2018 14:07:26 +0000 (08:07 -0600)]
init: fix memory leak in error handling

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agosteadystate: check for division by zero in mean calculation
Jens Axboe [Sun, 8 Apr 2018 21:54:26 +0000 (15:54 -0600)]
steadystate: check for division by zero in mean calculation

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoeta: fix dead variable assignments
Jens Axboe [Sun, 8 Apr 2018 21:50:45 +0000 (15:50 -0600)]
eta: fix dead variable assignments

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoparse: fix dead 'org' assignment
Jens Axboe [Sun, 8 Apr 2018 21:48:35 +0000 (15:48 -0600)]
parse: fix dead 'org' assignment

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agofilesetup: fix dead assignment of 'ret'
Jens Axboe [Sun, 8 Apr 2018 21:47:55 +0000 (15:47 -0600)]
filesetup: fix dead assignment of 'ret'

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoclient: fix bad shadowing of 'ret'
Jens Axboe [Sun, 8 Apr 2018 21:46:17 +0000 (15:46 -0600)]
client: fix bad shadowing of 'ret'

Different scopes for ret, introduce 'wrote' to check the
return value of write(2).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoserver: fix dead assignment of variable
Jens Axboe [Sun, 8 Apr 2018 21:46:07 +0000 (15:46 -0600)]
server: fix dead assignment of variable

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoaxmap: use calloc() for level alloc
Jens Axboe [Sun, 8 Apr 2018 21:42:50 +0000 (15:42 -0600)]
axmap: use calloc() for level alloc

We rely on it being set to NULL for error handling.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoRemove binject engine
Jens Axboe [Sun, 8 Apr 2018 21:42:20 +0000 (15:42 -0600)]
Remove binject engine

It was an experiment and never submitted upstream, let's just
drop it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Fri, 6 Apr 2018 23:59:20 +0000 (17:59 -0600)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Fix floating point option range formatting

6 years agoFix floating point option range formatting
Bart Van Assche [Fri, 6 Apr 2018 22:49:44 +0000 (15:49 -0700)]
Fix floating point option range formatting

Ensure that floating point option ranges are properly formatted if
only one of the two boundaries is specified. A few examples of how
option ranges are formatted with this patch applied:

               range: max=100.000000
               range: min=0.000000, max=100.000000
               range: min=0.000000

Reported-by: Sitsofe Wheeler <sitsofe@gmail.com>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agoFix return value checking of fread() in iolog.c
Rebecca Cran [Wed, 4 Apr 2018 23:18:42 +0000 (17:18 -0600)]
Fix return value checking of fread() in iolog.c

According to http://pubs.opengroup.org/onlinepubs/7908799/xsh/fread.html
fread() returns a size_t, not ssize_t, and returns a value of 0 on
both eof and an error. Therefore, check both feof() and ferror() to
determine whether the call succeeded.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
6 years agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Wed, 4 Apr 2018 21:36:17 +0000 (15:36 -0600)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Ensure that .minfp and .maxfp are respected for FIO_OPT_FLOAT_LIST
  option parsing: Mark arguments that are not modified as 'const'
  parse.h: Remove a superfluous cast
  Only populate the write buffer if necessary
  Rename TD_F_VER_NONE into TD_F_DO_VERIFY
  engines/sg: Make I/O error messages more informative

6 years agoEnsure that .minfp and .maxfp are respected for FIO_OPT_FLOAT_LIST
Bart Van Assche [Tue, 3 Apr 2018 18:23:11 +0000 (11:23 -0700)]
Ensure that .minfp and .maxfp are respected for FIO_OPT_FLOAT_LIST

option_init() overwrites the .minfp and .maxfp members defined in
fio_options[] which is wrong. Remove the code that overwrites these two
members and change the convention for no FIO_OPT_FLOAT_LIST limits from
(minfp == DBL_MIN && maxfp == DBL_MAX) into (minfp != 0 || maxfp != 0).

Fixes: 833491908a1a ("stats: Add a function to report completion latency percentiles")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
6 years agooption parsing: Mark arguments that are not modified as 'const'
Bart Van Assche [Tue, 3 Apr 2018 20:04:02 +0000 (13:04 -0700)]
option parsing: Mark arguments that are not modified as 'const'

This patch does not modify any functionality but makes the option
parsing code slightly easier to read by marking arguments that are
not modified explicitly as 'const'. A new function has been added,
find_option_c(), that behaves identically to find_option(). Only
the function signature differs between these two functions.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>