fio.git
5 years agoRename example job files (*.job -> *.fio)
Jens Axboe [Sat, 8 Sep 2018 14:09:35 +0000 (08:09 -0600)]
Rename example job files (*.job -> *.fio)

Make it consistent.

Sugested-by: Rebecca Cran <rebecca@bluestop.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: cleanup output types
Jens Axboe [Fri, 7 Sep 2018 21:59:51 +0000 (15:59 -0600)]
client: cleanup output types

- Only print hostname= etc info for the NORMAL output, not for
  minimal/terse.

- Only print disk util header for NORMAL output.

- Cleanup json finish check

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: switch to per-client buffer
Jens Axboe [Fri, 7 Sep 2018 20:25:30 +0000 (14:25 -0600)]
client: switch to per-client buffer

Even with the local storage, for some operations we still end up
having to do split dumps. Include the buffer in the actual client,
and flush when the client is done.

Hopefully this fixes the remaining buffer output split for
client/server.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: use temp buffer for single output flush for json/disk util
Jens Axboe [Fri, 7 Sep 2018 19:52:18 +0000 (13:52 -0600)]
client: use temp buffer for single output flush for json/disk util

Similar to previous fixes, ensure that we log everything locally
before flushing it out.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoRevert "client: respect terse output on client <--> backend relationship"
Jens Axboe [Fri, 7 Sep 2018 19:06:32 +0000 (13:06 -0600)]
Revert "client: respect terse output on client <--> backend relationship"

This breaks a standard use case, which is a server without arguments
and a client with the --minimal option.

This reverts commit 1d1b65dc17c39f43dbe9d66062ca61fc3e90ddfc.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agolog: remember to free output buffer when done
Jens Axboe [Fri, 7 Sep 2018 18:57:52 +0000 (12:57 -0600)]
log: remember to free output buffer when done

We need to ensure we call buf_output_free() after using the
temp storage, otherwise we leaked the memory that we allocated
while filling the buffer.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoinit: use __log_buf() if we know buf != NULL
Jens Axboe [Fri, 7 Sep 2018 18:19:43 +0000 (12:19 -0600)]
init: use __log_buf() if we know buf != NULL

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agolog: use __log_buf() if we know buf != NULL
Jens Axboe [Fri, 7 Sep 2018 18:09:24 +0000 (12:09 -0600)]
log: use __log_buf() if we know buf != NULL

This apparently causes complaints on cygwin:

    CC stat.o
In file included from os/os-windows.h:18:0,
                 from os/os.h:54,
                 from thread_options.h:5,
                 from fio.h:18,
                 from init.c:19:
init.c: In function ‘add_job’:
os/../log.h:24:12: error: the comparison will always evaluate as ‘true’ for the address of ‘out’ will never be NULL [-Werror=address]
  if ((buf) != NULL)    \
            ^
os/../log.h:24:12: note: in definition of macro ‘log_buf’
  if ((buf) != NULL)    \

which is utterly stupid, but hey...

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: use temp buffer for client text output
Jens Axboe [Fri, 7 Sep 2018 18:04:14 +0000 (12:04 -0600)]
client: use temp buffer for client text output

Don't split it into pieces, log it into a local buffer and then
flush it all at once.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoCollect startup output before logging it
Jens Axboe [Fri, 7 Sep 2018 18:02:39 +0000 (12:02 -0600)]
Collect startup output before logging it

We currently do the startup logging in separate chunks. This is
inefficient in terms of network trafic for client/server, and
it also causes output to be potentially mingled together:

<x1> Starting <x1> Starting 1 process1 process

Fix this by logging to a buffer, then transmitting that buffer
in one piece.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoFio 3.9 fio-3.9
Jens Axboe [Thu, 6 Sep 2018 15:07:55 +0000 (09:07 -0600)]
Fio 3.9

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'master' of https://github.com/damien-lemoal/fio
Jens Axboe [Thu, 6 Sep 2018 01:25:39 +0000 (19:25 -0600)]
Merge branch 'master' of https://github.com/damien-lemoal/fio

* 'master' of https://github.com/damien-lemoal/fio:
  zbd: Use bytes unit
  zbd: Fix zbd_zone_idx()
  zbd: Remove inexistent functions declaration
  zbd: Improve read randomness

5 years agozbd: Use bytes unit
Damien Le Moal [Wed, 29 Aug 2018 01:45:22 +0000 (10:45 +0900)]
zbd: Use bytes unit

Simplify zbd.c code by using byte unit for the zone information values
instead of 512B sector count. Doing so, many 9 bits shift operations
are removed and code readability improved.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
5 years agozbd: Fix zbd_zone_idx()
Damien Le Moal [Wed, 29 Aug 2018 01:29:02 +0000 (10:29 +0900)]
zbd: Fix zbd_zone_idx()

For a zone size that is not a power of 2 number of sectors,
f->zbd_info->zone_size_log2 is set to -1. So use bit shift in
zbd_zone_idx() only if zone_size_log2 is not negative.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
5 years agozbd: Remove inexistent functions declaration
Damien Le Moal [Tue, 28 Aug 2018 05:09:13 +0000 (14:09 +0900)]
zbd: Remove inexistent functions declaration

The functions zbd_do_trim() and zbd_update_wp() are not implemented.
Remove there declarations from zbd.h.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
5 years agozbd: Improve read randomness
Damien Le Moal [Tue, 28 Aug 2018 04:47:23 +0000 (13:47 +0900)]
zbd: Improve read randomness

With zonemode=zbd, for random read operations with read_beyond_wp=0,
the zbd code will always adjust an I/O offset so that the I/O hits a
non empty zone. However, the adjustment always sets the I/O offset to
the start of the zone, resulting in a high device read cache hit rate
if the device has few zones written.

Improve randomness of read I/Os by adjusting the I/O offset to a random
value within the range of written data of the chosen zone. Also ensure
that the modified I/O does not cross over the zone wp position by
adjusting its size. Doing so, the search for a new zone is now done only
if the target zone cannot accomodate an I/O of at least min_bs bytes.

The comments have also been changed to better explain the code.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
5 years agoWindows: update download URL and add missing examples
Rebecca Cran [Wed, 5 Sep 2018 00:14:23 +0000 (18:14 -0600)]
Windows: update download URL and add missing examples

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoinit: move log name generation into helper
Jens Axboe [Wed, 5 Sep 2018 19:33:43 +0000 (13:33 -0600)]
init: move log name generation into helper

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'sz/log-names-need-help' of https://github.com/szaydel/fio
Jens Axboe [Wed, 5 Sep 2018 19:29:58 +0000 (13:29 -0600)]
Merge branch 'sz/log-names-need-help' of https://github.com/szaydel/fio

* 'sz/log-names-need-help' of https://github.com/szaydel/fio:
  Log files names start with _ when write_XX_log= keys in config file have empty value(s)

5 years agoDocument oddity with --status-interval and --output-format=json
Jens Axboe [Wed, 5 Sep 2018 15:29:00 +0000 (09:29 -0600)]
Document oddity with --status-interval and --output-format=json

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agozbd: Fix test scripts
Damien Le Moal [Wed, 5 Sep 2018 08:02:37 +0000 (17:02 +0900)]
zbd: Fix test scripts

Fix handling of the path to the test-zbd-support script to avoid an
error when the tests are run directly when in fio/t/zbd using the
command "./run-against...".

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoLog files names start with _ when write_XX_log= keys in config file have empty value(s)
Sam Zaydel [Tue, 4 Sep 2018 21:28:29 +0000 (14:28 -0700)]
Log files names start with _ when write_XX_log= keys in config file have empty value(s)

5 years agoengines/sg: improve error handling
Vincent Fu [Mon, 27 Aug 2018 20:40:11 +0000 (16:40 -0400)]
engines/sg: improve error handling

The Linux sg driver accepts only 16 SCSI commands in flight
at a time per file descriptor. fio does not exit gracefully
when it attempts to queue up 17 or more trim commands via
the sg ioengine. This patch improves error handling in the
sg ioengine commit function to achieve a graceful exit if
fio attempts to queue up too many trim commands. The key to
this is calling clear_io_u on each io_u in the 17th trim
command. With this patch fio no longer loops forever
waiting for the IOs in the (not succesffully submitted)
17th trim command to complete.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: fix nr_samples
Jeff Furlong [Fri, 31 Aug 2018 18:26:05 +0000 (18:26 +0000)]
client: fix nr_samples

In convert_iolog_gz() a 32 bit variable is created to store struct cmd_iolog_pdu's 64 bit member.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'configure-help' of https://github.com/hahnjo/fio
Jens Axboe [Thu, 30 Aug 2018 14:22:21 +0000 (08:22 -0600)]
Merge branch 'configure-help' of https://github.com/hahnjo/fio

* 'configure-help' of https://github.com/hahnjo/fio:
  configure: Document more switches to disable features

5 years agoconfigure: Document more switches to disable features
Jonas Hahnfeld [Thu, 30 Aug 2018 12:25:45 +0000 (14:25 +0200)]
configure: Document more switches to disable features

This helps a lot when building on one machine and running on another
that doesn't have all libraries installed. The switches are all there,
list them in ./configure --help so that future users don't have to
search the shell script.

5 years agoMake td_io_u_lock/unlock() explicit
Jens Axboe [Sat, 25 Aug 2018 16:22:31 +0000 (10:22 -0600)]
Make td_io_u_lock/unlock() explicit

Hopefully this will make coverity a little happier, it currently
thinks they are unbalanced.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoclient: suppress non JSON default outputs on --output-format=json/json+
Tomohiro Kusumi [Fri, 24 Aug 2018 16:42:10 +0000 (09:42 -0700)]
client: suppress non JSON default outputs on --output-format=json/json+

Suppress "hostname=...", "Disk stats (read/write)" and thread status
if json/json+ is specified, as these are regular messages.

JSON parsers can't parse the output with these messages, and JSON
spec doesn't support comment either.

--
 # ./fio ./fio.cfg --output-format=json > out
 # python3 -c "import json; json.load(open('out'))"
 # ./fio ./fio.cfg --client=localhost --output-format=json > out
 # python3 -c "import json; json.load(open('out'))"
 Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "/usr/local/lib/python3.7/json/__init__.py", line 296, in load
     parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
   File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
     return _default_decoder.decode(s)
   File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
   File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
     raise JSONDecodeError("Expecting value", s, err.value) from None
 json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Sat, 25 Aug 2018 00:22:13 +0000 (18:22 -0600)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Fix the typehelp[] array

5 years agoFix the typehelp[] array
Bart Van Assche [Fri, 24 Aug 2018 23:48:11 +0000 (16:48 -0700)]
Fix the typehelp[] array

This patch fixes Coverity ID 183335 (Out-of-bounds access of typehelp[] array).

Fixes: 5fff95436922 ("Add support for >= 4G block sizes")
Fixes: c47537ee91cd ("parse: add support for soft deprecated options")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
5 years agoMerge branch 'zbd'
Jens Axboe [Fri, 24 Aug 2018 18:59:45 +0000 (12:59 -0600)]
Merge branch 'zbd'

* zbd:
  Add scripts for testing the fio zoned block device support code
  Add support for resetting zones periodically
  Make it possible to limit the number of open zones
  Collect and show zone reset statistics
  Add support for zoned block devices
  Add two assert statements in mark_random_map()
  Pass offset and buffer length explicitly to mark_random_map()
  Introduce the io_u.post_submit callback function pointer
  Add the zonemode job option
  Add the 'zbd' debug level
  configure: Add <linux/blkzoned.h> test

5 years agoAdd scripts for testing the fio zoned block device support code
Bart Van Assche [Fri, 24 Aug 2018 18:31:31 +0000 (11:31 -0700)]
Add scripts for testing the fio zoned block device support code

These scripts can be run e.g. as follows:

t/zbd/run-tests-against-zoned-nullb &&
    t/zbd/run-tests-against-regular-nullb &&
    t/zbd/test-zbd-support /dev/disk/by-id/scsi-SHGST_HSH721414AL52M0_VEG007HG &&
    echo All tests passed

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoAdd support for resetting zones periodically
Bart Van Assche [Fri, 24 Aug 2018 18:31:30 +0000 (11:31 -0700)]
Add support for resetting zones periodically

Filesystems that support zoned block devices typically perform garbage
collection if device usage exceeds a certain threshold. Add two command
line options that allow to simulate this behavior.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMake it possible to limit the number of open zones
Bart Van Assche [Fri, 24 Aug 2018 18:31:29 +0000 (11:31 -0700)]
Make it possible to limit the number of open zones

When running a random I/O test across an entire drive many more zones
will be open than in a typical application workload. Hence add a command
line option that allows to limit the number of open zones.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoCollect and show zone reset statistics
Bart Van Assche [Fri, 24 Aug 2018 18:31:28 +0000 (11:31 -0700)]
Collect and show zone reset statistics

Show how many zone resets have been performed in the I/O statistics.
An example:
[ ... ]
  write: IOPS=17.0k, BW=66.5MiB/s (69.8MB/s)(1024MiB/15387msec); 4 zone resets
[ ... ]

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoAdd support for zoned block devices
Bart Van Assche [Fri, 24 Aug 2018 18:31:27 +0000 (11:31 -0700)]
Add support for zoned block devices

This patch adds support for zoned block devices as follows:
- After the file size has been determined, check whether the file name
  refers to a block device. If so, check whether that block device is a
  host-managed block device. If that is the case, read the zone
  information using the BLKREPORTZONE ioctl. That ioctl is supported by
  the Linux kernel since kernel version v4.10.
- After all command-line options have been processed and all job files
  have been read, verify whether these refer to a zoned block device
  and also whether the specified options are compatible with a zoned
  block device. Complain if that is not the case.
- After each get_next_block() call, verify whether the block is
  appropriate for a zoned block device. When writing data to a
  sequential zone, adjust the write offset to the zone write pointer.
  When reading from a sequential zone, avoid reading past the write
  pointer.
- After I/O submission, update the variable that represents the write
  pointer.
- When writing data and with data verification enabled, reset a zone
  before writing any data into a zone. Otherwise reset a zone before
  issuing a write if that zone is full.
- Translate trim into zone resets. Zoned block devices namely do not
  have to support any of the SCSI commands that are used by the kernel
  to implement the discard ioctl (UNMAP / WRITE SAME).

This work started from a patch from Masato Suzuki <masato.suzuki@wdc.com>.
Some of the ideas in this patch come from Phillip Chen
<phillip.a.chen@seagate.com>.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoAdd two assert statements in mark_random_map()
Bart Van Assche [Fri, 24 Aug 2018 18:31:26 +0000 (11:31 -0700)]
Add two assert statements in mark_random_map()

Add two assert statements that verify whether mark_random_map() is
used correctly.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoPass offset and buffer length explicitly to mark_random_map()
Bart Van Assche [Fri, 24 Aug 2018 18:31:25 +0000 (11:31 -0700)]
Pass offset and buffer length explicitly to mark_random_map()

This patch does not change any functionality. The changes introduced by
this patch will be used by the zoned block device code.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoIntroduce the io_u.post_submit callback function pointer
Bart Van Assche [Fri, 24 Aug 2018 18:31:24 +0000 (11:31 -0700)]
Introduce the io_u.post_submit callback function pointer

This patch does not change any functionality. The code introduced by
this patch will be used by the zoned block device code.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoAdd the zonemode job option
Bart Van Assche [Fri, 24 Aug 2018 18:31:23 +0000 (11:31 -0700)]
Add the zonemode job option

Fio's zone support makes fio perform I/O inside a zone before it skips
to the next zone. That behavior is the opposite of the behavior needed
for zoned block devices, namely to consider all zones when performing
random I/O. Hence introduce a new job option that allows users to
choose between fio's traditional zone mode and the behavior needed for
zoned block devices. This patch makes fio behave identically with
--zonemode=none and --zonemode=zbd. A later patch will implement new
behavior for --zonemode=zbd.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoAdd the 'zbd' debug level
Bart Van Assche [Fri, 24 Aug 2018 18:31:22 +0000 (11:31 -0700)]
Add the 'zbd' debug level

This debug level will be used in the next patch.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoconfigure: Add <linux/blkzoned.h> test
Bart Van Assche [Fri, 24 Aug 2018 18:31:21 +0000 (11:31 -0700)]
configure: Add <linux/blkzoned.h> test

Add a test for <linux/blkzoned.h> because that header file will be used
by the zoned block device code.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agot/axmap: print explicit overlap ranges tested
Jens Axboe [Thu, 23 Aug 2018 19:58:21 +0000 (13:58 -0600)]
t/axmap: print explicit overlap ranges tested

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agot/axmap: add regression test for overlap case resulting in 0 settable bits
Jens Axboe [Thu, 23 Aug 2018 18:22:58 +0000 (12:22 -0600)]
t/axmap: add regression test for overlap case resulting in 0 settable bits

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoaxmap: return early of an overlap results in 0 settable bits
Jens Axboe [Thu, 23 Aug 2018 18:22:10 +0000 (12:22 -0600)]
axmap: return early of an overlap results in 0 settable bits

Reported-by: Bart Van Assche <bart.vanassche@wdc.com>
Fixes: 15a4f49 ("lib/axmap: Simplify axmap_set_fn()")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch '20180823-terse-remote-fix' of https://github.com/mcgrof/fio
Jens Axboe [Thu, 23 Aug 2018 17:05:34 +0000 (11:05 -0600)]
Merge branch '20180823-terse-remote-fix' of https://github.com/mcgrof/fio

* '20180823-terse-remote-fix' of https://github.com/mcgrof/fio:
  init: add semantics for all types of backends running
  client: respect terse output on client <--> backend relationship

5 years agoinit: add semantics for all types of backends running
Luis Chamberlain [Tue, 21 Aug 2018 18:15:39 +0000 (12:15 -0600)]
init: add semantics for all types of backends running

Commit 67a176fc7 ("Fix segfault with client/server and minimal output")
addressed a segfault but it wasn't very clear *why* the fix was needed.
The reason it was needed is that the disk util and its respective
semaphore are only initialized when setup_disk_util() is called, this
happens upon fio_backend() calls. That is, either we have a dedicated
backend or have initiated a backend for the localhost due to some local
work. And show_thread_status() is currently called from a complete
client setup -- handle_ts() calls show_thread_status(), and a client
does not collect any local disk data, it receives this from the backend.
As such, the semaphore won't be setup in a client setup and this is why
we segfault here.

We can enable show_thread_status() then only if any type of backend is
running, however there is are no semantics currently which enable us to
query for this. Add such semantics and replace the previous check with
a check for if fio_backend() was ever called. This will make it clearer.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
5 years agoclient: respect terse output on client <--> backend relationship
Luis Chamberlain [Tue, 21 Aug 2018 13:24:36 +0000 (07:24 -0600)]
client: respect terse output on client <--> backend relationship

You end up with different results if you run this terse output
on a local system which also runs its own backend Vs running a
client to connect to a remote server which is running fio as a
backend only. The reason is the client ops handle printing of
threads / disk utils separately. The terse output created *by*
the backend is the right and expected output, so just use that,
and we can piggy back off of the fact that the server will send
its own output via FIO_NET_CMD_TEXT.

Another solution is to address getting the disk util data sent
to be cached locally, and then upon handle_ts() print that, but that
would require significant re-architecturing.

Terse output is supposed to be just that, terse. This implies
that it will not be clear from what backend data came from, but
for this the best strategy is to *extend* the terse version with
yet another field, the remote hostname/ip address.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
5 years agoparse: fix bssplit option
Jens Axboe [Thu, 23 Aug 2018 16:29:12 +0000 (10:29 -0600)]
parse: fix bssplit option

Ensure that we copy option sets for FIO_OPT_STR_ULL like we do
for FIO_OPT_STR, in case only one data direction has been defined.

Fixes: 5fff95436922 ("Add support for >= 4G block sizes")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'axmap' of https://github.com/bvanassche/fio
Jens Axboe [Thu, 23 Aug 2018 02:13:45 +0000 (20:13 -0600)]
Merge branch 'axmap' of https://github.com/bvanassche/fio

* 'axmap' of https://github.com/bvanassche/fio:
  lib/axmap: Optimize __axmap_set()
  lib/axmap: Simplify axmap_set_fn()
  lib/axmap: Make axmap_new() more robust
  lib/axmap: Inline ulog64()
  lib/axmap: Add more documentation

5 years agolib/axmap: Optimize __axmap_set()
Bart Van Assche [Wed, 22 Aug 2018 20:22:12 +0000 (13:22 -0700)]
lib/axmap: Optimize __axmap_set()

Since it is guaranteed that nr_bits <= BLOCKS_PER_UNIT and since
axmap_set_fn() needs to be called only once to set that number of
bits, remove the loop from __axmap_set().

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agolib/axmap: Simplify axmap_set_fn()
Bart Van Assche [Wed, 22 Aug 2018 17:43:46 +0000 (10:43 -0700)]
lib/axmap: Simplify axmap_set_fn()

Instead of handling ffz(~overlap) == bit as a special case, handle
this case in the same way as ffz(~overlap) != bit. This patch does
not change any functionality but removes one if-instruction from the
hot path.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agolib/axmap: Make axmap_new() more robust
Bart Van Assche [Wed, 22 Aug 2018 16:00:15 +0000 (09:00 -0700)]
lib/axmap: Make axmap_new() more robust

Return NULL instead of triggering a segmentation fault if calloc() fails.
Note: calling free(NULL) is safe so it is not necessary to check the
free() argument before calling free().

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agolib/axmap: Inline ulog64()
Bart Van Assche [Wed, 22 Aug 2018 20:35:19 +0000 (13:35 -0700)]
lib/axmap: Inline ulog64()

Since the function ulog64() only has one caller and since it can be
replaced by a single closed-form expression, inline that function.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agolib/axmap: Add more documentation
Bart Van Assche [Wed, 22 Aug 2018 15:58:00 +0000 (08:58 -0700)]
lib/axmap: Add more documentation

Make the axmap code easier to follow by documenting the semantics of
the structures and functions in the lib/axmap.c source file.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agoio_u: residiual size should be unsigned long long
Jeff Furlong [Mon, 20 Aug 2018 23:25:29 +0000 (23:25 +0000)]
io_u: residiual size should be unsigned long long

If we target a number of bytes of IO and keep subtracting a
xfer_buflen, we need to ensure the residual length is of the
same size.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoUpdate HOWTO for read_iolog change
Jens Axboe [Mon, 20 Aug 2018 14:34:13 +0000 (08:34 -0600)]
Update HOWTO for read_iolog change

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'multiple-read_iolog' of https://github.com/aclamk/fio
Jens Axboe [Mon, 20 Aug 2018 14:32:29 +0000 (08:32 -0600)]
Merge branch 'multiple-read_iolog' of https://github.com/aclamk/fio

* 'multiple-read_iolog' of https://github.com/aclamk/fio:
  iolog: Now --read_iolog can contain multiple replay files, separated by ':'.

5 years agoiolog: Now --read_iolog can contain multiple replay files, separated by ':'.
Adam Kupczyk [Fri, 17 Aug 2018 13:30:58 +0000 (15:30 +0200)]
iolog: Now --read_iolog can contain multiple replay files, separated by ':'.

    Useful when --numjobs is more then 1.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
5 years agoMove steady state unit test to t/
Jens Axboe [Sat, 18 Aug 2018 01:39:07 +0000 (19:39 -0600)]
Move steady state unit test to t/

That's where we keep the other tests.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'master' of https://github.com/kelleymh/fio
Jens Axboe [Fri, 17 Aug 2018 23:29:11 +0000 (17:29 -0600)]
Merge branch 'master' of https://github.com/kelleymh/fio

* 'master' of https://github.com/kelleymh/fio:
  Remove unused code in lib/axmap.c

5 years agohttp: fix compile-time warnings
Tomohiro Kusumi [Fri, 17 Aug 2018 22:22:00 +0000 (15:22 -0700)]
http: fix compile-time warnings

Fix following warnings on RHEL6 and variants.

engines/http.c: In function 'fio_http_setup':
engines/http.c:611: warning: call to '_curl_easy_setopt_err_seek_cb' declared with attribute warning: curl_easy_setopt expects a curl_seek_callback argument for this option
engines/http.c: In function 'fio_http_queue':
engines/http.c:549: warning: call to '_curl_easy_setopt_err_curl_off_t' declared with attribute warning: curl_easy_setopt expects a curl_off_t argument for this option

For engines/http.c:611, pass &_http_seek instead of cast, since
lack of cast isn't fio's issue. See below comments for details.

"Re: [PATCH] http: fix compile-time warnings"
https://www.spinics.net/lists/fio/msg07246.html

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoRemove unused code in lib/axmap.c
Michael Kelley [Fri, 17 Aug 2018 21:49:49 +0000 (14:49 -0700)]
Remove unused code in lib/axmap.c

With the new axmap_next_free() implementation, the "first_free" cache
is no longer used.  Remove all references to it.  Also axmap_clear()
is never referenced, so remove it and related code.

5 years agoMerge branch 'ddn-ime'
Jens Axboe [Fri, 17 Aug 2018 19:39:40 +0000 (13:39 -0600)]
Merge branch 'ddn-ime'

Pull in DDN IME engine

* ddn-ime:
  Sync man page with fio for IME
  engines/ime: various code and style cleanups
  Add support for DDN's Infinite Memory Engine

5 years agoSync man page with fio for IME
Jens Axboe [Fri, 17 Aug 2018 19:39:12 +0000 (13:39 -0600)]
Sync man page with fio for IME

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoengines/ime: various code and style cleanups
Jens Axboe [Fri, 17 Aug 2018 19:38:59 +0000 (13:38 -0600)]
engines/ime: various code and style cleanups

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'ime-support' of https://github.com/DDNStorage/fio-public into ddn-ime
Jens Axboe [Fri, 17 Aug 2018 19:34:21 +0000 (13:34 -0600)]
Merge branch 'ime-support' of https://github.com/DDNStorage/fio-public into ddn-ime

* 'ime-support' of https://github.com/DDNStorage/fio-public:
  Add support for DDN's Infinite Memory Engine

5 years agoMerge branch 'master' of https://github.com/kelleymh/fio
Jens Axboe [Fri, 17 Aug 2018 19:27:25 +0000 (13:27 -0600)]
Merge branch 'master' of https://github.com/kelleymh/fio

* 'master' of https://github.com/kelleymh/fio:
  Add tests specifically for axmap_next_free()
  Reimplement axmap_next_free() to prevent distribution skew

5 years agoAdd support for DDN's Infinite Memory Engine
Gaëtan Bossu [Wed, 1 Aug 2018 14:27:37 +0000 (16:27 +0200)]
Add support for DDN's Infinite Memory Engine

Created 3 engines in engines/ime.c:
ime_psync, ime_psyncv, and ime_aio

Signed-off-by: Gaëtan Bossu <gbossu@ddn.com>
5 years agoAdd tests specifically for axmap_next_free()
Michael Kelley [Fri, 17 Aug 2018 19:17:00 +0000 (12:17 -0700)]
Add tests specifically for axmap_next_free()

Add tests for axmap_next_free() to ensure the new search algorithm
works correctly.  Since the new algorithm always looks forward for
the next free bit, it's possible to test for specific results given
a known condition of the map.  Test maps that are mostly empty and
mostly full. Test wrap-around. Test maps of particular sizes that
have unused bits in middle levels as well as in level 0.

5 years agoReimplement axmap_next_free() to prevent distribution skew
Michael Kelley [Fri, 17 Aug 2018 19:02:58 +0000 (12:02 -0700)]
Reimplement axmap_next_free() to prevent distribution skew

New algorithm starts the search at the specified bit, and only
looks forward (higher index) for a free bit, wrapping around the
end of the map if necessary.  This avoids a distribution skew in
the current algorithm where the low order 5 or 6 bits of the
replacement address tend toward zero.

The first_free cached value is not updated or used. But performance
of the new algorithm is marginally faster than the old algorithm
when measured on a 200 million entry map that is half full,
averaged across searches starting with each of the 200 million
entries.

A separate commit adds new tests to t/axmap.c to confirm the
correct behavior in a variety of situations and edge cases.

5 years agoconfigure: avoid pkg-config usage for http engine
David Disseldorp [Thu, 16 Aug 2018 16:56:02 +0000 (18:56 +0200)]
configure: avoid pkg-config usage for http engine

Signed-off-by: David Disseldorp <ddiss@suse.de>
5 years agoMerge branch 'wip-http-swift' of https://github.com/l-mb/fio
Jens Axboe [Thu, 16 Aug 2018 16:38:41 +0000 (10:38 -0600)]
Merge branch 'wip-http-swift' of https://github.com/l-mb/fio

* 'wip-http-swift' of https://github.com/l-mb/fio:
  engines/http: Add support for Swift storage backend

5 years agoengines/http: Add support for Swift storage backend
Lars Marowsky-Bree [Thu, 16 Aug 2018 11:06:47 +0000 (13:06 +0200)]
engines/http: Add support for Swift storage backend

This also converts two configuration variables to use "posval" instead
of string parsing or integers.

5 years agoengines/http: fix use of uninitialized variable
Jens Axboe [Thu, 16 Aug 2018 15:30:21 +0000 (09:30 -0600)]
engines/http: fix use of uninitialized variable

Fixes: c2f6a13ddc64 ("engines/http: Add support for WebDAV and S3")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'http_older_openssl' of https://github.com/ddiss/fio
Jens Axboe [Thu, 16 Aug 2018 15:20:43 +0000 (09:20 -0600)]
Merge branch 'http_older_openssl' of https://github.com/ddiss/fio

* 'http_older_openssl' of https://github.com/ddiss/fio:
  engines/http: support openssl < 1.1.0
  configure: use pkg-config to detect libcurl & openssl

5 years agoengines/http: support openssl < 1.1.0
David Disseldorp [Thu, 16 Aug 2018 14:53:49 +0000 (16:53 +0200)]
engines/http: support openssl < 1.1.0

openssl versions prior to 1.1.0 do not use an opaque pointer for
HMAC_CTX.

Signed-off-by: David Disseldorp <ddiss@suse.de>
5 years agoconfigure: use pkg-config to detect libcurl & openssl
David Disseldorp [Thu, 16 Aug 2018 14:37:50 +0000 (16:37 +0200)]
configure: use pkg-config to detect libcurl & openssl

Signed-off-by: David Disseldorp <ddiss@suse.de>
5 years agoFix compilation on centos 7
Manish Dusane [Wed, 15 Aug 2018 18:06:14 +0000 (12:06 -0600)]
Fix compilation on centos 7

"log.h:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘log_err’"

Fixes: https://github.com/axboe/fio/issues/651
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'wip-http-engine' of https://github.com/l-mb/fio
Jens Axboe [Tue, 14 Aug 2018 16:09:47 +0000 (10:09 -0600)]
Merge branch 'wip-http-engine' of https://github.com/l-mb/fio

* 'wip-http-engine' of https://github.com/l-mb/fio:
  engines/http: Add support for WebDAV and S3

5 years agoengines/http: Add support for WebDAV and S3
Lars Marowsky-Bree [Fri, 10 Aug 2018 08:19:32 +0000 (10:19 +0200)]
engines/http: Add support for WebDAV and S3

The http engine allows fio to read/write objects to WebDAV and S3
storage systems via libcurl.

Writes are mapped to PUT, reads to GET, and TRIM to DELETE of individual
objects within the bucket/path.

5 years agoMerge branch 'fio-man-page' of https://github.com/bvanassche/fio
Jens Axboe [Tue, 14 Aug 2018 03:05:33 +0000 (21:05 -0600)]
Merge branch 'fio-man-page' of https://github.com/bvanassche/fio

* 'fio-man-page' of https://github.com/bvanassche/fio:
  Improve zone support documentation

5 years agoRemove old zone gen from options
Jens Axboe [Tue, 14 Aug 2018 02:54:46 +0000 (20:54 -0600)]
Remove old zone gen from options

Forgot to remove this in the previous commit...

Fixes: 077761273931 ("Fix double free of zone cache data")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoFix double free of zone cache data
Jens Axboe [Tue, 14 Aug 2018 02:21:05 +0000 (20:21 -0600)]
Fix double free of zone cache data

We can't set it up in the parsing callback, as that happens before
we fork off the thread. Fixes a segfault with:

./fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --name=pre_test --rw=randwrite --bssplit=4k/67:8k/10:16k/7:32k/3:64k/13 --random_distribution=zoned:50/5:30/15:20/80 --iodepth=32 --runtime=60 --time_based --numjobs=2 --filename=/dev/nvme0n1p9 --group_reporting=1

Fixes: https://github.com/axboe/fio/issues/650
Fixes: e0a04ac15f61 ("Add support for zones of random IO, with varying frequency of access")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoImprove zone support documentation
Bart Van Assche [Fri, 10 Aug 2018 00:02:59 +0000 (17:02 -0700)]
Improve zone support documentation

Improve the documentation of the zonesize, zoneskip and zonerange job
options such that this documentation becomes easier to comprehend.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
5 years agoasprintf: fix indentation
Jens Axboe [Mon, 13 Aug 2018 17:18:09 +0000 (11:18 -0600)]
asprintf: fix indentation

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agogclient: bump output time buf size
Jens Axboe [Mon, 13 Aug 2018 15:47:45 +0000 (09:47 -0600)]
gclient: bump output time buf size

We could potentially write a few bytes too many, just bump the
timebuf size up into a safe region.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'minor_fixes' of https://github.com/sitsofe/fio
Jens Axboe [Sun, 12 Aug 2018 21:51:34 +0000 (15:51 -0600)]
Merge branch 'minor_fixes' of https://github.com/sitsofe/fio

* 'minor_fixes' of https://github.com/sitsofe/fio:
  man: fix missing/too many backslashes
  doc: rewording and add reference to --aux-path
  doc: update Log File Formats and write_iops_log sections
  minor fio.service cleanups

5 years agoman: fix missing/too many backslashes
Sitsofe Wheeler [Sun, 12 Aug 2018 19:58:56 +0000 (20:58 +0100)]
man: fix missing/too many backslashes

When viewing the man page some backslashes were AWOL whereas in other
places there were too many so fix them all.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
5 years agodoc: rewording and add reference to --aux-path
Sitsofe Wheeler [Sun, 12 Aug 2018 19:38:18 +0000 (20:38 +0100)]
doc: rewording and add reference to --aux-path

- Reword --aux-path definition
- Reword "filename semantic" text in directory definition
- Add reference to --aux-path from --filename definition

Closes: https://github.com/axboe/fio/issues/530
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
5 years agodoc: update Log File Formats and write_iops_log sections
Sitsofe Wheeler [Sat, 2 Sep 2017 11:14:19 +0000 (12:14 +0100)]
doc: update Log File Formats and write_iops_log sections

Make it clearer when various log entries will be always set to 0, move
"IOPS value is 1 without windowed logging" warning to write_iops_log
option description, change offset definition to position, add some
formatting.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
5 years agominor fio.service cleanups
Sitsofe Wheeler [Thu, 14 Sep 2017 02:08:35 +0000 (03:08 +0100)]
minor fio.service cleanups

- Remove PIDFile line because the service Type=simple and nothing will
  write the pidfile (we aren't launching fio with -daemonize=pathtopid)
- Change some capitalisation
- [Install] section

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
5 years agotravis: include new xcode 9.4
Jens Axboe [Sun, 12 Aug 2018 16:55:53 +0000 (10:55 -0600)]
travis: include new xcode 9.4

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'armv6' of https://github.com/sitsofe/fio
Jens Axboe [Sun, 12 Aug 2018 15:09:16 +0000 (09:09 -0600)]
Merge branch 'armv6' of https://github.com/sitsofe/fio

* 'armv6' of https://github.com/sitsofe/fio:
  arch: fix build breakage on armv6

5 years agoarch: fix build breakage on armv6
Sitsofe Wheeler [Sun, 12 Aug 2018 08:42:03 +0000 (09:42 +0100)]
arch: fix build breakage on armv6

The FreeBSD folks found fio didn't build on their armv6 systems
(https://svnweb.freebsd.org/ports/head/benchmarks/fio/Makefile?revision=432897&view=markup
) but Mikaël Urankar fixed the issue in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228042 so copy the fix
to mainline.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
5 years agoeta: clean up ETA string printing
Jens Axboe [Fri, 10 Aug 2018 15:33:44 +0000 (09:33 -0600)]
eta: clean up ETA string printing

No need to have a separate case for trims, we just need to look
at if we have reads, writes, trims.

This also eliminates printing read or write strings if we are not
doing that particular type of IO.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoMerge branch 'realloc-io_u-buffers' of https://github.com/aclamk/fio
Jens Axboe [Thu, 9 Aug 2018 15:31:26 +0000 (09:31 -0600)]
Merge branch 'realloc-io_u-buffers' of https://github.com/aclamk/fio

* 'realloc-io_u-buffers' of https://github.com/aclamk/fio:
  iolog replay: Realloc io_u buffers to adapt to operation size.
  iolog replay: Treat 'open' on file that is scheduled to close as cancel of 'close' operation.

5 years agoxxhash: fix function definition and declaration mismatch
Udit agarwal [Thu, 9 Aug 2018 15:20:12 +0000 (09:20 -0600)]
xxhash: fix function definition and declaration mismatch

During the declaration of, let's say XXH32_init parameter type is
'unsigned int' while during the definition it is 'uint32_t'. Now, on
most desktop os, they are are usually same, however on some embedded
platforms, for example RTEMS which uses newlib as it's standard c
library, they both are different.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
5 years agoiolog replay: Realloc io_u buffers to adapt to operation size.
Adam Kupczyk [Thu, 9 Aug 2018 14:05:22 +0000 (16:05 +0200)]
iolog replay: Realloc io_u buffers to adapt to operation size.

When iolog is read in chunked mode, some prefetching is done. Based on this size of buffers are determined.
Further operations may need larger buffers. If so, io_u buffers are reallocated.
Example that cause problem when read_iolog_chunked=1:
fio version 2 iolog
rbd_data.0 add
rbd_data.0 open
rbd_data.0 write 0 4096 (x20)
rbd_data.0 write 0 4096000 (x10)
rbd_data.0 close

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
5 years agoiolog replay: Treat 'open' on file that is scheduled to close as cancel of 'close...
Adam Kupczyk [Thu, 9 Aug 2018 10:53:29 +0000 (12:53 +0200)]
iolog replay: Treat 'open' on file that is scheduled to close as cancel of 'close' operation.

Problem occurs when processing generated iolog files, such as this:
fio version 2 iolog
rbd_data.0 add
rbd_data.0 open
rbd_data.0 write 0 4096
rbd_data.0 close
rbd_data.0 open
rbd_data.0 write 0 4096
rbd_data.0 close

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>