fio.git
4 months agoclient: separate global options from multiple servers
Vincent Fu [Tue, 7 Jan 2025 21:29:36 +0000 (21:29 +0000)]
client: separate global options from multiple servers

In a single client invocation, currently all global options from all
servers accumulate in a single global options dictionary. This is fine
if the invocation creates only a single server session, but when a
client connects to multiple servers, this is a mess because there is no
way to assign different global options to different jobs.

This patch instead creates a global options array when a client creates
multiple server sessions. Each array element contains the global options
for a different server session and is identified by the hostname and
port. When the client connects to only a single server, the global
options object remains a dictionary in order to maintain backward
compatibility.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
4 months agojson: allow empty string values
Vincent Fu [Tue, 7 Jan 2025 20:56:19 +0000 (20:56 +0000)]
json: allow empty string values

The JSON standard permits empty strings. Currently fio's JSON module
returns an error when it encounters an empty string. Change this to
allow empty strings.

https://www.json.org/ is the reference I used for the JSON standard.

This is needed for upcoming patches to support FIO_OPT_STR_SET job
options (norandommap, time_based, etc) that are enabled when the option
is included without specifying a value for it. The value for these
options is best represented by an empty string. Disallowing empty string
values would prevent these options from appearing in job option
dictionaries in the JSON output.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
4 months agoclient: rename job_opt_object to global_opt_object
Vincent Fu [Fri, 3 Jan 2025 19:33:37 +0000 (19:33 +0000)]
client: rename job_opt_object to global_opt_object

This structure contains only options from the global section of a job
file, so make the name reflect this in order to make the code clearer.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
4 months agot/zbd: add test case to confirm no max_open_zones limit check
Shin'ichiro Kawasaki [Wed, 22 Jan 2025 01:38:35 +0000 (10:38 +0900)]
t/zbd: add test case to confirm no max_open_zones limit check

The previous commit fixed the max_open_zones limit check for non-write
jobs. Add a test case to confirm the fix.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20250122013835.1223725-3-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincentfu@gmail.com>
4 months agozbd: do not check open zones status and limits when jobs do not write
Shin'ichiro Kawasaki [Wed, 22 Jan 2025 01:38:34 +0000 (10:38 +0900)]
zbd: do not check open zones status and limits when jobs do not write

Currently, fio checks the conditions of each zone within the IO range at
the job start. If a zone is in an open condition, it is added to the
write target zone array. If the number of write target zones exceeds the
max_open_zones or job_max_open_zones limit, fio terminates with the
error message "Number of open zones exceeds max_open_zones limit". This
check for zone condition and the resulting termination occur even when
the job does not perform a write operation, leading to confusion among
users.

To avoid the confusion, skip the check when jobs do not perform write
operations. Additionally, print the message to inform that the
job_max_open_zones limit does not work for non-write jobs.

Fixes: 954217b90191 ("zbd: Initialize open zones list referring zone status at fio start")
Fixes: 8ac768899d63 ("zbd: do not reset extra zones in open conditions")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20250122013835.1223725-2-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincentfu@gmail.com>
4 months agoMerge branch 'pre_success' of https://github.com/kawasaki/fio
Vincent Fu [Tue, 21 Jan 2025 16:38:18 +0000 (11:38 -0500)]
Merge branch 'pre_success' of https://github.com/kawasaki/fio

* 'pre_success' of https://github.com/kawasaki/fio:
  t/run-fio-tests: remove redundant pre_success lines

4 months agot/run-fio-tests: remove redundant pre_success lines
Shin'ichiro Kawasaki [Fri, 17 Jan 2025 13:01:39 +0000 (22:01 +0900)]
t/run-fio-tests: remove redundant pre_success lines

Recently, three test case definitions were added to t/run-fio-tests. The
added definitions have redundant pre_success lines. Remove them.

Fixes: 8b0018e93eac ("t/jobs/t0033: add test for the log file format")
Fixes: 20d0ba84d3b7 ("t/jobs/t0034: add test for the log_issue_time option")
Fixes: a189fc720a4d ("t/jobs/t0035: add test for the file operations IO engine")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
5 months agoMerge branch 'master' of https://github.com/termim/fio
Vincent Fu [Mon, 16 Dec 2024 18:23:58 +0000 (13:23 -0500)]
Merge branch 'master' of https://github.com/termim/fio

* 'master' of https://github.com/termim/fio:
  Add .readthedocs.yaml file.

5 months agoAdd .readthedocs.yaml file.
Mikhail Terekhov [Sun, 17 Dec 2023 20:59:52 +0000 (15:59 -0500)]
Add .readthedocs.yaml file.

Now to create documentation on readthedocs.org the project must have
a configuration file.

Signed-off-by: Mikhail Terekhov <termim@gmail.com>
6 months agonfs: add support for new libnfs API
Ronnie Sahlberg [Mon, 9 Dec 2024 05:47:58 +0000 (15:47 +1000)]
nfs: add support for new libnfs API

New update of libnfs will have a new API that changes some signatures,
primarily in order to make nfs_[p]read[_async] calls
zero-copy in the sense that (almost) no data copy is done in the library
and READ3/READ4 payloads are read straigth from the socket into the
application buffer.

In-library zero-copy only works for !krb5 and !tls sessions but can provide
significant boost for read-intensive workloads when can be used.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Link: https://lore.kernel.org/r/20241209054758.3269700-1-ronniesahlberg@gmail.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
6 months agostat: fix unified_rw_reporting=both BW and IOPS
Vincent Fu [Wed, 4 Dec 2024 19:00:53 +0000 (19:00 +0000)]
stat: fix unified_rw_reporting=both BW and IOPS

When unified_rw_reporting=both, the value for the significant_figures
option is not populated in the struct thread_stat containing the mixed
r/w/t data. Thus, when bandwidth and IOPS numerical values are converted
to strings, they are converted to "0".

This patch populates the significant figures member of struct
thread_stat for the mixed r/w/t data.

Fixes: https://github.com/axboe/fio/issues/1844
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
6 months agodocs: explain type of memory allocated by md_per_io_size
Vincent Fu [Fri, 22 Nov 2024 18:57:56 +0000 (18:57 +0000)]
docs: explain type of memory allocated by md_per_io_size

Note that md_per_io_size always uses malloc for io_uring_cmd.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
6 months agoengines/io_uring_cmd: disable iomem=malloc check for metadata
Vincent Fu [Fri, 22 Nov 2024 16:29:05 +0000 (16:29 +0000)]
engines/io_uring_cmd: disable iomem=malloc check for metadata

Before this patch, the io_uring_cmd ioengine would check that
iomem=malloc (the default) before allocating memory for metadata
buffers. If the user had selected a different option, fio would abort
the job with an error message.

This patch removes this check. We do not need to restrict users to
iomem=malloc for io_uring_cmd workloads involving protection
information. Users may wish to use huge pages for LBA data in order to
submit larger IOs. Since metadata buffers will be smaller they can still
use regular pages.

Reported-by: 전규범 <gyubeom.jeon@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
7 months agot/io_uring: fix size confusion in allocate_mem()
Jens Axboe [Tue, 5 Nov 2024 14:57:41 +0000 (07:57 -0700)]
t/io_uring: fix size confusion in allocate_mem()

It should always be using the size passed in as to what amount of memory
should be allocated, not the individual IO size. This didn't matter
previously, as each buffer was allocated independently, but it matters
now where a single region will cover all IO buffers.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 months agoMerge branch 'io_uring-depth'
Jens Axboe [Tue, 5 Nov 2024 14:51:05 +0000 (07:51 -0700)]
Merge branch 'io_uring-depth'

* io_uring-depth:
  engines/io_uring: don't mess with non power-of-2 queue depth

7 months agot/io_uring: add symbolic defines for NOP flags
Jens Axboe [Mon, 4 Nov 2024 17:27:06 +0000 (10:27 -0700)]
t/io_uring: add symbolic defines for NOP flags

Add them to io_uring.h and use them in t/io_uring.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 months agot/io_uring: enable registered file/buffer testing with NOP
Jens Axboe [Mon, 4 Nov 2024 17:23:47 +0000 (10:23 -0700)]
t/io_uring: enable registered file/buffer testing with NOP

Enable the -N NOP mode to use registered files and buffers, handy for
testing the kernel side.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 months agot/io_uring: register single buffer for whole IO region
Jens Axboe [Mon, 4 Nov 2024 17:20:56 +0000 (10:20 -0700)]
t/io_uring: register single buffer for whole IO region

Rather than register N buffers for depth of N, just allocate a single
contig region and register that as a single buffer. That's more
efficient on the kernel side, as only a single resource need to be
managed.

Should have no functional changes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 months agoengines/io_uring_cmd: do not send data buffer for write zeroes
Vincent Fu [Fri, 11 Oct 2024 22:01:26 +0000 (22:01 +0000)]
engines/io_uring_cmd: do not send data buffer for write zeroes

For write zeroes commands, do not send a data bufffer address. If we do
send an address, the driver will try to carry out DMA mapping and
encounter driver mdts limitations which do not apply to write zeroes
commands. This lets us send large write zeroes commands to deallocate
the device with the deac=1.

This is only done for the non-vectored IO case. For the vectored IO
case, the driver requires data buffer addresses to be sent. Regardless
it does not make sense to use vectored IO for write zeroes.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
7 months agoengines/io_uring_cmd: add option to set DEAC bit for write zeroes
Vincent Fu [Thu, 10 Oct 2024 17:31:51 +0000 (17:31 +0000)]
engines/io_uring_cmd: add option to set DEAC bit for write zeroes

Add an option for fio to set the DEAC bit for write zeroes commands.
This instructs the device to also deallocate the specified logical
blocks in the course of completing the write zeroes operation. This only
has an effect when write_mode=zeroes is specified.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
7 months agoci: always update apt cache before installing pkgs
Vincent Fu [Tue, 15 Oct 2024 15:21:49 +0000 (11:21 -0400)]
ci: always update apt cache before installing pkgs

For all of our custom local actions make sure we update the apt cache
before trying to install packages. This will prevent errors when the
runner is started with a stale apt cache.

Example: https://github.com/vincentkfu/fio/actions/runs/11339008514/job/31533113877

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
7 months agoengines/io_uring: don't mess with non power-of-2 queue depth io_uring-depth
Jens Axboe [Mon, 14 Oct 2024 16:00:36 +0000 (10:00 -0600)]
engines/io_uring: don't mess with non power-of-2 queue depth

io_uring needs the rings to be a power-of-2 in sizing, but it does not
need to be messing with the queue depth driven to the device. Rather
than round everything up, only round up the API parts.

Reported-by: Riley Thomasson <riley@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agodocs: mention unsupported configuration
Vincent Fu [Thu, 3 Oct 2024 20:00:12 +0000 (20:00 +0000)]
docs: mention unsupported configuration

It does not make sense when group_reporting is used for the constituent
jobs to have different values for options like unified_rw_reporting,
?lat_percentiles, etc. Mention that configurations with different values
for these parameters are unsupported.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoclient/server: enable "All clients" latency percentiles
Vincent Fu [Thu, 3 Oct 2024 19:25:33 +0000 (19:25 +0000)]
client/server: enable "All clients" latency percentiles

The ?lat_percentile toggles and list of percentiles to report from the
thread_stat payload have not been propagated to the overall summary
report. Enable "All clients" latency percentile reporting by arbitrarily
using the toggles and percentile list from the first thread_stat
payload sent from the server.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agodocs: addtions to client/server section
Vincent Fu [Wed, 2 Oct 2024 18:47:09 +0000 (14:47 -0400)]
docs: addtions to client/server section

Mention the unique_filename option in the client/server section and also
note that fio will produce aggregate summary output for all jobs when
running jobs on multiple servers.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoci/qemu: use a tarball to xfer source code to guest
Vincent Fu [Fri, 27 Sep 2024 20:37:31 +0000 (20:37 +0000)]
ci/qemu: use a tarball to xfer source code to guest

Instead of faking a GitHub Actions runner environment, just create a
source code tarball and transfer it to the guest VM. This is simpler and
does not depend on the continued existence of the action used
previously.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoFio 3.38 fio-3.38
Jens Axboe [Wed, 2 Oct 2024 18:53:13 +0000 (12:53 -0600)]
Fio 3.38

Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoengines/io_uring: add support for async TRIM
Jens Axboe [Mon, 30 Sep 2024 15:42:22 +0000 (09:42 -0600)]
engines/io_uring: add support for async TRIM

6.12 kernels and newer support async trim, which means the non-cmd path
no longer needs to quiesce the queue and issue a sync trim for a workload
that includes trim/discard requests.

The engine will assume the support is there, and if it gets -EINVAL when
trying an async trim, then it'll punt back to the using the sync trim
again.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agot/io_uring: only load tail once per reap loop
Jens Axboe [Mon, 30 Sep 2024 15:21:17 +0000 (09:21 -0600)]
t/io_uring: only load tail once per reap loop

It'll never change with the settings that t/io_uring uses to setup the
ring - and even if it could, it's still cheaper to just read the tail
once per reap.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoci/qemu: change the name of this workflow
Vincent Fu [Fri, 27 Sep 2024 19:27:28 +0000 (19:27 +0000)]
ci/qemu: change the name of this workflow

Reduce confusion by giving the guest VM workflow a name different from
our run-fio-tests.py workflow.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoci: allow GitHub Actions workflows to be manually triggered
Vincent Fu [Fri, 27 Sep 2024 19:24:08 +0000 (19:24 +0000)]
ci: allow GitHub Actions workflows to be manually triggered

This patch adds a 'workflow_dispatch' trigger to our three GitHub
Actions workflows. This allows us to trigger each workflow by navigating
to the repository's Actions tab, selecting the desired workflow, and
clicking on th 'Run workflow' button.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoengines/io_uring: Fix negative errno in io_u->error
Minwoo Im [Fri, 27 Sep 2024 03:08:57 +0000 (12:08 +0900)]
engines/io_uring: Fix negative errno in io_u->error

io_u->error can have either negative errno value or device-specific
error status as a positive value.  fio always tries to parse the errno
with strerrno() and it expects the value to be a positive one.

Commit ebe67b667f25 ("io_uring: Add IO_U_F_DEVICE_ERRROR to identify
error types") tried to abs(io_u->error) to convert it first.  And it
caused the following build warning:

  engines/io_uring.c:553:16: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
          io_u->error = abs(io_u->error);
                        ^
  engines/io_uring.c:553:16: note: remove the call to 'abs' since unsigned values cannot be negative
          io_u->error = abs(io_u->error);
                        ^~~

Commit 9eaa8e7c8e0b ("engines/io_uring: don't use abs() on an unsigned
value") tried to remove the warning by removing abs() on io_u->error,
but if so, negative errno (e.g., -EINVAL) can't be parsed properly like:

  fio: io_u error on file /dev/ng0n1: Unknown error -22: write offset=429916160, buflen=1048576

This patch fixed this fixed to convert to positive value properly by
casting it first to int and then do abs() on it.

Fixes: 9eaa8e7c8e0b ("engines/io_uring: don't use abs() on an unsigned value")

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Link: https://lore.kernel.org/r/20240927030857.17001-1-minwoo.im.dev@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoHOWTO: update 'verify_mode' for io_uring_cmd
Minwoo Im [Thu, 26 Sep 2024 22:54:11 +0000 (07:54 +0900)]
HOWTO: update 'verify_mode' for io_uring_cmd

'verify_mode' option has been added by Commit 6170d92a61da
("io_uring: Support Compare command for verification").  Added
description for this option.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Link: https://lore.kernel.org/r/20240926225411.13754-1-minwoo.im.dev@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoengines/io_uring: don't use abs() on an unsigned value
Jens Axboe [Thu, 26 Sep 2024 21:04:35 +0000 (15:04 -0600)]
engines/io_uring: don't use abs() on an unsigned value

It doesn't make any sense, for obvious reasons.

Fixes: ebe67b667f25 ("io_uring: Add IO_U_F_DEVICE_ERROR to identify error types")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoMerge branch 'master' of https://github.com/HuangShumin/fio
Vincent Fu [Thu, 26 Sep 2024 18:47:45 +0000 (14:47 -0400)]
Merge branch 'master' of https://github.com/HuangShumin/fio

* 'master' of https://github.com/HuangShumin/fio:
  Fix configure with --build-static which enables static RDMA in #1801

8 months agoci/cifuzz: update to upload-artifacts@v4
Vincent Fu [Thu, 26 Sep 2024 18:43:48 +0000 (14:43 -0400)]
ci/cifuzz: update to upload-artifacts@v4

upload-artifacts v1 is now deprecated. Switch to a maintained version.

We may also consider just getting rid of this workflow as it's not clear
that it has ever found any issue or if anyone looks at the output.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoio_uring: Support Compare command for verification
Minwoo Im [Thu, 26 Sep 2024 01:08:02 +0000 (10:08 +0900)]
io_uring: Support Compare command for verification

Added 'verify_mode' option to io_uring_cmd with --cmd_type=nvme to
support data compare verification with Compare commands rather than Read
commands.  This patch newly added IO_U_F_VER_IN_DEV io_u flag to
represent that verification should be done in device side, not the host
side to skip the actual verification phase in verify_io_u().

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Link: https://lore.kernel.org/r/20240926010802.27131-1-minwoo.im.dev@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoio_uring: Add IO_U_F_DEVICE_ERROR to identify error types
Minwoo Im [Thu, 26 Sep 2024 00:41:34 +0000 (09:41 +0900)]
io_uring: Add IO_U_F_DEVICE_ERROR to identify error types

__io_u_log_error expects a positive value of io_u->error parsing it with
strerror() expecting it to be an errno.  io_uring_cmd (cmd_type=nvme),
for example, has returned errno value as a positive value and
device-specific CQE status type and code as well.

Commit 78831c6b35c5 ("io_uring: Fix the flip to negative of CQE status")
has put the abs() to the cqe->res, and it caused confusions between the
actual CQE stauts and the system error value (errno).  Now we have
Commit 2a13699a89dc ("io_uring: Add .errdetails to parse CQ status"),
meaning that io_uring_cmd ioengines will parse the actual value of
io_u->error value as CQE status value, so we should know if the value is
for CQE status or errno.

This patch added a flag IO_U_F_DEVICE_ERROR to io_u to represent if
io_u->error has device-specific error value, otherwise it's errno.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Link: https://lore.kernel.org/r/20240926004134.26004-1-minwoo.im.dev@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoci: build and run a QEMU guest VM for testing
Vincent Fu [Fri, 6 Sep 2024 18:52:01 +0000 (18:52 +0000)]
ci: build and run a QEMU guest VM for testing

Since GitHub Actions' free runners now support nested virtualization,
let's create a guest VM image and use it to run some tests that cannot
be run directly via a GitHub Actions runner (because these runners do
not allow insertion of kernel modules).

This patch adds a workflow that runs nightly and:
- creates a Debian guest VM image using libguestfs
- builds QEMU
- starts the VM
- clones/builds fio on the VM
- runs the test

Separate instances of the job are spawned to run the following tests:
- basic io_uring_cmd
- NVMe protection information w/16-bit Guard PI
- NVMe PI 4096+16 w/64-bit Guard PI
- NVMe PI 4096+64 w/64-bit Guard PI
- FDP
- t/zbd/run-tests-against-nullb

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoci: handle sudo in actions-install.sh
Vincent Fu [Mon, 23 Sep 2024 16:41:35 +0000 (16:41 +0000)]
ci: handle sudo in actions-install.sh

We run our tests as root in containers and VMs. Those platforms do not
have sudo. Use a small bash function to eliminate the need to install
sudo at the very beginning of the dependency installation script.

This function just checks for the existence of sudo and uses it when
installed but does nothing when it is not installed. With this function
we can just add sudo to the list of packages to install like all the
other packages. We may still need sudo in one of our test scripts.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoci: only remove libunwind-14-dev if installed
Vincent Fu [Mon, 23 Sep 2024 16:50:31 +0000 (16:50 +0000)]
ci: only remove libunwind-14-dev if installed

Some containers no longer have libunwind-14-dev in their repositories.
Remove this package only if it is installed.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoci: remove unneeded packages
Vincent Fu [Fri, 20 Sep 2024 21:57:57 +0000 (21:57 +0000)]
ci: remove unneeded packages

We no longer need unzip, cmake, and wget because we no longer build
librpma. Stop installing these three packages.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
8 months agoFix configure with --build-static which enables static RDMA in #1801
HuangShumin [Tue, 24 Sep 2024 00:54:22 +0000 (08:54 +0800)]
Fix configure with --build-static which enables static RDMA in #1801

Fix configure with --build-static option which enables static RDMA in Issue #1801

This pull request to probe static libibverbs/librdmacm library. It's neccessary to enable static RDMA engine build with netlink libnl-3 and libnl-route-3.

Signed-off-by: Huang Shumin longway68@qq.com
8 months agoMerge branch 'atomic-writes'
Jens Axboe [Tue, 17 Sep 2024 02:23:06 +0000 (20:23 -0600)]
Merge branch 'atomic-writes'

Merge the atomc write support.

* atomic-writes:
  examples: Add example for atomic write verify
  fio: Support verify_write_sequence
  doc: Document atomic command
  tools/fiograph: Update for atomic support
  io_uring: Support RWF_ATOMIC
  libaio: Support RWF_ATOMIC
  pvsync2: Support RWF_ATOMIC
  os: Reintroduce atomic write support
  os-linux: Define RWF_ATOMIC

8 months agoexamples: Add example for atomic write verify atomic-writes
John Garry [Mon, 16 Sep 2024 16:53:47 +0000 (16:53 +0000)]
examples: Add example for atomic write verify

Add an example for verifying atomic writes.

Until now, atomic writes are only supported on Linux for block devices, so
only give instructions on for that.

Currently support is being worked on for XFS and EXT4, and instructions can
be updated in due course.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-10-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agofio: Support verify_write_sequence
John Garry [Mon, 16 Sep 2024 16:53:46 +0000 (16:53 +0000)]
fio: Support verify_write_sequence

Add an option to disable verifying the write sequence number. By default,
it is enabled. However disable for verify_only mode.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-9-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agodoc: Document atomic command
John Garry [Mon, 16 Sep 2024 16:53:45 +0000 (16:53 +0000)]
doc: Document atomic command

Now that the atomic command is formally supported, document it.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-8-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agotools/fiograph: Update for atomic support
John Garry [Mon, 16 Sep 2024 16:53:44 +0000 (16:53 +0000)]
tools/fiograph: Update for atomic support

Add atomic support for the specific engines which support this option.

This just means that "atomic" will show up as a special iongeine config
option (if fio 'atomic' option is specified).

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-7-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoio_uring: Support RWF_ATOMIC
John Garry [Mon, 16 Sep 2024 16:53:43 +0000 (16:53 +0000)]
io_uring: Support RWF_ATOMIC

Set RWF_ATOMIC for writes and oatomic==1.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-6-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agolibaio: Support RWF_ATOMIC
John Garry [Mon, 16 Sep 2024 16:53:42 +0000 (16:53 +0000)]
libaio: Support RWF_ATOMIC

Set RWF_ATOMIC for writes and oatomic==1.

Guard setting RWF_ATOMIC by FIO_HAVE_RWF_ATOMIC, as only linux supports
RWF_ATOMIC.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-5-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agopvsync2: Support RWF_ATOMIC
Alan Adamson [Mon, 16 Sep 2024 16:53:41 +0000 (16:53 +0000)]
pvsync2: Support RWF_ATOMIC

Set RWF_ATOMIC for writes and atomic==1.

Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
jpg: Set FIO_ATOMICWRITES for pvsync2
Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-4-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoos: Reintroduce atomic write support
John Garry [Mon, 16 Sep 2024 16:53:40 +0000 (16:53 +0000)]
os: Reintroduce atomic write support

Previously O_ATOMIC support was added in commit d01612f3ae25 ("Add support
for O_ATOMIC"). But support was removed in commit a25ba6c64fe1 ("Get rid of
O_ATOMIC"), as support was never added in the Linux kernel.

Linux kernel 6.11 will add support for RWF_ATOMIC, which can be supported
for various ioengines. See latest man pages for details.

The plumbing was left in place for thread option oatomic, so that will be
reused.

Add a flag to say whether an engine supports atomic writes, and reject
when oatomic is set for an engine which does not support atomic writes.

This is a change in behaviour, as since commit a25ba6c64fe1 ("Get rid of
O_ATOMIC"), this oatomic has been ignored. However, it is better to tell
the user that their ioengine of choice does not support atomic writes.

Today RWF_ATOMIC is only supported for direct-IO. In future it may be
supported for buffered IO. As such, do not auto-set odirect=1 when
oatomic==1.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-3-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 months agoos-linux: Define RWF_ATOMIC
John Garry [Mon, 16 Sep 2024 16:53:39 +0000 (16:53 +0000)]
os-linux: Define RWF_ATOMIC

Add a definition of RWF_ATOMIC when not available from uapi headers.

RWF_ATOMIC is going to be part of Linux v6.11

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240916165347.2226763-2-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
9 months agoUpdate mailing list details in README.rst
Rebecca Cran [Fri, 6 Sep 2024 21:19:40 +0000 (15:19 -0600)]
Update mailing list details in README.rst

Majordomo commands are no longer used, so update README.rst with the new
method of subscribing to the mailing list.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Link: https://lore.kernel.org/r/20240906211941.850156-1-rebecca@bsdio.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
9 months agot/jobs/t0035: add test for the file operations IO engine
Shin'ichiro Kawasaki [Fri, 6 Sep 2024 02:37:17 +0000 (11:37 +0900)]
t/jobs/t0035: add test for the file operations IO engine

The previous commit fixed the NULL pointer dereference which happened
when the write_lat_log option is specified for the file operations IO
engine. Add a new test case to confirm the fix. This test case also
covers the basic use cases of the file operations IO engine.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240906023717.1464031-3-shinichiro.kawasaki@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
9 months agostat: fix the null io_u dereference in add_clat_sample()
Shin'ichiro Kawasaki [Fri, 6 Sep 2024 02:37:16 +0000 (11:37 +0900)]
stat: fix the null io_u dereference in add_clat_sample()

As recorded in the Link, NULL pointer dereference happens when the
write_lat_log option is specified for the file operations IO engine.
This failure was caused by the commit 14d3134a5fc0 ("introduce the
log_issue_time option") which added the new field 'issue_time' to the
struct log_sample. To calculate the issue time, add_clat_sample() was
modified to refer to io_u->issue_time. However, the file operations IO
engine passes NULL as the io_u pointer. Hence the failure.

Fix this by skipping the io_u->issue_time reference when io_u is NULL.
Instead, set 0 as the issue time.

Link: https://lore.kernel.org/fio/0e2c84c9-f9e4-4073-a075-016393ca7bde@gmail.com/
Fixes: 14d3134a5fc0 ("introduce the log_issue_time option")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240906023717.1464031-2-shinichiro.kawasaki@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
9 months agoiolog: add va_end on error
Vincent Fu [Thu, 5 Sep 2024 18:35:30 +0000 (14:35 -0400)]
iolog: add va_end on error

Call va_end when we encounter an error trying to print sample fields.

This was reported by Coverity:

** CID 509197:  API usage errors  (VARARGS)
/iolog.c: 1025 in print_sample_fields()
________________________________________________________________________________________________________
*** CID 509197:  API usage errors  (VARARGS)
/iolog.c: 1025 in print_sample_fields()
1019      int ret;
1020
1021      va_start(ap, fmt);
1022      ret = vsnprintf(*p, *left, fmt, ap);
1023      if (ret < 0 || ret >= *left) {
1024      log_err("sample file write failed: %d\n", ret);
>>>     CID 509197:  API usage errors  (VARARGS)
>>>     "va_end" was not called for "ap".
1025      return -1;
1026      }
1027      va_end(ap);
1028
1029      *p += ret;
1030      *left -= ret;

Fixes: 3ec6b6da ("iolog: refactor flush_samples()")
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agot/jobs/t0034: add test for the log_issue_time option
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:26 +0000 (17:58 +0900)]
t/jobs/t0034: add test for the log_issue_time option

Add a test to check the newly added option 'log_issue_time'. Generate
log files using the option and check that lines in the log files have
the format described in the "Log File Format" section in HOWTO.rst.

This test case has the logic same as t0033 except the log file names and
matching patterns. Factor out the logic to the new class
FioJobFileTest_LogFileFormat.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-10-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agot/jobs/t0033: add test for the log file format
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:25 +0000 (17:58 +0900)]
t/jobs/t0033: add test for the log file format

Add a test to check the log file format which is described in the "Log
File Format" section in HOWTO.rst. Generate log files using combination
of options relevant to log files, and check that lines in log files have
the format expected. This test helps to confirm that the changes in the
log file related functions do not cause regressions.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-9-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agodoc: describe the log_issue_time option
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:24 +0000 (17:58 +0900)]
doc: describe the log_issue_time option

The recent commit introduced the new option log_issue_time. Describe its
feature and restrictions.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-8-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agodoc: fix the descriptions of the log_prio option
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:23 +0000 (17:58 +0900)]
doc: fix the descriptions of the log_prio option

Commit 03ec570f6e57 ("fio: Introduce the log_prio option") added the
description of the log_prio option to fio.1. However, the description
was wrong. It mentioned that the log_prio option would change the number
of fields in the Log File Format, but actually it does not do so. Fix
the description.

Also, the commit did not update HOWTO.rst for the log_prio option. To
keep HOWTO.rst same as fio.1, add the missing descriptions to HOWTO.rst.

Fixes: 03ec570f6e57 ("fio: Introduce the log_prio option")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-7-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agointroduce the log_issue_time option
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:22 +0000 (17:58 +0900)]
introduce the log_issue_time option

When write_lat_log option is set, fio outputs the 'clat' completion
latency log file. This clat log can be used to analyze IO latency. This
file can also be considered as an IO trace file as each IO entry can
fully describe an IO when the --log_offset and --log_prio options are
also used.

However, using the clat log file as an IO trace is inaccuate due to two
reasons. Firstly, the time field of each entry uses millisecond units,
which is too coarse for fast IOs (e.g. when using SSDs). Secondly, the
time field value is recorded not at command completion, but at log
sample recording. The time field value is slightly different from the IO
completion time. It can be used only as an approximated completion time.

To analyze IO issue time and IO completion time accurately using the
clat log, introduce the new option 'log_issue_time'. When this option is
set, add another field to the log file entries and put the IO issue time
in nanosecond to the field. The IO completion time can be calculated by
adding the completion latency to the IO issue time.

The IO issue time field is added to 'slat' submit latency log file also.
This helps to calculate IO start time by subtracting the submission
latency from the IO issue time.

The log_issue_time option can be used for IO trace when the
write_lat_log option and the log_offset options are set together. When
the log_issue_time option is set but the write_lat_log option or the
log_offset option is not set, fio errors out. When the log_issue_time
option and the write_lat_log option are set together with other
write_X_log options, the IO issue time field is added to all log files.
As for the other log files than clat and slat log, the IO issue time
does not have meaning then '0' is set to the field. When log_avg_msec
option is set, average of the log values of the specified duration is
logged. The IO issue time does not have meaning in this case either and
'0' is set to the field.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-6-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agoiolog: drop struct io_sample_offset
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:21 +0000 (17:58 +0900)]
iolog: drop struct io_sample_offset

Fio uses the struct io_sample to log attributes of each IO. When the
log_offset option is set, fio uses the struct io_sample_offset instead
which has the additional field dedicated to the offset data. Fio chooses
one of these two structs by the log_offset option to minimize memory
usage for IO sampling. However, the dedicated struct io_sample_offset is
not flexible and makes it difficult to add new sampling items.

To allow adding new sampling items, drop the struct io_sample_offset.
Instead, introduce the variable length array "uint64_t aux[]" at the
end of the struct io_sample which holds any auxiliary sampling data.
At this moment, it holds only one item "offset" as the first array
element. The following patch will add a new item.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-5-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agoiolog: refactor flush_samples()
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:20 +0000 (17:58 +0900)]
iolog: refactor flush_samples()

flush_samples() controls the log file format depending on the options
log_avg_msec, log_window_value, log_offset and log_prio. It has deeply
nested branches to check the options. These nested branches make it
difficult to add more fields to the log file format. For ease of the log
file format improvements, refactor the function. Instead of checking all
conditions at once, check each condition one by one, generate small
strings for each field and add them to the final string to output. For
this purpose, introduce the new function print_sample_fields() which
generates each field string.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-4-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agostat: reduce arguments of add_log_sample()
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:19 +0000 (17:58 +0900)]
stat: reduce arguments of add_log_sample()

The number of arguments of add_log_sample() has increased as fields get
added to the log file format. Five parameters of them (data, ddir, bs,
offset and priority) are passed to __add_log_sample(). This makes the
function look more complicated and log field addition harder. To
simplify the function, pack the five arguments into the new struct
log_sample.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-3-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agostat: reduce arguments of add_*lat_sample() functions
Shin'ichiro Kawasaki [Thu, 29 Aug 2024 08:58:18 +0000 (17:58 +0900)]
stat: reduce arguments of add_*lat_sample() functions

The functions add_clat_sample(), add_lat_sample() and add_slat_sample()
have a rather large number of arguments, and some of the arguments are
members of the struct io_u. Pass io_u instead of those arguments to
reduce the number of arguments.

Some add_clat_sample() callers in engines/fileoperations.c do not have
io_u reference, then pass NULL instead of the io_u. This indicates to
use 0 values instead of the io_u fields.

While add_slat_sample() takes only struct thread_data * and struct
*io_u, add_clat_sample() and add_lat_sample() still require three more
arguments: 1) nsec is required because struct io_u does not have
completion time, 2) ddir is required to support fileoperations IO
engine, and 3) bs to record partial IO completion.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240829085826.999859-2-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agoMerge branch 'no-librpma' of https://github.com/grom72/fio
Vincent Fu [Tue, 3 Sep 2024 18:44:57 +0000 (14:44 -0400)]
Merge branch 'no-librpma' of https://github.com/grom72/fio

* 'no-librpma' of https://github.com/grom72/fio:
  Remove obsolete library ref.
  Fix parameter type
  rpma: remove librpma support
  Revert "rpma: add librpma_apm_* and librpma_gpspm_* engines"
  Revert "rpma: RPMA engine requires librpma>=v0.10.0 with rpma_mr_advise()"
  Revert "rpma: RPMA engines require librpma>=v0.11.0 with rpma_cq_get_wc()"
  Revert "rpma: simplify server_cmpl_process()"
  Revert "ci: build the librpma fio engine"

9 months agoRemove obsolete library ref.
Tomasz Gromadzki [Thu, 29 Aug 2024 14:29:50 +0000 (16:29 +0200)]
Remove obsolete library ref.

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
9 months agoFix parameter type
Tomasz Gromadzki [Thu, 29 Aug 2024 14:14:20 +0000 (16:14 +0200)]
Fix parameter type

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
9 months agoRemove 'uncached' support
Jens Axboe [Thu, 29 Aug 2024 13:22:17 +0000 (07:22 -0600)]
Remove 'uncached' support

Experimental kernel patches existed for this, usable via setting
RWF_UNCACHED for the IO. But they never made it into mainline, so
let's mark the option as deprecated and kill off the support for
now.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
9 months agorpma: remove librpma support
Tomasz Gromadzki [Thu, 29 Aug 2024 11:58:38 +0000 (13:58 +0200)]
rpma: remove librpma support

Remove librpma support as rpma project is already archived:
https://github.com/pmem/rpma

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
9 months agoRevert "rpma: add librpma_apm_* and librpma_gpspm_* engines"
Tomasz Gromadzki [Thu, 29 Aug 2024 11:55:27 +0000 (13:55 +0200)]
Revert "rpma: add librpma_apm_* and librpma_gpspm_* engines"

This reverts commit e4c4625ff8368f7667b2fe81cd2040186d440c94.

9 months agoRevert "rpma: RPMA engine requires librpma>=v0.10.0 with rpma_mr_advise()"
Tomasz Gromadzki [Thu, 29 Aug 2024 11:48:03 +0000 (13:48 +0200)]
Revert "rpma: RPMA engine requires librpma>=v0.10.0 with rpma_mr_advise()"

This reverts commit e662bc9815de906e3498f4261ec5a28481872a18.

9 months agoRevert "rpma: RPMA engines require librpma>=v0.11.0 with rpma_cq_get_wc()"
Tomasz Gromadzki [Thu, 29 Aug 2024 11:47:49 +0000 (13:47 +0200)]
Revert "rpma: RPMA engines require librpma>=v0.11.0 with rpma_cq_get_wc()"

This reverts commit d479658a965ac17ff213d7ba506116f822cb3219.

9 months agoRevert "rpma: simplify server_cmpl_process()"
Tomasz Gromadzki [Thu, 29 Aug 2024 11:47:36 +0000 (13:47 +0200)]
Revert "rpma: simplify server_cmpl_process()"

This reverts commit d3061c18e84c91a417f8832b1a7cc09b1d26d1ee.

9 months agoRevert "ci: build the librpma fio engine"
Tomasz Gromadzki [Thu, 29 Aug 2024 11:47:16 +0000 (13:47 +0200)]
Revert "ci: build the librpma fio engine"

This reverts commit 4e2bd713356cfc89ea6c898985c492af93b34a5d.

9 months agoci: add containers for Alma, Oracle, and Rocky Linux
Vincent Fu [Mon, 26 Aug 2024 18:27:28 +0000 (18:27 +0000)]
ci: add containers for Alma, Oracle, and Rocky Linux

Expand our testing platforms with these distributions. They mostly use
the same package names as Fedora with a handful of exceptions.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agoci: install updated bash on macOS platforms via workflow
Vincent Fu [Tue, 27 Aug 2024 14:37:02 +0000 (14:37 +0000)]
ci: install updated bash on macOS platforms via workflow

Our shell script for installing dependencies uses a feature that is only
available starting with bash 4. macOS ships with bash 3, so install bash
from homebrew in the GitHub Actions workflow when runing on macOS.
Previously we could install bash in our shell script for installing
dependencies but this depedencies install script now needs the bash 4
feature.

The feature in question is for bash to be able to match multiple
patterns in a case statement.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agoci: install isal packages for testing
Vincent Fu [Wed, 21 Aug 2024 20:31:46 +0000 (20:31 +0000)]
ci: install isal packages for testing

This brings in faster checksum calculation routines that are used for
protection information support.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agoci: run tests in containers
Vincent Fu [Wed, 7 Aug 2024 21:17:29 +0000 (21:17 +0000)]
ci: run tests in containers

This patch adds GitHub Actions tests that run in containers to support
running tests on Debian and Fedora. Ubuntu tests are also run in
containers.

The io_uring (t0018) and command priority (in latency_percentiles.py)
tests are not supported in containers, so the Ubuntu container tests
cannot replace the tests running directly on GitHub Actions Ubuntu
runners.

This is a single uncomfortably large patch because all of these changes
are required for the tests to pass.

Here is a list of changes:

ci.yml:
  add GitHub Actions jobs for the different containers
actions-build.sh:
  use bash found in PATH to pick up bash 4 installed on macOS because
    bash 4 is required to match multiple patterns in a case statement
  only enable cuda when running on Ubuntu because Debian does not have
    the cuda package by default
actions-full-test.sh:
  skip io_uring and cmdprio tests when running on containers because
    these features are not supported
actions-install.sh:
  install nvidia-cuda-dev only on Ubuntu because this is not available
    for Debian by default
  install additional packages when running on Debian and Ubuntu
    containers. These are already installed in the GHA image.
  install packages for Fedora
  install bash via homebrew on macOS to get bash v4

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agoci: remove arm64 case for tests
Vincent Fu [Mon, 19 Aug 2024 20:34:33 +0000 (20:34 +0000)]
ci: remove arm64 case for tests

We no longer run tests on arm64 platforms, so remove related part of the
shell script.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
9 months agoMerge branch 'errdetails' of https://github.com/minwooim/fio
Jens Axboe [Fri, 16 Aug 2024 14:21:20 +0000 (08:21 -0600)]
Merge branch 'errdetails' of https://github.com/minwooim/fio

* 'errdetails' of https://github.com/minwooim/fio:
  io_uring: Add .errdetails to parse CQ status
  ioengines: Add thread_data to .errdetails

9 months agoio_uring: Add .errdetails to parse CQ status
Minwoo Im [Thu, 15 Aug 2024 23:12:34 +0000 (08:12 +0900)]
io_uring: Add .errdetails to parse CQ status

Background
 - fio normally prints out the strerr and errno value when facing
   errors.  In case of io_uring_cmd ioengine with --cmd_type=nvme,
   io_u->error represents the CQ entry status code type and status
   code which should be parsed as a NVMe error value rather than
   errno.

In io_u error failure condition, it prints out parsed CQ entry error
status values with SCT(Status Code Type) and SC(Status Code).  The print
will be like the following example:

  fio: io_uring_cmd: /dev/ng0n1: cq entry status (sct=0x00; sc=0x04)

If --cmd_type!=nvme, it prints out generic status code like below:

  fio: io_uring_cmd: /dev/<devnode>: status=0x4

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
9 months agoioengines: Add thread_data to .errdetails
Minwoo Im [Thu, 15 Aug 2024 23:08:17 +0000 (08:08 +0900)]
ioengines: Add thread_data to .errdetails

No functional changes here, but added a 'struct thread_data *td' to the
errdetails callback.  This is a prep patch for the following commits to
access 'td->eo' instance from .errdetails callback.

Bump up FIO_IOOPS_VERSION to 36 since the previous commits updated
.errdetails callback for ioengines by adding 'thread_data' argument.

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
10 months agoMerge branch 'master' of https://github.com/scaleoutsean/fio
Jens Axboe [Tue, 6 Aug 2024 15:17:03 +0000 (09:17 -0600)]
Merge branch 'master' of https://github.com/scaleoutsean/fio

* 'master' of https://github.com/scaleoutsean/fio:
  Improve http_host, filename in docs and example/http-s3.fio

10 months agoImprove http_host, filename in docs and example/http-s3.fio
Sean Lee [Tue, 6 Aug 2024 12:31:14 +0000 (20:31 +0800)]
Improve http_host, filename in docs and example/http-s3.fio

In fio.1 and HOWTO.rst:
  * http_host: add details on vHost- vs Path-style hostname
    differences
  * filename: add details on bucket prefix for Path-style hostname
In examples/http-s3.fio:
  * add comments at the top to clarify vHost vs Path S3 and change
    the hostname in existing example to disambiguate two scenarios

Signed-off-by: Sean Lee <sean.lee@netapp.com>
10 months agonvme/streams: avoid allocating too large a buffer
Vincent Fu [Mon, 5 Aug 2024 18:15:24 +0000 (18:15 +0000)]
nvme/streams: avoid allocating too large a buffer

We only need to allocate as many data structures as there were stream
IDs provided.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
10 months agoMerge branch 'qnx-phys-mem' of https://github.com/mvf/fio
Jens Axboe [Fri, 26 Jul 2024 13:56:01 +0000 (07:56 -0600)]
Merge branch 'qnx-phys-mem' of https://github.com/mvf/fio

* 'qnx-phys-mem' of https://github.com/mvf/fio:
  QNX: Fix physical memory detection

10 months agoQNX: Fix physical memory detection
Matthias von Faber [Fri, 26 Jul 2024 11:56:17 +0000 (13:56 +0200)]
QNX: Fix physical memory detection

On QNX 7.1, this was returning an uninitialized value due to failing
sysctl. Use the accumulated size of all "ram" areas from the asinfo
array in the syspage instead. Also fixes build on QNX 8.0.

Signed-off-by: Matthias von Faber <mvf@gmx.eu>
10 months agoMerge branch 'fdp/pid_limit_fix' of https://github.com/ankit-sam/fio
Vincent Fu [Wed, 17 Jul 2024 21:30:14 +0000 (17:30 -0400)]
Merge branch 'fdp/pid_limit_fix' of https://github.com/ankit-sam/fio

* 'fdp/pid_limit_fix' of https://github.com/ankit-sam/fio:
  ioengines: bump up FIO_IOOPS_VERSION
  dataplacement: change log_info to log_err for error messages
  dataplacement: remove FDP_MAX_RUHS

10 months agoioengines: bump up FIO_IOOPS_VERSION
Ankit Kumar [Wed, 17 Jul 2024 06:35:50 +0000 (12:05 +0530)]
ioengines: bump up FIO_IOOPS_VERSION

For fdp backend the way ruhs are fetched has been changed.
Earlier fdp_fetch_ruhs was called once with a buffer that can store
ruhs upto FDP_MAX_RUHS. The new fdp_fetch_ruhs is called twice. The
first call doesn't have any buffer for ruhs, and is only to get the
number of ruhs reported by the device. The second call has the buffer
that can store all the ruhs.

This impacts any external ioengines, so bump up FIO_IOOPS_VERSION.

Fixes: commit 56d12245 (dataplacement: update ruh info initialization)

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
10 months agodataplacement: change log_info to log_err for error messages
Ankit Kumar [Wed, 17 Jul 2024 14:10:03 +0000 (19:40 +0530)]
dataplacement: change log_info to log_err for error messages

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
10 months agodataplacement: remove FDP_MAX_RUHS
Ankit Kumar [Wed, 17 Jul 2024 05:57:27 +0000 (11:27 +0530)]
dataplacement: remove FDP_MAX_RUHS

Earlier fio used to have different limits on the max number of data
placement ID indices which user can pass, and the max number of ruhs
which can be stored. As during initialization we now fetch all the ruhs
from the device and then allocate buffer for the requested ones, there
is no need for FDP_MAX_RUHS.

Add missing error message if incorrect placement ID index is specified.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
10 months agot/nvmept_fdp: accommodate devices with many RUHS
Vincent Fu [Mon, 15 Jul 2024 18:47:18 +0000 (18:47 +0000)]
t/nvmept_fdp: accommodate devices with many RUHS

Fio can only accept 128 placement IDs to write to. It is possible for
namespaces to have thousands of placement IDs. Adjust the standard tests
to acommodate this situation. Instead of just assuming that the device
has fewer than 128 placement IDs, change the expected RUAMW calculations
to also work for the case where the namespace has more than 128
placement IDs exceeds 128.

Also adjust the scheme test to work where there are more RUHS than the
max scheme entries allowed.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
10 months agoengines/xnvme: allocate fdp ruhs buffer as per actual
Ankit Kumar [Mon, 15 Jul 2024 15:34:56 +0000 (21:04 +0530)]
engines/xnvme: allocate fdp ruhs buffer as per actual

Remove the restriction on maximum number of ruhs, fetch and fill the
ruhs buffer as requested by fdp backend.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
10 months agoengines/io_uring: fdp allocate ruhs buffer as per actual
Ankit Kumar [Mon, 15 Jul 2024 10:07:24 +0000 (15:37 +0530)]
engines/io_uring: fdp allocate ruhs buffer as per actual

Use calloc instead of scalloc as ruhs buffer allocation is temporary.
Remove the restriction on maximum number of ruhs, fetch and fill the
ruhs buffer as requested by fdp backend.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
10 months agodataplacement: update ruh info initialization
Ankit Kumar [Mon, 15 Jul 2024 08:21:04 +0000 (13:51 +0530)]
dataplacement: update ruh info initialization

The current way of initilization limits ruhs to 128. This commit
updates the way we fetch ruhs. We now fetch the ruhs info in two steps.
The first step only gets us the number of ruhs from the ioengine. This
is used by fdp backend to allocate the correct buffer size for the
second step, where we fetch the actual ruhs info. Fio no longer limits
the maximum number of ruhs for a device.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
[Vincent: edited commit message]

11 months agoos/os-qnx: fix overwrite of 'errno'
Jens Axboe [Fri, 12 Jul 2024 16:52:33 +0000 (10:52 -0600)]
os/os-qnx: fix overwrite of 'errno'

You can't call perror() and expect errno to retain the same value,
it'll be zero after that. On top of that, there's no reason to
print the error here, the higher up layers will do that when an error
is returned.

Fixes: 946733c6f19c ("Support QNX OS platform")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 months agoMerge branch 'master' of https://github.com/huangweiliang/fio_for_qnx
Jens Axboe [Fri, 12 Jul 2024 16:44:31 +0000 (10:44 -0600)]
Merge branch 'master' of https://github.com/huangweiliang/fio_for_qnx

* 'master' of https://github.com/huangweiliang/fio_for_qnx:
  Support QNX OS platform

11 months agoSupport QNX OS platform
Huang weiliang(weller) [Mon, 3 Jun 2024 22:37:54 +0000 (22:37 +0000)]
Support QNX OS platform

Compile command: QNX SDP7.1 example
./configure --cc=aarch64-unknown-nto-qnx7.1.0-gcc --disable-shm
make

Function is verified by UFS device read and write test.

Signed-off-by: Huang weiliang <weller.huang@us.bosch.com>