fio.git
17 months agoFio 3.33 fio-3.33
Jens Axboe [Sun, 6 Nov 2022 20:55:41 +0000 (13:55 -0700)]
Fio 3.33

Signed-off-by: Jens Axboe <axboe@kernel.dk>
17 months agotest: use homebrew to install sphinx instead of pip on macOS
Vincent Fu [Fri, 4 Nov 2022 17:15:10 +0000 (13:15 -0400)]
test: use homebrew to install sphinx instead of pip on macOS

With the current GitHub Actions macOS image, pip3 install sphinx does
not appear to place sphinx-doc in the path. This results in
documentation build failures.

Resolve this by using homebrew to install sphinx-doc and add it to the
search path.

https://www.sphinx-doc.org/en/master/usage/installation.html
https://github.com/vincentkfu/fio/actions/runs/3395703049/jobs/5645918799

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agotest: change GitHub Actions macOS platform to macOS 12
Vincent Fu [Fri, 4 Nov 2022 17:04:34 +0000 (13:04 -0400)]
test: change GitHub Actions macOS platform to macOS 12

I am seeing some documentation build failures on macOS 11. See if the
issue is fixed in macOS 12.

https://github.com/vincentkfu/fio/actions/runs/3395509649/jobs/5645674083

This change ultimately did not resolve the issue but we might as well
switch to macOS 12 since it has been out for a year already.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agoio_uring: update documentation and small fix for sqthread_poll
Ankit Kumar [Fri, 21 Oct 2022 11:32:36 +0000 (17:02 +0530)]
io_uring: update documentation and small fix for sqthread_poll

type for sqthread_poll should be FIO_OPT_STR_SET, as this only
requires it to be set. This also fixes the issue:
https://github.com/axboe/fio/issues/927

Update the HOWTO and man page to specify the missing types for all
the remaining io_uring options.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agoHOWTO: clean up exit_what description
Vincent Fu [Wed, 2 Nov 2022 14:26:36 +0000 (10:26 -0400)]
HOWTO: clean up exit_what description

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agoHOWTO: update description for flow option
Vincent Fu [Tue, 1 Nov 2022 21:24:34 +0000 (17:24 -0400)]
HOWTO: update description for flow option

d4e74fda98b60dc175b4114492fcc7c21c617ddd updated the description for
`flow` in fio.1 but did not update the HOWTO. Make the HOWTO description
match what is in fio.1

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: add test for experimental verify with loops and time_based options
Shin'ichiro Kawasaki [Thu, 20 Oct 2022 06:38:54 +0000 (15:38 +0900)]
test: add test for experimental verify with loops and time_based options

Add a test case to confirm fix of numberio accounting issue of
experimental verify using loops and time_based options.

Of note is that this case fails on Windows with error "bad header
rand_seed". Until it gets fixed, require to non-Windows OS for this test
case so that CI does not report the known failure.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: add test for verify read back of experimental verify
Shin'ichiro Kawasaki [Thu, 20 Oct 2022 06:38:53 +0000 (15:38 +0900)]
test: add test for verify read back of experimental verify

Add a test case to confirm fix of bytes_done accounting issue of
experimental verify. The test job runs a simple workload with
experimental verify and confirm verify read amount is the file size.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agoverify: fix numberio accounting of experimental verify
Shin'ichiro Kawasaki [Thu, 20 Oct 2022 06:38:52 +0000 (15:38 +0900)]
verify: fix numberio accounting of experimental verify

As for non-experimental verify, numberio is compared between the numbers
saved in metadata and written data header. As for experimental verify,
the metadata is not available. Instead of numberio in metadata, it
refers td->io_issues[] as the numberio value for the comparison.
However, td->io_issues[] is used not only for verify reads but also for
normal I/Os. It results in comparison with wrong numberio value and
verification failure.

Fix this issue by adding a new field td->verify_read_issues which counts
up number of verify reads. Substitute td->verify_read_issues to
io_u->numberio to refer it for the comparison in experimental verify
path. Also move td->io_issues[] substitution to io_u->numberio out of
populate_verify_io_u() to keep same behavior in non-experimental verify
path.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agoverify: fix bytes_done accounting of experimental verify
Shin'ichiro Kawasaki [Thu, 20 Oct 2022 06:38:51 +0000 (15:38 +0900)]
verify: fix bytes_done accounting of experimental verify

The commit 55312f9f5572 ("Add ->bytes_done[] to struct thread_data")
moved bytes_done[] on stack to struct thread_data. However, this unified
two bytes_done[] in do_io() and do_verify() stacks into single
td->bytes_done[]. This caused wrong condition check in do_verify() in
experimental verify path since td->bytes_done[] holds values for do_io()
not for do_verify(). This caused unexpected loop break in do_verify()
and verify read skip when experimental_verify=1 option is specified.

To fix this, add bytes_verified to struct thread_data for do_verify() in
same manner as bytes_done[] for do_io(). Introduce a helper function
io_u_update_bytes_done() to factor out same code for bytes_done[] and
bytes_verified[].

Fixes: 55312f9f5572 ("Add ->bytes_done[] to struct thread_data")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agoMerge branch 'fix-cpus_allowed' of https://github.com/roxma/fio
Vincent Fu [Mon, 24 Oct 2022 14:10:50 +0000 (10:10 -0400)]
Merge branch 'fix-cpus_allowed' of https://github.com/roxma/fio

* 'fix-cpus_allowed' of https://github.com/roxma/fio:
  cpus_allowed: use __NRPROCESSORS_CONF instead of __SC_NPROCESSORS_ONLN for non-sequential CPU ids

18 months agocpus_allowed: use __NRPROCESSORS_CONF instead of __SC_NPROCESSORS_ONLN for non-sequen...
mayuanpeng [Fri, 21 Oct 2022 12:18:13 +0000 (20:18 +0800)]
cpus_allowed: use __NRPROCESSORS_CONF instead of __SC_NPROCESSORS_ONLN for non-sequential CPU ids

When disabling SMT on some systems, the ID of some available CPU may
be larger than the value of sysconf(_SC_NPROCESSORS_ONLN). Without
this patch, fio complains that the expected CPU ID is invalid. Here's
an example from my server:

    $ ./fio --cpus_allowed=14 --ioengine=libaio --direct=1 --name=test --numjobs=1 --blocksize=128k --iodepth=1 --rw=read --filename=/dev/nvme0n1
    fio: CPU 14 too large (max=11)
    fio: failed parsing cpus_allowed=14

System information:

    $ lscpu
    Architecture:         x86_64
    CPU op-mode(s):       32-bit, 64-bit
    Byte Order:           Little Endian
    CPU(s):               20
    On-line CPU(s) list:  0,2,4,6,8,10,12,14,16-19
    Off-line CPU(s) list: 1,3,5,7,9,11,13,15
    ...
    Model name:           12th Gen Intel(R) Core(TM) i7-12700
    BIOS Model name:      12th Gen Intel(R) Core(TM) i7-12700
    ...

    $ uname -a
    Linux localhost.localdomain 4.18.0-348.el8.x86_64 #1 SMP Tue Oct 19 15:14:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

    $ cat /etc/redhat-release
    CentOS Linux release 8.5.2111

    $ cat /proc/cmdline
    BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-348.el8.x86_64 root=/dev/mapper/cl-root ro nosmt isolcpus=0,2,4,6,8,10,12,14 crashkernel=auto resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet

    $ cat test.c
    #include <stdio.h>
    #include <unistd.h>
    int main(int argc, char *argv[])
    {
        printf("_SC_NPROCESSORS_ONLN=%ld _SC_NPROCESSORS_CONF=%ld\n",
               sysconf(_SC_NPROCESSORS_ONLN), sysconf(_SC_NPROCESSORS_CONF));
    }

    $ gcc test.c

    $ ./a.out
    _SC_NPROCESSORS_ONLN=12 _SC_NPROCESSORS_CONF=20

Signed-off-by: mayuanpeng <mayuanpeng@dapustor.com>
18 months agostat: fix segfault with fio option --bandwidth-log
Ankit Kumar [Fri, 21 Oct 2022 06:49:00 +0000 (12:19 +0530)]
stat: fix segfault with fio option --bandwidth-log

The log_params for aggregate read, write and trim only specify
log type. As a result the io_log doesn't have the relevant
thread_data structure. With fio option --bandwidth-log this results
in segmentation fault.
Add a check and use DEF_LOG_ENTRIES for such case.

Fixes: 0a852a50 ("fio: Introduce the log_entries option")
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
[vkf: added Fixes tag, lightly edited commit message]
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agoMerge branch 'issue-1213' of https://github.com/SystemFabricWorks/fio
Vincent Fu [Wed, 19 Oct 2022 16:04:50 +0000 (12:04 -0400)]
Merge branch 'issue-1213' of https://github.com/SystemFabricWorks/fio

* 'issue-1213' of https://github.com/SystemFabricWorks/fio:
  libcufile: use generic_get_file_size
  fix configure probe for libcufile

18 months agolibcufile: use generic_get_file_size
Brian T. Smith [Tue, 18 Oct 2022 18:14:51 +0000 (13:14 -0500)]
libcufile: use generic_get_file_size

In libcufile ioengine_ops, set get_file_size to
generic_get_file_size.

Fixes #1213.

Signed-off-by: Brian T. Smith <bsmith@systemfabricworks.com>
18 months agofix configure probe for libcufile
Brian T. Smith [Mon, 26 Sep 2022 17:59:18 +0000 (12:59 -0500)]
fix configure probe for libcufile

The libcufile probe now requires -ldl passsed to the linker.

Signed-off-by: Brian T. Smith <bsmith@systemfabricworks.com>
18 months agotest: change GitHub actions checkout from v2 to v3
Vincent Fu [Tue, 18 Oct 2022 14:43:54 +0000 (10:43 -0400)]
test: change GitHub actions checkout from v2 to v3

GitHub actions is reporting a warning that actions/checkout@v2 includes
the deprecated Node.js 12. So switch to actions/checkout@v3 which uses
Node.js 16.

As far as I can tell this has no impact on our workflow.

For details see:
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
https://github.com/actions/checkout

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agot/zbd: add a CLI option to force io_uring
Dmitry Fomichev [Sun, 16 Oct 2022 01:43:09 +0000 (10:43 +0900)]
t/zbd: add a CLI option to force io_uring

Many modern Linux distros don't include libaio-dev or libaio-devel
package by default and this leads to libaio ioengine being
unavailable in fio instances built at such systems.

Approximately one third of the test cases in the fio test script for
zoned block devices, t/zbd/test-zbd-support, use libaio ioengine.

In order to allow users to run the entire set of ZBD tests without
libaio, introduce a new command line option, -u, to the test script.
When this option is added to the script command line, all tests that
normally use libaio will be modified to use io_uring ioengine.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Link: https://lore.kernel.org/r/20221016014309.53682-2-dmitry.fomichev@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
18 months agot/zbd: fix max_open_zones determination in tests
Dmitry Fomichev [Sun, 16 Oct 2022 01:43:08 +0000 (10:43 +0900)]
t/zbd: fix max_open_zones determination in tests

The test script erroneously falls back to using libzbc for finding out
the max_open_zones setting if the device being tested is not a SCSI
device. This causes false positives if libzbc is not installed in the
test system. To fix, unless the option to use libzbc is explicitly set,
set this value to 0 for non-SCSI devices to let fio find the actual
max_open_zones value using the system block interface.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Link: https://lore.kernel.org/r/20221016014309.53682-1-dmitry.fomichev@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
18 months agofio: warn about "ioengine=psync" and "iodepth >= 1"
Alexey Dobriyan [Sat, 15 Oct 2022 19:41:08 +0000 (22:41 +0300)]
fio: warn about "ioengine=psync" and "iodepth >= 1"

Some users are using both ioengine=psync and iodepth=2+
without blinking in front of the millions:

https://youtu.be/coShLkCriXc?t=840
https://youtu.be/coShLkCriXc?t=890

Help them with helpful message.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Link: https://lore.kernel.org/r/Y0sM1PJKEzfv47ZB@localhost.localdomain
[axboe: style fixup]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
18 months agoMerge branch 'readme-update' of https://github.com/nikoandpiko/fio
Jens Axboe [Sat, 15 Oct 2022 15:05:32 +0000 (09:05 -0600)]
Merge branch 'readme-update' of https://github.com/nikoandpiko/fio

* 'readme-update' of https://github.com/nikoandpiko/fio:
  Update to README

18 months agoUpdate to README
Nicholas Roma [Sat, 15 Oct 2022 11:41:52 +0000 (20:41 +0900)]
Update to README

Typo and grammatical fix for README

Signed-off-by: Nick Roma <nikoandpiko@gmail.com>
18 months agoengines/io_uring: set coop taskrun, single issuer and defer taskrun
Ankit Kumar [Tue, 11 Oct 2022 10:59:35 +0000 (16:29 +0530)]
engines/io_uring: set coop taskrun, single issuer and defer taskrun

Add missing changes to io_uring_cmd I/O engine for COOP_TASKRUN
This was introduced for io_uring in commit 4d22c103

Add missing changes to io_uring_cmd I/O engine to set single issuer
and defer taskrun. This was introduced for io_uring in commit e453f369

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Link: https://lore.kernel.org/r/20221011105935.10455-2-ankit.kumar@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
18 months agoexamples: uring-cmd-zoned: expand the reasoning behind QD1
Pankaj Raghav [Fri, 7 Oct 2022 12:05:28 +0000 (14:05 +0200)]
examples: uring-cmd-zoned: expand the reasoning behind QD1

Expand the reasoning behind using QD1 for zoned devices with io_uring_cmd
engine.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: make t0014.fio time_based
Vincent Fu [Wed, 5 Oct 2022 22:34:41 +0000 (18:34 -0400)]
test: make t0014.fio time_based

Make the job time_based to ensure we run for long enough to obtain the
expected log lines. If the device is too fast fio will consume 100G
and write fewer than the expected log lines.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: improve run-fio-tests.py file open method
Vincent Fu [Wed, 5 Oct 2022 20:53:20 +0000 (13:53 -0700)]
test: improve run-fio-tests.py file open method

We have several instances where we try to open a file and fail the test
if accessing the file fails. Encapsulate all of this within a single
method to reduce code duplication.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: fix t/run-fio-tests.py style issues identified by pylint
Vincent Fu [Wed, 5 Oct 2022 20:46:40 +0000 (13:46 -0700)]
test: fix t/run-fio-tests.py style issues identified by pylint

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: add basic tests for trimwrite workloads
Vincent Fu [Wed, 5 Oct 2022 19:14:25 +0000 (12:14 -0700)]
test: add basic tests for trimwrite workloads

We have some tests for randtrimwrite; it's easy enough to reuse the code
to test trimwrite workloads.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: fix style issues in run-fio-tests.py
Vincent Fu [Wed, 5 Oct 2022 19:13:43 +0000 (12:13 -0700)]
test: fix style issues in run-fio-tests.py

Fix some style issues identified by pylint.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: check all offsets touched for randtrimwrite
Vincent Fu [Wed, 5 Oct 2022 00:20:09 +0000 (17:20 -0700)]
test: check all offsets touched for randtrimwrite

Make sure that all of the offsets are touched for the randtrimwrite test
when randommap is enabled.

This exposes a problem where mixed ddir workloads that use a random map
may not have all blocks touched when the different data directions use
different block sizes. Resolve this for now by setting the same block
size for all data directions for the job named bs.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: clean up randtrimwrite test
Vincent Fu [Tue, 4 Oct 2022 21:10:17 +0000 (14:10 -0700)]
test: clean up randtrimwrite test

Simplify the job file by putting write_bw_log in the [global] section.

Rename check_seq to the clearer check_trimwrite since it makes sure that
trims are followed by writes.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Tue, 4 Oct 2022 20:25:09 +0000 (14:25 -0600)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Android: Enable the 'sg' engine
  Android: Fix the build of the 'sg' engine

18 months agoAndroid: Enable the 'sg' engine
Bart Van Assche [Tue, 4 Oct 2022 19:22:00 +0000 (12:22 -0700)]
Android: Enable the 'sg' engine

Make it possible to use the 'sg' engine on Android. This engine has been
verified on Android by running fio --verify=md5 on top of a scsi_debug
instance.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
18 months agoAndroid: Fix the build of the 'sg' engine
Bart Van Assche [Tue, 4 Oct 2022 19:22:00 +0000 (12:22 -0700)]
Android: Fix the build of the 'sg' engine

Fix the following compiler error:

engines/sg.c:1337:46: error: argument type 'void' is incomplete
                                snprintf(msgchunk, MAXMSGCHUNK, " %02x", hdr->sbp[i]);

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
18 months agorandtrimwrite: fix corner case with variable block sizes
Vincent Fu [Mon, 3 Oct 2022 17:42:41 +0000 (10:42 -0700)]
randtrimwrite: fix corner case with variable block sizes

When we have variable block sizes it's possible to finish a trim + write
pair and then have the next (smaller length) trim operation have a
different start offset but the same end offset as the previous pair of
trim and write operations. This would fool fio into believing that it
had already completed a trim + write pair when it actually completed
only the trim.

Resolve this problem by comparing start offsets instead of end offsets.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agorandtrimwrite: fix offsets for corner case
Vincent Fu [Fri, 30 Sep 2022 23:54:57 +0000 (16:54 -0700)]
randtrimwrite: fix offsets for corner case

For randtrimwrite, we decide whether to issue a trim or a write based on
whether the end offsets for the most recent trim and write commands
match.  If they don't match that means we just issued a new trim and the
next operation should be a write. If they *do* match that means we just
completed a trim + write pair and the next command should be a trim.

This works fine for sequential workloads but for random workloads it's
possible to complete a trim + write pair and then have the randomly
generated offset for the next trim command match the previous offset. If
that happens we need to alter the offset for the last write operation in
order to ensure that we issue a write operation the next time through.

It feels dirty to change the meaning of last_pos[DDIR_WRITE] in this way
but hopefully the long comment in the code will be sufficient warning.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agotest: test job for randtrimwrite
Vincent Fu [Fri, 30 Sep 2022 19:48:56 +0000 (12:48 -0700)]
test: test job for randtrimwrite

This test exposes a problem with randtrimwrite when norandommap is
enabled.

Currently we check to see if the last write and last trim ended at the
same position. If so, we decide that the next operation should be a
trim. This is ok in most cases but if norandommap is enabled, it could
happen by chance that we just finished a trim + write on an offset and
randomly chose that same offset again. This would fool fio into thinking
that it already finished a trim + write pair when it actually issued
only a trim operation.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agorandtrimwrite: write at same offset as trim
Vincent Fu [Thu, 29 Sep 2022 23:58:17 +0000 (16:58 -0700)]
randtrimwrite: write at same offset as trim

We need to do a little bit more to make sure that the writes land on the
offsets that were trimmed.

We only have a single random seed for offsets. So we need to just use
the offset from trim commands when issuing writes.

When we have variable block sizes we need to make sure that the trim and
write commands are the same size.

When randommap is enabled we have to let it adjust the block size for
trim commands to make sure that the trim command does not touch any
blocks that have already been touched.

For sizes of write commands just use the size of the trim command.

Fixes: c16dc793a3c45780f67ce65244b6e91323dee014 "Add randtrimwrite data
direction"

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
18 months agoengines/io_uring: add fixedbufs support for io_uring_cmd
Anuj Gupta [Mon, 3 Oct 2022 03:31:52 +0000 (09:01 +0530)]
engines/io_uring: add fixedbufs support for io_uring_cmd

This patch enables fixedbufs support for io_uring_cmd. This has already
been done in t/io_uring, just do it here as well.

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Link: https://lore.kernel.org/r/20221003033152.314763-1-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agoAdd randtrimwrite data direction
Jens Axboe [Wed, 28 Sep 2022 15:11:41 +0000 (09:11 -0600)]
Add randtrimwrite data direction

This works like trimwrite, except we use random offsets for the trim
location rather than sequential ones.

Suggested-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agot/io_uring: get rid of useless read barriers
Jens Axboe [Wed, 28 Sep 2022 13:28:58 +0000 (07:28 -0600)]
t/io_uring: get rid of useless read barriers

We don't need a read barrier when we have acquire semantics on reading
the CQ ring tail.

We also don't need acquire semantics on the SQ ring head, unless we're
using SQPOLL. A syscall transition will have happened for !SQPOLL.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agodoc: build manpage from fio_doc.rst instead of fio_man.rst
Vincent Fu [Tue, 27 Sep 2022 14:43:49 +0000 (07:43 -0700)]
doc: build manpage from fio_doc.rst instead of fio_man.rst

Sphinx prints warnings when it encounters duplicate labels. In HOWTO.rst
are labels for int, irange, and bool. We include HOWTO.rst in both
fio_doc.rst and fio_man.rst. Since labels must be unique across all
files, Sphinx prints warnings for these labels.

For an unknown reason, Sphinx previously did not issue warnings for the
duplicate labels mentioned above until 5.2.0. But Sphinx 5.2.1 is now
installed for the macOS 11 image in GitHub Actions. So now we see Sphinx
warnings when building documentation in GitHub Actions.

Our CI treats Sphinx warnings as test failures. So our macOS builds are
marked as failures.

Resolve this problem by eliminating the separate fio_man.rst file and
just building the manpage from the largely equivalent fio_doc.rst.

Successful build with 5.1.1: https://github.com/axboe/fio/actions/runs/3106980788/jobs/5034529793
Failed build with 5.2.1: https://github.com/axboe/fio/actions/runs/3129974184/jobs/5079696775

Link: https://github.com/sphinx-doc/sphinx/pull/10781
Link: https://github.com/sphinx-doc/sphinx/issues/10870
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
19 months agoarm64: ensure CPU clock retrieval issues isb()
Jens Axboe [Thu, 22 Sep 2022 16:03:51 +0000 (10:03 -0600)]
arm64: ensure CPU clock retrieval issues isb()

This prevents counter value speculation, which will otherwise cause
issues with the CPU clock.

Link: https://github.com/axboe/fio/issues/1472
Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agoconfigure: change grep -P to grep -E
Vincent Fu [Mon, 19 Sep 2022 13:34:13 +0000 (09:34 -0400)]
configure: change grep -P to grep -E

grep -P is not supported on FreeBSD. So use grep -E when we check
whether the value provided for --seed-buckets is a number or not.

Reported-by: Rebecca Cran <rebecca@bsdio.com>
Link: https://lore.kernel.org/fio/26076f36-54d5-ca6e-0b96-a7371b1c5e49@bsdio.com/T/#t
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
19 months agogettime: cleanups
Vincent Fu [Wed, 14 Sep 2022 17:50:52 +0000 (10:50 -0700)]
gettime: cleanups

Fix a comment and get rid of the extra new lines in the debug print.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
19 months agoMerge branch 'fix-example-disk-zone-profile' of github.com:cvubrugier/fio
Vincent Fu [Thu, 15 Sep 2022 15:02:49 +0000 (11:02 -0400)]
Merge branch 'fix-example-disk-zone-profile' of github.com:cvubrugier/fio

* 'fix-example-disk-zone-profile' of github.com:cvubrugier/fio:
  examples: fix bandwidth logs generation in disk-zone-profile.fio
  examples: set zonemode to strided in disk-zone-profile.fio

19 months agoMerge branch 'master' of github.com:uniontech-lilinjie/fio
Vincent Fu [Thu, 15 Sep 2022 14:53:24 +0000 (10:53 -0400)]
Merge branch 'master' of github.com:uniontech-lilinjie/fio

* 'master' of github.com:uniontech-lilinjie/fio:
  fix spelling error

19 months agobackend: number of ios not as expected for trimwrite
Ankit Kumar [Tue, 13 Sep 2022 10:45:27 +0000 (16:15 +0530)]
backend: number of ios not as expected for trimwrite

number_ios should be twice for trimwrite, just like size or
io_size. Update the documentation for "rw=trimwrite" to explain the
changes.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Reviewed-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20220913104527.18734-2-ankit.kumar@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agofix spelling error
lilinjie [Tue, 13 Sep 2022 10:35:20 +0000 (18:35 +0800)]
fix spelling error

Signed-off-by: lilinjie <lilinjie@uniontech.com>
19 months agostat: fix comment about memory consumption
Vincent Fu [Mon, 12 Sep 2022 14:43:17 +0000 (10:43 -0400)]
stat: fix comment about memory consumption

We changed from unsigned int to uint64_t for the latency frequency
counters. Reflect this in the comment describing how much memory the
latency frequency counters require.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
19 months agoexamples: fix bandwidth logs generation in disk-zone-profile.fio
Christophe Vu-Brugier [Mon, 12 Sep 2022 12:17:49 +0000 (14:17 +0200)]
examples: fix bandwidth logs generation in disk-zone-profile.fio

Because the job name is set to "/dev/sdb", the bandwidth logs are
written to /dev/sdb_bw.1.log which is unexpected.

This commit changes the job name to "disk-zone-profile" so that the
bandwidth logs are written to "disk-zone-profile_bw.1.log".

Moreover, the `log_offset` option is enabled to log the I/O
offset. This is required to plot the HDD zones.

Signed-off-by: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>
19 months agoexamples: set zonemode to strided in disk-zone-profile.fio
Christophe Vu-Brugier [Mon, 12 Sep 2022 12:13:04 +0000 (14:13 +0200)]
examples: set zonemode to strided in disk-zone-profile.fio

This fixes the following error:

    # fio disk-zone-profile.fio
    fio: --zonemode=none and --zonesize are not compatible.

Signed-off-by: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>
19 months agoMerge branch 'rpma-add-support-for-libpmem2-to-the-librpma-engine' of https://github...
Jens Axboe [Tue, 6 Sep 2022 12:58:48 +0000 (06:58 -0600)]
Merge branch 'rpma-add-support-for-libpmem2-to-the-librpma-engine' of https://github.com/ldorau/fio

* 'rpma-add-support-for-libpmem2-to-the-librpma-engine' of https://github.com/ldorau/fio:
  rpma: add support for libpmem2 to librpma engine in GPSPM mode
  rpma: add support for libpmem2 to librpma engine in APM mode
  rpma: simplify server_cmpl_process()

19 months agoMerge branch 'ci-build-the-librpma-fio-engine' of https://github.com/ldorau/fio
Jens Axboe [Tue, 6 Sep 2022 12:57:16 +0000 (06:57 -0600)]
Merge branch 'ci-build-the-librpma-fio-engine' of https://github.com/ldorau/fio

* 'ci-build-the-librpma-fio-engine' of https://github.com/ldorau/fio:
  ci: remove the unused travis-install-pmdk.sh file
  ci: build the librpma fio engine

19 months agoci: remove the unused travis-install-pmdk.sh file
Lukasz Dorau [Tue, 6 Sep 2022 12:17:40 +0000 (14:17 +0200)]
ci: remove the unused travis-install-pmdk.sh file

Remove the unused travis-install-pmdk.sh file.
The libpmem and libpmem2 libraries are installed from packages.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
19 months agoci: build the librpma fio engine
Lukasz Dorau [Tue, 6 Sep 2022 12:11:43 +0000 (14:11 +0200)]
ci: build the librpma fio engine

Install the librpma library and two required packges
(libpmem2-dev and libprotobuf-c-dev) to have
the librpma fio engine built.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
19 months agorpma: add support for libpmem2 to librpma engine in GPSPM mode
Kacper Stefanski [Thu, 24 Feb 2022 14:59:03 +0000 (15:59 +0100)]
rpma: add support for libpmem2 to librpma engine in GPSPM mode

Add support for libpmem2 to librpma fio engine in the GPSPM mode.

Signed-off-by: Kacper Stefanski <kacper.stefanski@intel.com>
19 months agorpma: add support for libpmem2 to librpma engine in APM mode
Kacper Stefanski [Sun, 13 Feb 2022 23:02:23 +0000 (00:02 +0100)]
rpma: add support for libpmem2 to librpma engine in APM mode

Add support for libpmem2 to librpma fio engine in the APM mode.

Signed-off-by: Kacper Stefanski <kacper.stefanski@intel.com>
19 months agorpma: simplify server_cmpl_process()
Lukasz Dorau [Mon, 28 Feb 2022 14:25:53 +0000 (15:25 +0100)]
rpma: simplify server_cmpl_process()

Simplify the code of the server_cmpl_process() function.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
19 months agot/io_uring: enable support for registered buffers for passthrough
Jens Axboe [Sat, 3 Sep 2022 17:02:10 +0000 (11:02 -0600)]
t/io_uring: enable support for registered buffers for passthrough

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agot/io_uring: properly detect numa nodes for passthrough mode
Jens Axboe [Sat, 3 Sep 2022 17:01:19 +0000 (11:01 -0600)]
t/io_uring: properly detect numa nodes for passthrough mode

We need to use a different path for the char nodes. With this, my
setup correctly detects the nodes for all devices:

submitter=0, tid=4746, file=/dev/ng0n1, node=6
submitter=1, tid=4747, file=/dev/ng1n1, node=6
submitter=2, tid=4748, file=/dev/ng2n1, node=6
submitter=3, tid=4749, file=/dev/ng3n1, node=6
submitter=4, tid=4750, file=/dev/ng4n1, node=4
submitter=5, tid=4751, file=/dev/ng5n1, node=4
submitter=6, tid=4752, file=/dev/ng6n1, node=4
submitter=7, tid=4753, file=/dev/ng7n1, node=4
submitter=8, tid=4754, file=/dev/ng8n1, node=4
submitter=9, tid=4755, file=/dev/ng9n1, node=4
submitter=10, tid=4756, file=/dev/ng10n1, node=4
submitter=12, tid=4758, file=/dev/ng12n1, node=10
submitter=11, tid=4757, file=/dev/ng11n1, node=4
submitter=13, tid=4759, file=/dev/ng13n1, node=10
[...]

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agoMerge branch 'fix/howto-spelling' of https://github.com/scop/fio
Jens Axboe [Sat, 3 Sep 2022 14:49:37 +0000 (08:49 -0600)]
Merge branch 'fix/howto-spelling' of https://github.com/scop/fio

* 'fix/howto-spelling' of https://github.com/scop/fio:
  HOWTO: spelling fixes

19 months agoMerge branch 'doc/showcmd-usage' of https://github.com/scop/fio
Jens Axboe [Sat, 3 Sep 2022 14:49:16 +0000 (08:49 -0600)]
Merge branch 'doc/showcmd-usage' of https://github.com/scop/fio

* 'doc/showcmd-usage' of https://github.com/scop/fio:
  doc: fix --showcmd usage

19 months agoMerge branch 'fix/help-terse-version-5' of https://github.com/scop/fio
Jens Axboe [Sat, 3 Sep 2022 14:48:45 +0000 (08:48 -0600)]
Merge branch 'fix/help-terse-version-5' of https://github.com/scop/fio

* 'fix/help-terse-version-5' of https://github.com/scop/fio:
  init: include 5 in --terse-version help

19 months agodoc: fix --showcmd usage
Ville Skyttä [Sat, 3 Sep 2022 06:12:55 +0000 (09:12 +0300)]
doc: fix --showcmd usage

It does not take an argument, but operates on the job files and other
arguments given on the command line.

Thanks-to: Koichi Murase <myoga.murase@gmail.com>
Signed-off-by: Ville Skyttä <ville.skytta@upcloud.com>
19 months agoHOWTO: spelling fixes
Ville Skyttä [Sat, 3 Sep 2022 05:54:03 +0000 (08:54 +0300)]
HOWTO: spelling fixes

Signed-off-by: Ville Skyttä <ville.skytta@upcloud.com>
19 months agoinit: include 5 in --terse-version help
Ville Skyttä [Sat, 3 Sep 2022 05:49:16 +0000 (08:49 +0300)]
init: include 5 in --terse-version help

Thanks-to: Koichi Murase <myoga.murase@gmail.com>
Signed-off-by: Ville Skyttä <ville.skytta@upcloud.com>
19 months agoMerge branch 'fiopr_windows_log_compression_storage_fixes' of https://github.com...
Jens Axboe [Fri, 2 Sep 2022 23:29:45 +0000 (17:29 -0600)]
Merge branch 'fiopr_windows_log_compression_storage_fixes' of https://github.com/PCPartPicker/fio

* 'fiopr_windows_log_compression_storage_fixes' of https://github.com/PCPartPicker/fio:
  Fix log compression storage on windows

19 months agoFix log compression storage on windows
aggieNick02 [Fri, 2 Sep 2022 23:19:43 +0000 (18:19 -0500)]
Fix log compression storage on windows

Set the file open mode to be binary instead of text when dealing with
compressed log files. This fixes log compression storage not working on
windows, and lets the test added in PR
https://github.com/axboe/fio/pull/1458
pass on windows.

Signed-off-by: Nick Neumann <nick@pcpartpicker.com>
19 months agoMerge branch 'fiopr_compressfixes' of https://github.com/PCPartPicker/fio
Jens Axboe [Thu, 1 Sep 2022 18:03:23 +0000 (12:03 -0600)]
Merge branch 'fiopr_compressfixes' of https://github.com/PCPartPicker/fio

* 'fiopr_compressfixes' of https://github.com/PCPartPicker/fio:
  Fix fio silently dropping log entries when using log_compression

19 months agoFix fio silently dropping log entries when using log_compression
aggieNick02 [Thu, 1 Sep 2022 17:26:45 +0000 (12:26 -0500)]
Fix fio silently dropping log entries when using log_compression

This fixes issue 1457: https://github.com/axboe/fio/issues/1457

The fix is to just add a workqueue_flush to iolog_flush so that any log
chunks being compressed in the workqueue get flushed before we compress
and write the entries in the current active logs. Without this, log
entries in the workqueue can be omitted or be written out of order.

We also add a new test that ensures the log file has the right number of
entries in the correct order when using log_compression, both with and
without the store_log_compressed option.

There is still some cleanup to do with respect to the current
documentation and comments for the log_compression option, as it does
not affect the size of chunks, but instead is effectively a boolean that
controls whether chunks are compressed and removed. I'll leave that for
a separate PR.

Signed-off-by: Nick Neumann <nick@pcpartpicker.com>
19 months agot/io_uring: minor optimizations to IO init fast path
Jens Axboe [Thu, 1 Sep 2022 14:34:32 +0000 (08:34 -0600)]
t/io_uring: minor optimizations to IO init fast path

1) Only read SQ ring head at the start of prep, we don't need to read
   it at every iteration.
2) Initialize SQ ring index at init time, rather than in the fast path.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agot/io_uring: take advantage of new io_uring setup flags
Jens Axboe [Thu, 1 Sep 2022 00:44:52 +0000 (18:44 -0600)]
t/io_uring: take advantage of new io_uring setup flags

Set COOP_TASKRUN, SINGLE_ISSUER, and DEFER_TASKRUN if they are available
on the host.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agot/io_uring: unify getting of the offset
Jens Axboe [Thu, 1 Sep 2022 00:40:14 +0000 (18:40 -0600)]
t/io_uring: unify getting of the offset

Move it into a helper, and use it from all three methods. This also fixes
an issue with the aio method not honoring random IO or not.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agoengines/io_uring: set single issuer and defer taskrun
Jens Axboe [Wed, 31 Aug 2022 20:14:29 +0000 (14:14 -0600)]
engines/io_uring: set single issuer and defer taskrun

If available, set these two flags as well. SINGLE_ISSUER tells the kernel
that it can expect that it's just a single task issuing requests, and
DEFER_TASKRUN tells the kernel that we're fine with deferring task_work
runs until we reap events.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agoengines/io_uring: set COOP_TASKRUN for ring setup
Jens Axboe [Wed, 31 Aug 2022 19:45:32 +0000 (13:45 -0600)]
engines/io_uring: set COOP_TASKRUN for ring setup

If available, this will generally improve performance quite a bit.
Fio can easily use it, we just need to set the flag.
IORING_SETUP_COOP_TASKRUN tells the kernel that the application doesn't
need to get rescheduled to handle task_work, it's fine to defer this
to when we transition anyway.

For a QD=8 random read workload, this increases performance from
680K to 870K IOPS.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Wed, 31 Aug 2022 00:19:30 +0000 (18:19 -0600)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Merge os-android.h into os-linux.h
  Split os-android.h
  Linux: Use the byte order functions from <asm/byteorder.h>
  Remove two casts from os-linux.h

19 months agoMerge os-android.h into os-linux.h
Bart Van Assche [Wed, 24 Aug 2022 22:05:42 +0000 (15:05 -0700)]
Merge os-android.h into os-linux.h

Reduce code duplication by merging the os-android.h and os-linux.h
header files. The only functional change in this patch is that
FIO_HAVE_SGIO is now defined in the Android build and hence that the sg
I/O engine is enabled for Android.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
19 months agoSplit os-android.h
Bart Van Assche [Wed, 24 Aug 2022 21:55:51 +0000 (14:55 -0700)]
Split os-android.h

Move the shared memory emulation into a new header file in preparation
of merging the Linux and Android operating system header files.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
19 months agoLinux: Use the byte order functions from <asm/byteorder.h>
Bart Van Assche [Wed, 24 Aug 2022 22:05:32 +0000 (15:05 -0700)]
Linux: Use the byte order functions from <asm/byteorder.h>

Prepare for the unification of the Linux and Android header files by
switching to the <asm/byteorder.h> functions for Linux.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
19 months agoRemove two casts from os-linux.h
Bart Van Assche [Wed, 24 Aug 2022 21:54:39 +0000 (14:54 -0700)]
Remove two casts from os-linux.h

This patch prepares for merging the os-linux.h and os-android.h header files.
While CPU_CLR() and CPU_SET() are defined as statement expressions in
the Linux header files, these macros have been defined as statements in
the Android header files. Remove the '(void)' casts to prevent the
introduction of a build error when merging the Linux and Android header
files.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
19 months agoFio 3.32 fio-3.32
Jens Axboe [Tue, 30 Aug 2022 16:51:13 +0000 (10:51 -0600)]
Fio 3.32

Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agobackend: revert bad memory leak fix
Jens Axboe [Tue, 30 Aug 2022 16:48:18 +0000 (10:48 -0600)]
backend: revert bad memory leak fix

This essentially reverts the commit mentioned in the fixes line, as it
causes crashes with using a trigger timeout + command.

Fixes: 807473c36e10 ("fixed memory leak detected by ASAN")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 months agotest: add tests for lfsr and norandommap
Vincent Fu [Tue, 30 Aug 2022 13:59:55 +0000 (09:59 -0400)]
test: add tests for lfsr and norandommap

t0021 checks whether the lfsr random generator actually touches every
offset.

t0022 checks whether fio touches offsets more than once when
norandommap=1.

We should have automated tests for basic functionality to detect
problems early.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
19 months agotest: get 32-bit Ubuntu 22.04 build working
Vincent Fu [Mon, 29 Aug 2022 19:15:56 +0000 (15:15 -0400)]
test: get 32-bit Ubuntu 22.04 build working

Ubuntu 22.04 no longer has i386 builds for the packages libibverbs and
librdmacm. So stop trying to install those packages for the 32-bit
build.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
19 months agotest: use Ubuntu 22.04 for 64-bit tests
Vincent Fu [Mon, 29 Aug 2022 18:24:16 +0000 (14:24 -0400)]
test: use Ubuntu 22.04 for 64-bit tests

On 22.04 there was a conflict among libunwind-14-dev, libunwind-dev, and
libunwind8 that was resolved by removing libunwind-14-dev.

The 32-bit Ubuntu setup steps require more attention to get them to work
on 22.04. Stay on 20.04 for now and figure it out later.

Starting pkgProblemResolver with broken count: 1
Starting 2 pkgProblemResolver with broken count: 1
Investigating (0) libunwind-14-dev:amd64 < 1:14.0.0-1ubuntu1 @ii K Ib >
Broken libunwind-14-dev:amd64 Breaks on libunwind-dev:amd64 < none -> 1.3.2-2build2 @un puN >
  Considering libunwind-dev:amd64 -1 as a solution to libunwind-14-dev:amd64 2
Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libunwind-14-dev : Breaks: libunwind-dev but 1.3.2-2build2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
19 months agotest: add some tests for seq and rand offsets
Vincent Fu [Mon, 29 Aug 2022 15:30:30 +0000 (11:30 -0400)]
test: add some tests for seq and rand offsets

t/jobs/t0019.fio is a seq read test
t/jobs/t0020.fio is a rand read test

We don't have any automated tests which make sure that sequential access
patterns are actually sequential and that random access patterns are not
sequential. Add these two tests to help detect the possibility that
these features could break.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
20 months agot/io_uring: remove duplicate definition of gettid()
Jens Axboe [Fri, 26 Aug 2022 20:14:44 +0000 (14:14 -0600)]
t/io_uring: remove duplicate definition of gettid()

With a recent change, we now include os.h through nvme.h, and this
can cause a duplicate gettid() definition:

t/io_uring.c:499:12: error: redefinition of ‘gettid’
 static int gettid(void)
            ^~~~~~
In file included from t/../engines/../os/os.h:39,
                 from t/../engines/../thread_options.h:5,
                 from t/../engines/../fio.h:18,
                 from t/../engines/nvme.h:10,
                 from t/io_uring.c:38:
t/../engines/../os/os-linux.h:147:19: note: previous definition of
‘gettid’ was here
 static inline int gettid(void)
                   ^~~~~~

Include os.h directly to make it clear that we use it, and remove the
gettid() definition from io_uring.c.

Reported-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
20 months agotest: add basic test for io_uring ioengine
Vincent Fu [Thu, 25 Aug 2022 19:08:33 +0000 (12:08 -0700)]
test: add basic test for io_uring ioengine

We should have a quick smoke test for the io_uring ioengine to
automatically detect breakage.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
20 months agot/io_uring: fix 64-bit cast on 32-bit archs
Jens Axboe [Fri, 26 Aug 2022 13:52:54 +0000 (07:52 -0600)]
t/io_uring: fix 64-bit cast on 32-bit archs

gcc complains that:

t/io_uring.c: In function ‘init_io_pt’:
t/io_uring.c:618:52: error: left shift count >= width of type [-Werror=shift-count-overflow]
  618 |   sqe->user_data |= ((unsigned long)s->clock_index << 32);
      |                                                    ^~

we're shifting more than the size of the type. Cast to a 64-bit value
so that it'll work on 32-bit as well.

Fixes: 7d04588a7663 ("t/io_uring: add support for async-passthru")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
20 months agot/io_uring: add support for async-passthru
Anuj Gupta [Fri, 26 Aug 2022 11:33:06 +0000 (17:03 +0530)]
t/io_uring: add support for async-passthru

This patch adds support for async-passthru in t/io_uring. User needs to
specify -u1 option in the command

Example commandline:
t/io_uring -b512 -d128 -c32 -s32 -p0 -F1 -B0 -O0 -n1 -u1 /dev/ng0n1

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Link: https://lore.kernel.org/r/20220826113306.4139-3-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
20 months agot/io_uring: prep for including engines/nvme.h in t/io_uring
Anuj Gupta [Fri, 26 Aug 2022 11:33:05 +0000 (17:03 +0530)]
t/io_uring: prep for including engines/nvme.h in t/io_uring

Change page_size and cal_clat_percentiles name to something different
as these are indirectly picked from engines/nvme.h (fio.h and stat.h)

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Link: https://lore.kernel.org/r/20220826113306.4139-2-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
20 months agoengines/io_uring: delete debug code
Jens Axboe [Thu, 25 Aug 2022 17:19:34 +0000 (11:19 -0600)]
engines/io_uring: delete debug code

This was inadvertently introduced by a previous commit, get rid
of it.

Fixes: 1816895b788e ("engines/io_uring: pass back correct error value when interrupted")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
20 months agoMerge branch 'master' of https://github.com/kraj/fio
Jens Axboe [Thu, 25 Aug 2022 02:09:29 +0000 (20:09 -0600)]
Merge branch 'master' of https://github.com/kraj/fio

* 'master' of https://github.com/kraj/fio:
  io_uring: Replace pthread_self with s->tid

20 months agoio_uring: Replace pthread_self with s->tid
Khem Raj [Thu, 25 Aug 2022 01:08:53 +0000 (18:08 -0700)]
io_uring: Replace pthread_self with s->tid

__init_rand64 takes 64bit value and srand48 takes unsigned 32bit value,
pthread_t is opaque type and some libcs ( e.g. musl ) do not define them
in plain old data types and ends up with errors

| t/io_uring.c:809:32: error: incompatible pointer to integer conversion passing 'pthread_t' (aka 'struct __pthread *') to parameter of type 'uint64_t' (aka 'unsigned long') [-Wint-conver
sion]
|         __init_rand64(&s->rand_state, pthread_self());
|                                       ^~~~~~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 months agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Wed, 24 Aug 2022 21:52:34 +0000 (15:52 -0600)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Enable CPU affinity support on Android

20 months agoEnable CPU affinity support on Android
Bart Van Assche [Wed, 24 Aug 2022 20:42:29 +0000 (13:42 -0700)]
Enable CPU affinity support on Android

This patch enables the --cpumask=, --cpus_allowed= and
--cpus_allowed_policy= fio options.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
20 months agoengines/io_uring: pass back correct error value when interrupted
Jens Axboe [Wed, 24 Aug 2022 18:01:39 +0000 (12:01 -0600)]
engines/io_uring: pass back correct error value when interrupted

Running with an io_uring engine and using a USR1 signal to show
current status will end up terminating the job with:

fio: pid=91726, err=-4/file:ioengines.c:320, func=get_events, error=Unknown error -4
sfx: (groupid=0, jobs=1): err=-4 (file:ioengines.c:320, func=get_events, error=Unknown error -4): pid=91726: Wed Aug 24 11:59:51 2022

Ensure that the return value is set correctly based on the errno.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
20 months agoMerge branch 'sigbreak-wait' of github.com:bjpaupor/fio
Vincent Fu [Tue, 23 Aug 2022 21:09:25 +0000 (17:09 -0400)]
Merge branch 'sigbreak-wait' of github.com:bjpaupor/fio

* 'sigbreak-wait' of github.com:bjpaupor/fio:
  Add wait for handling SIGBREAK

20 months agoRevert "Fix multithread issues when operating on a single shared file"
Vincent Fu [Tue, 23 Aug 2022 16:38:51 +0000 (12:38 -0400)]
Revert "Fix multithread issues when operating on a single shared file"

This reverts commit acbda87c34c743ff2d9e125d9539bcfbbf49eb75.

This commit introduced a lot of unintended consequences for
create_serialize=0. The aim of the commit can be accomplished with a
combination of filesize and io_size.

Fixes: https://github.com/axboe/fio/issues/1442
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>