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>
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>
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>
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>
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>
Jens Axboe [Wed, 2 Oct 2024 18:53:13 +0000 (12:53 -0600)]
Fio 3.38
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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"
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>
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>
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>
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>
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.
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.
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.
Tomasz Gromadzki [Thu, 29 Aug 2024 11:47:36 +0000 (13:47 +0200)]
Revert "rpma: simplify server_cmpl_process()"
This reverts commit
d3061c18e84c91a417f8832b1a7cc09b1d26d1ee.
Tomasz Gromadzki [Thu, 29 Aug 2024 11:47:16 +0000 (13:47 +0200)]
Revert "ci: build the librpma fio engine"
This reverts commit
4e2bd713356cfc89ea6c898985c492af93b34a5d.
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>
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>
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>
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>
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>
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
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>
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>
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
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>
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>
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
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>
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
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>
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>
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>
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>
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>
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>
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]
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>
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
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>
Vincent Fu [Thu, 11 Jul 2024 13:59:48 +0000 (09:59 -0400)]
Merge branch 'io-uring-cmd/nvme/add-flush' of https://github.com/minwooim/fio
* 'io-uring-cmd/nvme/add-flush' of https://github.com/minwooim/fio:
t/nvmept.py: Add test cases for FLUSH
io_u: Support fsync for --rw=trimwrite
io_u: Ensure fsync only after write(s)
td: Replace last_was_sync with last_ddir_issued
td: Rename last_ddir to last_ddir_completed
io_uring: Add support FLUSH command
Minwoo Im [Thu, 4 Jul 2024 14:09:12 +0000 (23:09 +0900)]
t/nvmept.py: Add test cases for FLUSH
This test script tests number of FLUSH commands triggered by --fsync=<N>
options to make FLUSH commands are followed by the WRITE commands from
the various --rw I/O workload.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Sat, 22 Jun 2024 15:30:03 +0000 (00:30 +0900)]
io_u: Support fsync for --rw=trimwrite
Even if ddir is determined in get_rw_ddir(), ddir might be updated in
set_rw_ddir(). if td represents trimwrite, it will be updated to either
DDIR_TRIM or DDIR_WRITE even ddir already represents for DDIR_SYNC.
To support DDIR_SYNC(fsync) for trimwrite, this patch checks ddir_sync()
in case of trimwrite not to update the pre-determined ddir.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Tue, 9 Jul 2024 22:50:14 +0000 (07:50 +0900)]
io_u: Ensure fsync only after write(s)
When using `--rw=write --fsync=N`, the FLUSH command is correctly
issued after N WRITE commands. However, if READ commands are mixed
in with --rw, fsync occurs after READ commands as well. This patch
ensures that fsync is only triggered after the specified number of
WRITE commands, regardless of READ commands.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Tue, 9 Jul 2024 22:48:56 +0000 (07:48 +0900)]
td: Replace last_was_sync with last_ddir_issued
`last_was_sync` has represented that the last command had DDIR_SYNC.
This can be replaced with `ddir_sync(last_ddir_issued)` and it's much
more flexible to represent the last issued command's data direction.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Tue, 9 Jul 2024 22:45:04 +0000 (07:45 +0900)]
td: Rename last_ddir to last_ddir_completed
`last_ddir` represents the data direction of the latest completed
command. To avoid confusions, this patch renamed `last_ddir` to
`last_ddir_completed` to make it much more clear.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Sat, 22 Jun 2024 11:35:02 +0000 (20:35 +0900)]
io_uring: Add support FLUSH command
Add support for --fsync and --fdatasync in io_uring_cmd ioengine to
enable FLUSH commands just like libaio or io_uring ioengines.
If --fsync or --fdatasync is given N, FLUSH command will be issued as
per N write commands.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Vincent Fu [Fri, 28 Jun 2024 22:12:09 +0000 (18:12 -0400)]
windows: don't define strtoll for 32-bit builds
Our 32-bit Windows Cygwin builds started failing because one of the
libraries they require now defines strtoll when fio already defines
strtoll. To avoid this, don't define strtoll for 32-bit Windows builds.
Failed build: https://github.com/axboe/fio/actions/runs/
9718276970/job/
26825784199
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Jens Axboe [Fri, 14 Jun 2024 12:19:28 +0000 (06:19 -0600)]
Merge branch 'nfs' of https://github.com/panxiao2014/fio
* 'nfs' of https://github.com/panxiao2014/fio:
Fix issue when start randwrite by using nfs engine
Pan Xiao [Fri, 14 Jun 2024 05:51:07 +0000 (13:51 +0800)]
Fix issue when start randwrite by using nfs engine
Use td_write(td) instead of td->o.td_ddir == TD_DDIR_WRITE
So fio will treat write and randwrite the same way when start jobs
by using NFS engine.
Pan Xiao <xiaopan@outlook.com>
Vincent Fu [Wed, 12 Jun 2024 17:06:09 +0000 (13:06 -0400)]
smalloc: add a comment explaining why scalloc does not zero memory
scalloc does not zero out the buffer because this is already done
elsewhere. Explain this in a comment because this could be confusing.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 11 Jun 2024 20:19:38 +0000 (16:19 -0400)]
helper_thread: check for null scalloc return value
scalloc can return NULL if it fails to allocate memory. Check for this
condition and fail the helper thread setup if it occurs.
This issue was reported by Coverity:
** CID 496644: Null pointer dereferences (NULL_RETURNS)
/helper_thread.c: 425 in helper_thread_create()
419
420 hd = scalloc(1, sizeof(*hd));
421
422 setup_disk_util();
423 steadystate_setup();
424
>>> CID 496644: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing "hd", which is known to be "NULL".
425 hd->sk_out = sk_out;
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 11 Jun 2024 20:14:18 +0000 (16:14 -0400)]
t/stest: remove useless error assignment
Because the break statement breaks out of the while loop setting error
to true has no effect. So remove this useless assignment.
This issue was reported by Coverity:
** CID 496645: Code maintainability issues (UNUSED_VALUE)
/t/stest.c: 83 in do_rand_allocs()
77 flist_del(&e->list);
78 sfree(e);
79
80 if (!error) {
81 e = scalloc(1, LARGESMALLOC);
82 if (!e) {
>>> CID 496645: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value "true" to "error" here, but that stored value is overwritten before it can be used.
83 error = true;
84 ret++;
85 printf("failure allocating %u bytes at %lu allocated during sfree phase\n",
86 LARGESMALLOC, total);
87 break;
88 }
Fixes:
c6783fc3 ("t/stest: confirm that scalloc clears the buffer")
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 11 Jun 2024 20:09:00 +0000 (16:09 -0400)]
iolog: check scalloc return value
It is possible for scalloc to return NULL. setup_log() does not return a
value to indicate failure but we can use an assert here to check for a
NULL scalloc return value. This will trigger an exception similar to the
segfault that would happen if scalloc returns null, but this should
silence Coverity.
This was reported by Coverity:
** CID 496646: Null pointer dereferences (NULL_RETURNS)
/iolog.c: 843 in setup_log()
*** CID 496646: Null pointer dereferences (NULL_RETURNS)
/iolog.c: 843 in setup_log()
837 struct io_log *l;
838 int i;
839 struct io_u_plat_entry *entry;
840 struct flist_head *list;
841
842 l = scalloc(1, sizeof(*l));
>>> CID 496646: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing "l", which is known to be "NULL".
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 11 Jun 2024 17:54:56 +0000 (17:54 +0000)]
t/stest: confirm that scalloc clears the buffer
Change smalloc calls to scalloc and make sure buffers are zeroed out.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 11 Jun 2024 17:48:41 +0000 (17:48 +0000)]
Reapply "smalloc: smalloc() already clears memory, scalloc() need not do it again"
This reverts commit
eb7fe4550ff2a569d0d8c71de16a1ea1e1aaf0a5.
It turns out that each buffer is in fact cleared in smalloc_pool() when
it is called by smalloc(). So there is no need to clear the buffer a
second time in scalloc.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Fri, 7 Jun 2024 13:37:49 +0000 (09:37 -0400)]
engines/io_uring: eliminate FDP memory corruption risk
We only allocate FDP_MAX_RUHS reclaim unit handle status descriptors. It
is possible that the device will have more than this many descriptors.
Make sure we do not run over the end of the buffer we have allocated
when this happens.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Thu, 6 Jun 2024 17:57:47 +0000 (13:57 -0400)]
Revert "smalloc: smalloc() already clears memory, scalloc() need not do it again"
Originally:
smalloc cleared the buffer
scalloc did not need to clear the differ
Later:
9c3e13e3314da394698ca32f21cc46d46b7cfe47
smalloc was changed to not clear the buffer
scalloc was not updated to clear the buffer when the above smalloc
change was made
Originally smalloc always cleared the buffer. So it wasn't necessary for
scalloc to clear it again. But later on smalloc was changed to no longer
clear the buffer but scalloc was not changed back to clear the buffer.
Reverting this commit makes scalloc clear the buffer again.
This reverts commit
a640ed36829f3be6d9dd8c7974dba41b9b59e6a5.
Fixes: https://github.com/axboe/fio/issues/1772
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Wed, 5 Jun 2024 15:19:51 +0000 (15:19 +0000)]
dataplacement: increase max data placement IDs to 128
Some users have requested the ability to test a larger number of
placement IDs in a single job. Bump the max placement IDs to 128.
Change the type to 16 bits to reduce the amount of space these
additional IDs will consume.
Also bump the server version for this change.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Mon, 3 Jun 2024 18:05:24 +0000 (18:05 +0000)]
docs: update and clarify plids option
Make it clearer that for FDP the values specified by the plids option
are indices referencing the list of placement identifiers available to
the namespace.
Also note that it now accepts ranges.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Mon, 3 Jun 2024 19:04:43 +0000 (19:04 +0000)]
t/nvmept_fdp: add tests for plid ranges
Add a few tests to make sure that parsing of ranges for placement ID
indices works.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>