fio.git
4 years agoFio 3.17 fio-3.17
Jens Axboe [Mon, 16 Dec 2019 22:48:43 +0000 (15:48 -0700)]
Fio 3.17

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agot/io_uring: check for CONFIG_HAVE_GETTID
Jens Axboe [Thu, 12 Dec 2019 19:34:50 +0000 (12:34 -0700)]
t/io_uring: check for CONFIG_HAVE_GETTID

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agot/run-fio-tests: relax acceptance criterion for t0011
Vincent Fu [Tue, 10 Dec 2019 17:54:42 +0000 (12:54 -0500)]
t/run-fio-tests: relax acceptance criterion for t0011

I saw a handful of benign failures for t0011 when run on
travis/appveyor. This patch allows the test to still pass with a
measured IOPS of 998 to 1002 and adds a debug print for the value
actually observed.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years ago.appveyor.yml: run run-fio-tests.py
Vincent Fu [Tue, 10 Dec 2019 17:54:41 +0000 (12:54 -0500)]
.appveyor.yml: run run-fio-tests.py

- Add CUnit support
- install SciPy
- skip test 5 because Windows does not support direct I/O with sync
ioengines

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years ago.travis.yml: run t/run-fio.tests.py as part of build
Vincent Fu [Tue, 10 Dec 2019 17:54:40 +0000 (12:54 -0500)]
.travis.yml: run t/run-fio.tests.py as part of build

- install SciPy and CUnit support
- skip test 6 because of timeout
- skip zbd tests 1007, 1008 because installing kernel modules is not supported
- replace xcode8.3 (lacks python3) with latest xcode11.2

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agot/steadystate_tests: use null ioengine for tests
Vincent Fu [Tue, 10 Dec 2019 17:54:39 +0000 (12:54 -0500)]
t/steadystate_tests: use null ioengine for tests

Instead of reading from /dev/zero just use the null ioengine. This
enables the script to run on Windows.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agot/run-fio-tests: identify test id for debug messages
Vincent Fu [Tue, 10 Dec 2019 17:54:38 +0000 (12:54 -0500)]
t/run-fio-tests: identify test id for debug messages

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agot/run-fio-tests: improve Windows support
Vincent Fu [Tue, 10 Dec 2019 17:54:37 +0000 (12:54 -0500)]
t/run-fio-tests: improve Windows support

- add .exe extension for fio and unittest
- for python scripts use 'python.exe script.py' instead of ./script.py
- make JSON decoding more resilient by lopping off up to four of the
first lines when encountering decoding errors. This helps Windows
because for some jobs fio prints an informational message about
requiring threads

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agot/run-fio-tests: detect requirements and skip tests accordingly
Vincent Fu [Tue, 10 Dec 2019 17:54:36 +0000 (12:54 -0500)]
t/run-fio-tests: detect requirements and skip tests accordingly

Also provide an option to skip requirement checking

Suggested-by: <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agot/run-fio-tests: a few small improvements
Vincent Fu [Tue, 10 Dec 2019 17:54:35 +0000 (12:54 -0500)]
t/run-fio-tests: a few small improvements

- add debug option that changes logging level
- improve error handling
- more output on test failures
- Python 3.5 compatibility with pathlib.Path and os.path.join
- warn if fio executable not found but don't abort because some tests
can run without the fio executable

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years ago.gitignore: ignore zbd test output files
Vincent Fu [Tue, 10 Dec 2019 17:54:34 +0000 (12:54 -0500)]
.gitignore: ignore zbd test output files

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agofilesetup: ensure to setup random generator properly
Jens Axboe [Sat, 7 Dec 2019 05:03:04 +0000 (22:03 -0700)]
filesetup: ensure to setup random generator properly

If we have ZONED or ZONED_ABS set, we need to go through the same
path as RANDOM. If not, we fail miserably later.

Fixes: https://github.com/axboe/fio/issues/873
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoRenumber RWF_UNCACHED
Jens Axboe [Fri, 6 Dec 2019 19:36:53 +0000 (12:36 -0700)]
Renumber RWF_UNCACHED

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agopvsync2: add support for RWF_UNCACHED
Jens Axboe [Fri, 6 Dec 2019 16:08:29 +0000 (09:08 -0700)]
pvsync2: add support for RWF_UNCACHED

See commit 4a87b5840d35 ("io_uring: add support for RWF_UNCACHED")
for details on this feature.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoio_uring: add support for RWF_UNCACHED
Jens Axboe [Fri, 6 Dec 2019 15:35:28 +0000 (08:35 -0700)]
io_uring: add support for RWF_UNCACHED

If this is set, and the kernel supports it, buffered IO will be
uncached. This means that reads are dropped from the cache if we
are the ones instantiating the pages, and writes are sync and
dropped from the page cache on IO completion.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoMerge branch 'engine-rados-fix-first' of https://github.com/aclamk/fio
Jens Axboe [Wed, 27 Nov 2019 17:23:12 +0000 (10:23 -0700)]
Merge branch 'engine-rados-fix-first' of https://github.com/aclamk/fio

* 'engine-rados-fix-first' of https://github.com/aclamk/fio:
  engines/rados: fix error with getting last instead of first element from list

4 years agoengines/rados: fix error with getting last instead of first element from list
Adam Kupczyk [Wed, 27 Nov 2019 15:18:32 +0000 (10:18 -0500)]
engines/rados: fix error with getting last instead of first element from list

    A thinko has popped in implementation. Consumer function `getevent()` did pick last (newest) instead of first (oldest).

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
4 years agoMerge branch 'fallocate-truncate' of https://github.com/tripped/fio
Jens Axboe [Tue, 26 Nov 2019 18:57:52 +0000 (11:57 -0700)]
Merge branch 'fallocate-truncate' of https://github.com/tripped/fio

* 'fallocate-truncate' of https://github.com/tripped/fio:
  filesetup: add fallocate=truncate option.

4 years agoMerge branch 'rados-now-use-completion-callbacks' of https://github.com/aclamk/fio
Jens Axboe [Tue, 26 Nov 2019 04:40:38 +0000 (21:40 -0700)]
Merge branch 'rados-now-use-completion-callbacks' of https://github.com/aclamk/fio

* 'rados-now-use-completion-callbacks' of https://github.com/aclamk/fio:
  engines/rados: changed polling to completion callbacks methodology

4 years agoMerge branch 'const1' of https://github.com/kusumi/fio
Jens Axboe [Tue, 26 Nov 2019 04:40:19 +0000 (21:40 -0700)]
Merge branch 'const1' of https://github.com/kusumi/fio

* 'const1' of https://github.com/kusumi/fio:
  parse: Silence discard-const warning on OpenBSD

4 years agoengines/rados: changed polling to completion callbacks methodology
Adam Kupczyk [Mon, 25 Nov 2019 17:55:07 +0000 (12:55 -0500)]
engines/rados: changed polling to completion callbacks methodology

Previously, getevent() function polled operations that have been submitted to check if some of them have already finished.
Now, each rados operation invokes completion callback. This callback adds to list of completed operations.
In this version getevent() only peeks if completed list has some operations.

There are two benefits:
1) small one - this works faster then previous version
2) big one - when there is a huge amount of operations in fly, getevent() might be more overloaded then producer. In this scenario some old operations are finished, but not picked up and properly noticed. This caused absurdely long execution times, when actually everything was working properly.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
4 years agoparse: Silence discard-const warning on OpenBSD
Tomohiro Kusumi [Mon, 25 Nov 2019 15:13:48 +0000 (00:13 +0900)]
parse: Silence discard-const warning on OpenBSD

This might be overkill just to silence the warnings, but having
a common function for const and non-const version makes it discard
const pointer at some point.

--
    CC parse.o
parse.c: In function 'find_option_c':
parse.c:1051: warning: passing argument 1 of 'find_option' discards qualifiers from pointer target type
parse.c: In function 'get_option':
parse.c:1051: warning: passing argument 1 of 'find_option' discards qualifiers from pointer target type
parse.c:1051: warning: passing argument 1 of 'find_option' discards qualifiers from pointer target type
parse.c: In function 'parse_cmd_option':
parse.c:1051: warning: passing argument 1 of 'find_option' discards qualifiers from pointer target type

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
4 years agot/run-fio-tests: improve error handling
Vincent Fu [Mon, 11 Nov 2019 16:30:55 +0000 (11:30 -0500)]
t/run-fio-tests: improve error handling

More gracefully handle errors when running a test. Also change the
EXAMPLE to refer to fio's canonical git repository.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoio_u: move to next zone even if zoneskip is unset
Vincent Fu [Mon, 11 Nov 2019 16:30:54 +0000 (11:30 -0500)]
io_u: move to next zone even if zoneskip is unset

This patch makes fio's behavior under zonemode=strided conform to the
documentation:

    I/O happens in a single zone until zonesize bytes have been
    transferred. After that number of bytes has been transferred
    processing of the next zone starts.

With zonemode=strided, before commit 35f561eb, fio would only move to
the next zone when zoneskip > 0 and zonesize bytes were written. There
would always be zoneskip bytes between the end of one zone and the
beginning of the next zone. If zoneskip was not set or set to 0, all IO
would happen in the first zone.

Commit 35f561eb changed this so that fio would move to the next zone
upon writing zonesize bytes if zoneskip was explicitly set to a value >=
0. This option made it possible for zones to be contiguous. The
documentation was not updated to reflect the new behavior.

I originally intended to submit a patch to update fio's documentation,
but upon further reflection it seems better to change fio's behavior and
have a clean user interface than to change the documentation to note
that zoneskip must be explciitly set in order for fio to move to the
next zone.

This patch also updates t/strided.py to reflect the new behavior.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agofilesetup: improve LFSR init failure error message
Vincent Fu [Mon, 11 Nov 2019 16:30:53 +0000 (11:30 -0500)]
filesetup: improve LFSR init failure error message

Especially with small sample spaces, the LFSR random generator
occasionally fails to initialize successfully. When this occurs, the
error message refers to problems allocating a random map. Change the
error message to explicitly mention the LFSR failure.

OLD BEHAVIOR
$ ./fio --name=test --ioengine=null --size=4k --random_generator=lfsr --rw=randread --randrepeat=0
test: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=null, iodepth=1
fio-3.16-13-g998b-dirty
Starting 1 process
fio: failed allocating random map. If running a large number of jobs, try the 'norandommap' option or set 'softrandommap'. Or give a larger --alloc-size to fio.

NEW BEHAVIOR
$ ./fio --name=test --ioengine=null --size=4k --random_generator=lfsr --rw=randread --randrepeat=0
test: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=null, iodepth=1
fio-3.16-37-g65ee
Starting 1 process
fio: failed initializing LFSR

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agofilesetup: add fallocate=truncate option.
Trip Volpe [Thu, 7 Nov 2019 23:13:48 +0000 (15:13 -0800)]
filesetup: add fallocate=truncate option.

Fixes #833. Provides the ability to initially "layout" the file
by ftruncating it to the desired size before performing IO. This
is mainly useful on Windows, which serializes all writes that
extend the size of a file. Using this option with a suitable
iodepth allows fio to emulate the behavior of Windows Explorer
file copy, which always truncates to the expected size before
issuing writes for performance reasons.

4 years agoMerge branch 'testing' of https://github.com/vincentkfu/fio
Jens Axboe [Thu, 7 Nov 2019 00:04:17 +0000 (17:04 -0700)]
Merge branch 'testing' of https://github.com/vincentkfu/fio

* 'testing' of https://github.com/vincentkfu/fio:
  t/run-fio-tests: a script to automate running fio tests
  t/jobs: fix t0011 syntax error
  t/jobs: clean up t0009 and use only 4 CPUs
  t/jobs: drop time_based in t0007
  t/jobs: use current directory for test file for t0003 and t0004
  t/jobs: fixup t0002 test jobs
  t/stest: non-zero exit value on failure
  t/sgunmap-test.py: drop six.moves dependency
  t/steadystate_tests: better support automated testing
  t/strided.py: change LFSR tests
  t/readonly: replace shell script with python script
  t/iee754: add return value

4 years agot/run-fio-tests: a script to automate running fio tests
Vincent Fu [Fri, 18 Oct 2019 19:05:35 +0000 (15:05 -0400)]
t/run-fio-tests: a script to automate running fio tests

fio actually has a substantial test infrastructure but lacks a
convenient way to run existing tests in an automated fashion. This
script provides the means to run almost all of fio's existing tests with
a single command. A full run finishes in less than 10 minutes.

This script can be used to catch bugs before patches are submitted. It
can also be used to test new fio builds as patches are committed to the
repository.

4 years agot/jobs: fix t0011 syntax error
Vincent Fu [Thu, 17 Oct 2019 15:53:04 +0000 (11:53 -0400)]
t/jobs: fix t0011 syntax error

4 years agot/jobs: clean up t0009 and use only 4 CPUs
Vincent Fu [Thu, 17 Oct 2019 18:38:24 +0000 (14:38 -0400)]
t/jobs: clean up t0009 and use only 4 CPUs

There are two runtime= lines in t0009. Comment out the one that is
ignored.

Also reduce the number of CPUs required from 6 to 4 so that this can be
run on more systems. The failure still occurs on systems with four CPUs.

4 years agot/jobs: drop time_based in t0007
Vincent Fu [Thu, 17 Oct 2019 15:52:27 +0000 (11:52 -0400)]
t/jobs: drop time_based in t0007

This is an extraneous option that produces a warning message which
complicates using this job file for automated testing.

4 years agot/jobs: use current directory for test file for t0003 and t0004
Vincent Fu [Thu, 17 Oct 2019 15:54:03 +0000 (11:54 -0400)]
t/jobs: use current directory for test file for t0003 and t0004

This makes it easier to investigate problems when these job files are
used for automated testing.

4 years agot/jobs: fixup t0002 test jobs
Vincent Fu [Wed, 6 Nov 2019 16:22:10 +0000 (11:22 -0500)]
t/jobs: fixup t0002 test jobs

- add .fio extension to match other job files
- change line endings from DOS to UNIX
- use local file instead of device

4 years agot/stest: non-zero exit value on failure
Vincent Fu [Wed, 16 Oct 2019 19:03:32 +0000 (15:03 -0400)]
t/stest: non-zero exit value on failure

To facilitate automated testing, return a non-zero exit value when a
smalloc failure occurs.

4 years agot/sgunmap-test.py: drop six.moves dependency
Vincent Fu [Wed, 30 Oct 2019 23:55:21 +0000 (19:55 -0400)]
t/sgunmap-test.py: drop six.moves dependency

range was never actually used in this script.

4 years agot/steadystate_tests: better support automated testing
Vincent Fu [Tue, 29 Oct 2019 10:09:54 +0000 (06:09 -0400)]
t/steadystate_tests: better support automated testing

To better support using this script for automated testing, do the
following:

- Use a more portable python interpreter reference
- Drop six.moves dependency
- Eliminate two potential divide-by-zero runtime errors
- Count and report the number of passed and failed tests
- Keep the output of the test jobs for inspection in case of failure
- Exit code 0 if all tests pass and non-zero otherwise

4 years agot/strided.py: change LFSR tests
Vincent Fu [Mon, 28 Oct 2019 23:45:31 +0000 (19:45 -0400)]
t/strided.py: change LFSR tests

LFSR init fails on occasion with small zoneranges. This patch increases
the zonerange for LFSR tests to eliminate these failures.

Also fix a typo in the last test job.

4 years agot/readonly: replace shell script with python script
Vincent Fu [Wed, 16 Oct 2019 18:52:07 +0000 (14:52 -0400)]
t/readonly: replace shell script with python script

The new script better supports automated testing than the previous one.

Also get rid of the t/jobs/readonly-?.fio job files. Using jobs files
with the --readonly parameter produces the same behavior as when
--readonly precedes --rw=XXX on the command line.

4 years agot/iee754: add return value
Vincent Fu [Wed, 16 Oct 2019 16:32:42 +0000 (12:32 -0400)]
t/iee754: add return value

To facilitate automated testing, return 0 when all tests succeed and a
non-zero value otherwise.

Also add one more test value.

4 years agoarch-arm: Consider armv7ve arch as well
Khem Raj [Tue, 5 Nov 2019 13:41:55 +0000 (06:41 -0700)]
arch-arm: Consider armv7ve arch as well

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoMerge branch 'master' of https://github.com/aphreet/fio
Jens Axboe [Sun, 3 Nov 2019 13:35:44 +0000 (06:35 -0700)]
Merge branch 'master' of https://github.com/aphreet/fio

* 'master' of https://github.com/aphreet/fio:
  Enable io_uring engine on powerpc arch

4 years agoEnable io_uring engine on powerpc arch
Mikhail Malygin [Sun, 3 Nov 2019 09:53:12 +0000 (09:53 +0000)]
Enable io_uring engine on powerpc arch

Signed-off-by: Mikhail Malygin <mikhail@malygin.me>
4 years agoengines/libaio.c: remove unused 'hipri' setting
Jens Axboe [Sat, 2 Nov 2019 20:48:24 +0000 (14:48 -0600)]
engines/libaio.c: remove unused 'hipri' setting

Leftover from when we had aio-ring with polling, now dead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoMerge branch 'patch-1' of https://github.com/hannesweisbach/fio
Jens Axboe [Tue, 29 Oct 2019 19:39:14 +0000 (13:39 -0600)]
Merge branch 'patch-1' of https://github.com/hannesweisbach/fio

* 'patch-1' of https://github.com/hannesweisbach/fio:
  Fix output redirection of exec_prerun/_postrun

4 years agoMerge branch '1029_tet' of https://github.com/optimistyzy/fio
Jens Axboe [Tue, 29 Oct 2019 16:05:34 +0000 (10:05 -0600)]
Merge branch '1029_tet' of https://github.com/optimistyzy/fio

* '1029_tet' of https://github.com/optimistyzy/fio:
  backend: fix the memory leak if fio_memalign fails,

4 years agobackend: fix the memory leak if fio_memalign fails,
Ziye Yang [Tue, 29 Oct 2019 14:35:38 +0000 (22:35 +0800)]
backend: fix the memory leak if fio_memalign fails,

We should not use break, we should use return 1 and explictly fails this,
then the cleanup routine will work. If not, this function may still
return 0.

Signed-off-by: Gang Cao <cao.gang@intel.com>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
4 years agoFix output redirection of exec_prerun/_postrun
hannesweisbach [Tue, 29 Oct 2019 07:35:24 +0000 (08:35 +0100)]
Fix output redirection of exec_prerun/_postrun

The previous version used the bashism "&>" to redirect stdout and stderr of the prerun/postrun commands to an output file. Since system() executes the command using "/bin/sh sh -c …". If /bin/sh is not bash, this wont work.
Use the "posixly-correct" way of redirecting stdout to the output file and then redirect stderr to stdout.

Signed-off-by: Hannes Weisbach <hannes.weisbach@gmail.com>
4 years agoMerge branch 'doc_fixes' of https://github.com/sitsofe/fio
Jens Axboe [Thu, 24 Oct 2019 18:04:09 +0000 (12:04 -0600)]
Merge branch 'doc_fixes' of https://github.com/sitsofe/fio

* 'doc_fixes' of https://github.com/sitsofe/fio:
  doc: delete repeated word "will"
  man: don't use non-breaking minuses when they're not necessary

4 years agodoc: delete repeated word "will"
Sitsofe Wheeler [Mon, 24 Sep 2018 22:51:56 +0000 (23:51 +0100)]
doc: delete repeated word "will"

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
4 years agoman: don't use non-breaking minuses when they're not necessary
Sitsofe Wheeler [Sun, 12 Aug 2018 20:00:57 +0000 (21:00 +0100)]
man: don't use non-breaking minuses when they're not necessary

Technically you only need to escape a dash in troff when you
1. Want it to be a typographical minus
2. Need to prevent the typesetter potentially doing a line break at it
   (e.g. to prevent a -option being split apart)

so convert lots of "\-" to just "-" .

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
4 years agoMerge branch 'android-log-fix' of https://github.com/kdrag0n/fio
Jens Axboe [Mon, 21 Oct 2019 14:46:43 +0000 (08:46 -0600)]
Merge branch 'android-log-fix' of https://github.com/kdrag0n/fio

* 'android-log-fix' of https://github.com/kdrag0n/fio:
  Makefile: Link to the system logging library on Android

4 years agoMakefile: Link to the system logging library on Android
Danny Lin [Mon, 21 Oct 2019 01:43:08 +0000 (18:43 -0700)]
Makefile: Link to the system logging library on Android

Android replaces syslog calls with calls to the Android system logging
library, liblog. Link to liblog when compiling for Android to fix the
following undefined reference errors:

aarch64-linux-android-ld: log.o: in function `android_polyfill_vsyslog':
/usr/include/syslog.h:185: undefined reference to `__android_log_print'
aarch64-linux-android-ld: /usr/include/syslog.h:182: undefined reference to `__android_log_vprint'

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
4 years agoMerge branch 'fix-fsync-on-close' of https://github.com/sitsofe/fio
Jens Axboe [Tue, 15 Oct 2019 15:27:06 +0000 (09:27 -0600)]
Merge branch 'fix-fsync-on-close' of https://github.com/sitsofe/fio

* 'fix-fsync-on-close' of https://github.com/sitsofe/fio:
  backend: fix final fsync behaviour

4 years agotesting: add test script for zonemode=strided
Vincent Fu [Tue, 15 Oct 2019 14:29:58 +0000 (10:29 -0400)]
testing: add test script for zonemode=strided

Python script to run jobs with randommap, with LFSR, and with
nonrandommap. Uses null ioengine or a real file.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agofilesetup: use zonerange for map and LFSR with zonemode=strided
Vincent Fu [Tue, 15 Oct 2019 14:29:57 +0000 (10:29 -0400)]
filesetup: use zonerange for map and LFSR with zonemode=strided

When a random map is enabled, cover only the current zone when run with
zonemode=strided. This ensures that when we reach the end of the zone we
wrap around back into the current zone instead of accessing blocks
outside of the zone.

In addition, when an LFSR is used, constrain the blocks generated to the
current zone. Previously, the LFSR random_generator would ignore the
strided zonemode setting.

Fixes: https://github.com/axboe/fio/issues/809
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoio_u: skip to the next zone when zoneskip is set to zero
Vincent Fu [Tue, 15 Oct 2019 14:29:56 +0000 (10:29 -0400)]
io_u: skip to the next zone when zoneskip is set to zero

If zoneskip is not set or set to 0 in zonemode=strided mode, all IO
occurs in a single zone. If zoneskip is non-zero, the next zone begins
zoneskip bytes beyond the end of the current zone. Thus, it's not
possible to access contiguous zones since zoneskip bytes will separate
the end of one zone and the beginning of the next zone.

This patch allows fio to move to the next zone when zoneskip is
explicitly set to 0, making it possible to issue IO to contiguous zones.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoparse: improve detection of bad input string
Jens Axboe [Mon, 14 Oct 2019 14:03:53 +0000 (08:03 -0600)]
parse: improve detection of bad input string

If we attempt to do number conversion, and strtoll() returns 0 AND
the end pointer is the same as the starting string, then fail the
conversion.

Fixes: https://github.com/axboe/fio/issues/841
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoMerge branch 'fix-corrupt-hist-log' of https://github.com/sitsofe/fio
Jens Axboe [Sun, 13 Oct 2019 17:02:00 +0000 (11:02 -0600)]
Merge branch 'fix-corrupt-hist-log' of https://github.com/sitsofe/fio

* 'fix-corrupt-hist-log' of https://github.com/sitsofe/fio:
  stat: fix corruption in histogram logs

4 years agostat: fix corruption in histogram logs
Sitsofe Wheeler [Sun, 13 Oct 2019 08:55:51 +0000 (09:55 +0100)]
stat: fix corruption in histogram logs

Commit 6cc0e5aa9eddd2487dfa9ac80be1264151058409 ("Fix overflow of
counters incremented on each I/O operation") changed various structures
from [unsigned] int -> [u]int64_t but the size used when memcpy-ing
histogram data was still the older (smaller) size. This led to un-copied
values and usage of uninitialised data. An example job that demonstrates
the issue is:

$ valgrind ./fio --size=256k --thread=1 --rate_iops=5 --direct=1 \
 --number_ios=15 --name=hist_test --filename=fio.test \
 --log_hist_msec=1000 --write_hist_log=fio.test --log_hist_coarseness=6
==1743== Memcheck, a memory error detector
[...]
fio-3.16-8-gf951
Starting 1 thread
==1743== Thread 3: IOPS: [R(1)][23.1%][r=20KiB/s][r=5 IOPS][eta 00m:10s]
==1743== Use of uninitialised value of size 8
==1743==    at 0x609D86B: _itoa_word (_itoa.c:179)
==1743==    by 0x60A0F0D: vfprintf (vfprintf.c:1642)
==1743==    by 0x60A9E53: fprintf (fprintf.c:32)
==1743==    by 0x47FA6C: flush_hist_samples (iolog.c:869)
==1743==    by 0x47F637: flush_log (iolog.c:1212)
==1743==    by 0x4813C5: finish_log (iolog.c:1238)
==1743==    by 0x4812CD: __write_log (iolog.c:1571)
==1743==    by 0x481202: write_clat_hist_log (iolog.c:1625)
==1743==    by 0x480045: td_writeout_logs (iolog.c:1721)
==1743==    by 0x485C7A: thread_main (backend.c:1889)
==1743==    by 0x5C296DA: start_thread (pthread_create.c:463)
==1743==    by 0x616688E: clone (clone.S:95)

This commit fixes the issue by using the new size in the memcpy.

Fixes: https://github.com/axboe/fio/issues/827
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
4 years agoMerge branch 'bumpflocks' of https://github.com/earlephilhower/fio
Jens Axboe [Wed, 9 Oct 2019 02:58:57 +0000 (20:58 -0600)]
Merge branch 'bumpflocks' of https://github.com/earlephilhower/fio

* 'bumpflocks' of https://github.com/earlephilhower/fio:
  Increase MAX_FILELOCKS for highly parallel IO test

4 years agoIncrease MAX_FILELOCKS for highly parallel IO test
Earle F. Philhower, III [Tue, 8 Oct 2019 23:13:02 +0000 (16:13 -0700)]
Increase MAX_FILELOCKS for highly parallel IO test

When running hundreds of threads and collecting CLAT, SLAT, IOS on a
per-thread basis, FIO can need a lot of file locks to complete.  When
it can't get them, it gives the cryptic error message:
> fio: filelock.c:182: __fio_lock_file: Assertion `!trylock' failed.

Bump the maximum from 128 to 1024 to give headroom for high core count,
high thread count testing.

4 years agobackend: fix final fsync behaviour
Sitsofe Wheeler [Sun, 6 Oct 2019 07:58:28 +0000 (08:58 +0100)]
backend: fix final fsync behaviour

Previously, fsync_on_close's "final" fsync was done after fio's
accounting had finished thus causing the bandwidth reported to be too
high (due to the reported time being too low). An example job that
demonstrates the issue (on machines with a few gigabytes of RAM and
non-fast disks) is the following:

./fio --gtod_reduce=1 --filename=fio.tmp --size=5G --bs=2M --rw=write \
 --stonewall --name=end_fsync --end_fsync=1 --name=fsync_on_close \
 --fsync_on_close=1
end_fsync: (g=0): rw=write, bs=(R) 2048KiB-2048KiB, (W) 2048KiB-2048KiB, (T) 2048KiB-2048KiB, ioengine=psync, iodepth=1
fsync_on_close: (g=1): rw=write, bs=(R) 2048KiB-2048KiB, (W) 2048KiB-2048KiB, (T) 2048KiB-2048KiB, ioengine=psync, iodepth=1
[...]
Run status group 0 (all jobs):
  WRITE: bw=381MiB/s (400MB/s), 381MiB/s-381MiB/s (400MB/s-400MB/s), io=5120MiB (5369MB), run=13424-13424msec

Run status group 1 (all jobs):
  WRITE: bw=1726MiB/s (1810MB/s), 1726MiB/s-1726MiB/s (1810MB/s-1810MB/s), io=5120MiB (5369MB), run=2966-2966msec

This patch fixes the issue by doing an fsync for fsync_on_close at the
same point as it does for end_fsync. Technically fsync_on_close will go
and do another fsync after this point too but this should be harmless as
there is no new write data.

This patch also fixes the assert seen with the following job

./fio --size=8k --io_limit=32k --filename=fio.tmp --rw=write \
 --end_fsync=1 --name=extended_end_fsync
[...]
fio: filesetup.c:1682: void get_file(struct fio_file *): Assertion `fio_file_open(f)' failed.

by preventing auto-close on last I/O when it is being submitted as a
final fsync (due to end_fsync, fsync_on_close).

Finally it also fixes the strange IO depths seen with when using end_fsync:

./fio --size=4k --filename=fio.tmp --rw=write --end_fsync=1 \
 --name=end_fsync_test
end_fsync_test: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
[...]
  IO depths    : 1=200.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%

by no longer including such fsyncs in accounting.

Fixes: https://github.com/axboe/fio/issues/831

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
4 years agoMerge branch 'replay-blktrace-fixes' of https://github.com/shimrot/fio
Jens Axboe [Tue, 8 Oct 2019 03:23:26 +0000 (21:23 -0600)]
Merge branch 'replay-blktrace-fixes' of https://github.com/shimrot/fio

* 'replay-blktrace-fixes' of https://github.com/shimrot/fio:
  Fix assert error on blktrace replay containing trims

4 years agoMerge branch 'error-on-implicit-decl' of https://github.com/sitsofe/fio
Jens Axboe [Sun, 6 Oct 2019 15:15:51 +0000 (09:15 -0600)]
Merge branch 'error-on-implicit-decl' of https://github.com/sitsofe/fio

* 'error-on-implicit-decl' of https://github.com/sitsofe/fio:
  configure: stop enabling fdatasync on OSX

4 years agoconfigure: stop enabling fdatasync on OSX
Sitsofe Wheeler [Sat, 5 Oct 2019 11:04:33 +0000 (12:04 +0100)]
configure: stop enabling fdatasync on OSX

Change configure compile probes to fail on implicit declarations. This
(correctly) stops us from enabling fdatasync on OSX which was
problematic because we were actually calling a syscall stub with
arguments different to what was declared in its prototype (see
https://github.com/gbrault/picoc/issues/145#issuecomment-89734655 and
https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/7 ).

Fixes: https://github.com/axboe/fio/issues/834 ("Drop macOS support for
fdatasync")

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
4 years agoWindows: Update URLs to https, and remove mention of WiX version
Rebecca Cran [Mon, 30 Sep 2019 20:57:08 +0000 (14:57 -0600)]
Windows: Update URLs to https, and remove mention of WiX version

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoUpdate the email and web address for Windows binaries.
Rebecca Cran [Mon, 30 Sep 2019 20:57:07 +0000 (14:57 -0600)]
Update the email and web address for Windows binaries.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoconfigure: add --enable-libaio-uring parameter
Jens Axboe [Fri, 27 Sep 2019 19:51:12 +0000 (13:51 -0600)]
configure: add --enable-libaio-uring parameter

If set, this attempts to link with liburing instead of libaio, and
use the libaio wrapper there.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agot/zbd: Avoid magic number of test case count
Shin'ichiro Kawasaki [Thu, 26 Sep 2019 01:00:44 +0000 (10:00 +0900)]
t/zbd: Avoid magic number of test case count

In the test script t/zbd/test-zbd-support, the number of test cases is
defined as a raw constant. Every time a new test case is added, need to
update the constant but this chore tends to be overlooked. When test
case 47 was added recently, the number was not incremented from 46. Then
the test script does not run the test case 47.

To avoid the constant increment chore, automate the test case number
counting. List bash functions which implement test cases and convert the
list to test case numbers.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agofilesetup: Extend file size for 'null' and 'filecreate' ioengines
Shin'ichiro Kawasaki [Wed, 25 Sep 2019 08:29:24 +0000 (17:29 +0900)]
filesetup: Extend file size for 'null' and 'filecreate' ioengines

It was reported the fio command with following options fails because of
file access beyond the file size specified with size option.

./fio --name=test --rw=randread --runtime=10s --offset=90% --time_based --ioengine=null --size=1T --norandommap --randrepeat=0

One of the options specifies null ioengine which has FIO_DISKLESSIO and
FIO_FAKEIO flags. When FIO_DISKLESSIO flag is set, current fio code does
not extend the file size even when io_size + file_offset is larger than
real_file_size. With this, random offsets are generated within io_size +
file_offset range and fail comparison with real_file_size. This failure
does not happen with other engines such as libaio since the target file
is extended to ensure real_file_size is larger than io_size +
file_offset.

To avoid the failure, extend file size for ioengines with FIO_DISKLESSIO
and FIO_FAKEIO. This changes behavior of two ioengines only: null
ioengine and filecreate engine. It does not change behavior of all other
ioengines including 12 ioengines with FIO_DISKLESSIO flag, such as nbd,
glusterfs, pmemblk, etc.

Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoRevert "filesetup: honor the offset option"
Shin'ichiro Kawasaki [Wed, 25 Sep 2019 08:29:23 +0000 (17:29 +0900)]
Revert "filesetup: honor the offset option"

This reverts commit ad46c5715ffc5d4e70d2e941225b1f504f23e409.

The commit tried to fix a failure observed with --offset=90%, --size=1T
and --ioengine=null options. However, it affected fio behavior not only
for null ioengine but also for other all ioengines. It changed io_size,
then I/O read or written bytes are not same as that specified with
command line 'size' option. This caused t/zbd/test-zbd-support test
script failures for zoned block devices: test cases #17, #28 and #38
failed.

To prepare for other fix with limited ioengine impacts, revert the fix
which affects all ioengines.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoverify: check that the block size is big enough
Jens Axboe [Tue, 24 Sep 2019 08:43:39 +0000 (02:43 -0600)]
verify: check that the block size is big enough

Fixes: https://github.com/axboe/fio/issues/822
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoMerge branch 'master' of https://github.com/anatol/fio
Jens Axboe [Mon, 23 Sep 2019 22:09:42 +0000 (16:09 -0600)]
Merge branch 'master' of https://github.com/anatol/fio

* 'master' of https://github.com/anatol/fio:
  Fix compilation error with gfio

4 years agoFix compilation error with gfio
Anatol Pomozov [Mon, 23 Sep 2019 21:12:12 +0000 (14:12 -0700)]
Fix compilation error with gfio

Commit 36833fb04 replaced many usages of strncpy with snprintf.
But there is one place where new arguments were added but the function
name has not been changed. It leads to the following compilation error:

gclient.c:333:2: error: too many arguments to function ‘strncpy’
  333 |  strncpy(message, sizeof(message), "%s", status_message);
      |  ^~~~~~~
In file included from /usr/include/features.h:450,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from gclient.c:1:
/usr/include/bits/string_fortified.h:103:1: note: declared here
  103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
      | ^~~~~

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
4 years agoFio 3.16 fio-3.16
Jens Axboe [Fri, 20 Sep 2019 01:01:52 +0000 (19:01 -0600)]
Fio 3.16

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoengines/io_uring: remove debug printf
Jens Axboe [Thu, 19 Sep 2019 14:35:29 +0000 (08:35 -0600)]
engines/io_uring: remove debug printf

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoMerge branch 'fio_reset_sqe' of https://github.com/anarazel/fio
Jens Axboe [Fri, 13 Sep 2019 20:56:16 +0000 (14:56 -0600)]
Merge branch 'fio_reset_sqe' of https://github.com/anarazel/fio

* 'fio_reset_sqe' of https://github.com/anarazel/fio:
  engines/io_uring: Fully clear out previous SQE contents.

4 years agoengines/io_uring: Fully clear out previous SQE contents.
Andres Freund [Fri, 13 Sep 2019 19:10:10 +0000 (12:10 -0700)]
engines/io_uring: Fully clear out previous SQE contents.

Without this change SQEs can contain data set in previous
submissions. E.g. a WRITE following an fdatasync would have still have
IORING_FSYNC_DATASYNC set in sync_flags, which shares storage with the
WRITE's rw_flags. Which was not reset, causing all writes to be
synchronous. Similarly, an fsync following a READ/WRITE would not
reset off/addr/len, which causes errors, because the kernel's
io_prep_fsync returns an error if e.g. addr is not 0.

While this could also be fixed by resetting only the unused fields in
the respective branches, it seems less failure prone to start with a
zeroed out sqe.

4 years agoMerge branch 'ioring_add_sync_file_range' of https://github.com/anarazel/fio
Jens Axboe [Thu, 12 Sep 2019 20:24:23 +0000 (14:24 -0600)]
Merge branch 'ioring_add_sync_file_range' of https://github.com/anarazel/fio

* 'ioring_add_sync_file_range' of https://github.com/anarazel/fio:
  engines/io_uring: Add support for sync_file_range.

4 years agoMerge branch 'fix_iouring_eintr' of https://github.com/anarazel/fio
Jens Axboe [Thu, 12 Sep 2019 20:23:21 +0000 (14:23 -0600)]
Merge branch 'fix_iouring_eintr' of https://github.com/anarazel/fio

* 'fix_iouring_eintr' of https://github.com/anarazel/fio:
  engines/io_uring: Handle EINTR.

4 years agoengines/io_uring: Add support for sync_file_range.
Andres Freund [Thu, 12 Sep 2019 18:17:08 +0000 (11:17 -0700)]
engines/io_uring: Add support for sync_file_range.

Previously sync_file_range() requests were just dropped to the floor.

Signed-off-by: Andres Freund <andres@anarazel.de>
4 years agoengines/io_uring: Handle EINTR.
Andres Freund [Thu, 12 Sep 2019 17:51:09 +0000 (10:51 -0700)]
engines/io_uring: Handle EINTR.

Several paths in io_uring_enter can trigger EINTR, but it was not
handled, leading to fio failing with spurious error messages.

An easy way to trigger EINTR is to just strace a running fio using
the io_uring engine and detach again.

Signed-off-by: Andres Freund <andres@anarazel.de>
4 years agoengines/io_uring: fix crash with registerfiles=1
Jens Axboe [Thu, 12 Sep 2019 16:15:42 +0000 (10:15 -0600)]
engines/io_uring: fix crash with registerfiles=1

If used with a raw bdev, we're crashing in attempting to open a
registered file before we have actually registered them.

If we're called before files are registered, just open the file
normally. This is done to query sizes etc, and we'll get the file
closed after that anyway. The job open/close will use the right
registered fd.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agofilesetup: honor the offset option
Vincent Fu [Wed, 11 Sep 2019 14:56:40 +0000 (10:56 -0400)]
filesetup: honor the offset option

Commands like the following do not honor the value given by the offset
option:

./fio --name=test --rw=randread --runtime=10s --offset=90% --time_based --ioengine=null --size=1T --norandommap --randrepeat=0
./fio --name=test --size=8k --offset=4k

In the random case, eventually a random offset will be generated beyond
the 1T file size, leading to a failure.

In the sequential case, a 12k file will be created despite size
specifying the 8k end boundary.

This patch modifies setup_files() so that f->io_size incorporates the
offset for cases like those above.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agodoc: clarify what --alloc-size does
Vincent Fu [Wed, 11 Sep 2019 14:56:39 +0000 (10:56 -0400)]
doc: clarify what --alloc-size does

The alloc-size option actually directs fio to allocate additional shared
memory pools of the specified size, augmenting the default allocation.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoengines/io_uring: use its own option group
Jens Axboe [Thu, 5 Sep 2019 15:15:41 +0000 (09:15 -0600)]
engines/io_uring: use its own option group

Was under libaio for now, lets move it to a distinct option group name.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoengines/io_uring: add support for registered files
Jens Axboe [Thu, 5 Sep 2019 14:59:29 +0000 (08:59 -0600)]
engines/io_uring: add support for registered files

This feature is exposed as a separate option, like fixedbufs, and
provides a way for fio to register a set of files with the kernel.
This improves IO efficiency.

It is also a requirement to be able to use sqthread_poll, as that
feature requires fixed files on the kernel side.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agosmalloc: use SMALLOC_BPI instead of SMALLOC_BPB in add_pool()
Vincent Fu [Tue, 3 Sep 2019 17:44:45 +0000 (13:44 -0400)]
smalloc: use SMALLOC_BPI instead of SMALLOC_BPB in add_pool()

Change the calculation of free_blocks in add_pool() to use SMALLOC_BPI
instead of SMALLOC_BPB. These two constants are coincidentally the same
on Linux and Windows but SMALLOC_BPI is the correct one to use.
free_blocks is the number of available blocks of size SMALLOC_BPB. It is
the product of the number of unsigned integers in the bitmap
(bitmap_blocks) and the number of bits per unsigned integer
(SMALLOC_BPI).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agosmalloc: allocate struct pool array from shared memory
Vincent Fu [Tue, 3 Sep 2019 17:44:44 +0000 (13:44 -0400)]
smalloc: allocate struct pool array from shared memory

If one process is making smalloc calls and another process is making
sfree calls, pool->free_blocks and pool->next_non_full will not be
synchronized because the two processes each have independent, local
copies of the variables.

This patch allocates space for the array of struct pool instances from
shared storage so that separate processes will be modifying quantities
stored at the same locations.

This issue was discovered on the server side running a client/server job
with --status-interval=1. Such a job encountered an OOM error when only
~50 objects were allocated from the smalloc pool.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agozbd: Improve job zonesize initialization checks
Damien Le Moal [Fri, 30 Aug 2019 02:16:05 +0000 (11:16 +0900)]
zbd: Improve job zonesize initialization checks

For a multijob workload, each job may specify a zonesize option for
access to a zoned block device or regular device with zonemode=zbd.
In such case, make sure that the zone size value specified by each job
matches the device zone size.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agozbd: Fix job zone size initialization
Damien Le Moal [Fri, 30 Aug 2019 01:45:03 +0000 (10:45 +0900)]
zbd: Fix job zone size initialization

For a job accessing a zoned block device, the zone size is automatically
initialized to the device zone size. However, since zone information for
a zoned block device is parsed once only for the first job
initialization of a multi job workload, only the first job has its
zonesize option intialized, causing problem if the zoneskip option is
also used (assert exit).

Fix this by always initializing a job zonesize option using the job
file zbd information when verifying the job ZBD related sizes and
offsets.

Fixes: 4d37720ae029 ("zbd: Add support for zoneskip option")
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agozbd: provide empty setup_zbd_zone_mode()
Jens Axboe [Thu, 29 Aug 2019 12:38:08 +0000 (06:38 -0600)]
zbd: provide empty setup_zbd_zone_mode()

If we don't enable zbd, then provide an empty stub for the setup.
This fixes a build breakage on anything but Linux.

Fixes: 4d37720ae029 ("zbd: Add support for zoneskip option")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agozbd: Add support for zoneskip option
Damien Le Moal [Thu, 29 Aug 2019 07:21:35 +0000 (16:21 +0900)]
zbd: Add support for zoneskip option

To speed up device tests (performance and or quality validation) of very
large capacity block devices such as SMR disks, it is useful to allow
skipping some block ranges for sequential workloads. While the
zonemode=stridded implements such feature, it does not allow controlling
read operations in partially written zones of zoned block devices (i.e.
prevent reads after a zone write pointer) and can result in IO errors
if executed on a zoned block devices with zones already written.

To solve this problem, add support for the zoneskip option with
zonemode=zbd, allowing a sequential workload to skip zoneskip bytes once
a zone has been fully written or its data has been read. The zoneskip
option is ignored for random workloads.

For read workloads, zone skipping takes into account the read_beyond_wp
option to switch zone either when all valid data in the zone is read
(read_beyond_wp=0) or the entire zone has been read (read_beyond_wp=1).

Add test47 to t/zbd/test-zbd-support to test that zoneskip invalid
values are handled correctly.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoman: Improve zonemode=zbd information
Damien Le Moal [Thu, 29 Aug 2019 07:21:34 +0000 (16:21 +0900)]
man: Improve zonemode=zbd information

Clarify the use of the zonerange and zonesize options for zonemode=zbd.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoman page: Fix read_beyond_wp description
Damien Le Moal [Thu, 29 Aug 2019 07:21:33 +0000 (16:21 +0900)]
man page: Fix read_beyond_wp description

Strictly speaking, drive managed disks are not zoned block devices as
they do not provide zone information nor zone commands. So remove
mention of this type of disk in the zoned block device description.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agozbd: Fix error message
Damien Le Moal [Thu, 29 Aug 2019 07:21:32 +0000 (16:21 +0900)]
zbd: Fix error message

Use log_err() instead of log_info() for notifying invalid zonesize
values specified by the user.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agozbd: Fix initialization error message
Damien Le Moal [Thu, 29 Aug 2019 07:21:31 +0000 (16:21 +0900)]
zbd: Fix initialization error message

Fix the error message on zbd_create_zone_info() failures to a more
generic message rather than indicating a BLKREPORTZONE ioctl error.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agozbd: Cleanup zbd_init()
Damien Le Moal [Thu, 29 Aug 2019 07:21:30 +0000 (16:21 +0900)]
zbd: Cleanup zbd_init()

For a job using a zoned device, the zonesize option must always specify
the device zone size. That is checked in the function parse_zone_info().
The zonesize checks in zbd_init() apply only to jobs running with
zonemode=zbd on a regular block device. So move these checks into
init_zone_info() which is used to emulate zone information for regular
block devices.

Fix t/zbd test #43 accordingly.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agooptions: allow offset_increment to understand percentages
Vincent Fu [Wed, 28 Aug 2019 17:48:41 +0000 (13:48 -0400)]
options: allow offset_increment to understand percentages

Add the ability for the offset_increment option to understand
percentages. With this patch offset_increment=10% will, for example,
increase the start offset by 10% of the file size for additional jobs
created by numjobs.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agodocs: small HOWTO fixes
Vincent Fu [Wed, 28 Aug 2019 17:48:40 +0000 (13:48 -0400)]
docs: small HOWTO fixes

Document three debug options and fix a formatting error.

Signed-off-by: Jens Axboe <axboe@kernel.dk>