fio.git
17 months agooptions: Support arbitrarily long pattern buffers
Logan Gunthorpe [Fri, 18 Nov 2022 23:15:59 +0000 (16:15 -0700)]
options: Support arbitrarily long pattern buffers

Dynamically allocate the pattern buffer to remove the 512B length
restriction. To accomplish this, store a pointer instead of a fixed
block of memory for the buffers in the thread_options structure.
Then introduce and use the function parse_and_fill_pattern_alloc()
which will calculate the approprite size of the buffer and allocate
it before filling it.

The buffers will be freed, along with a number of string buffers
in free_thread_options_to_cpu(). They will also be reallocated (if
necessary) when receiving them over the wire with
convert_thread_options_to_cpu().

This allows for specifying real world compressible data (eg. The
Calgary Corpus) for the buffer_pattern option.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agolib/pattern: Support short repeated read calls when loading from file
Logan Gunthorpe [Fri, 18 Nov 2022 23:15:58 +0000 (16:15 -0700)]
lib/pattern: Support short repeated read calls when loading from file

Once a pattern file can be much larger, it will be possible that
kernel will return a short read while loading the file and thus may
randomly only load part of the file.

Fix this by putting the read in a loop so the entire file will be
read.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agolib/pattern: Support NULL output buffer in parse_and_fill_pattern()
Logan Gunthorpe [Fri, 18 Nov 2022 23:15:57 +0000 (16:15 -0700)]
lib/pattern: Support NULL output buffer in parse_and_fill_pattern()

Support passing a NULL output buffer to parse_and_fill_pattern().
Each formatting function simply needs to avoid accessing the buffer
when it is NULL. This allows calculating the required size of the
buffer before one might be allocated.

This will be useful in a subsequent patch for dynamically allocating
the pattern buffers.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agocconv: Support pattern buffers of arbitrary size
Logan Gunthorpe [Fri, 18 Nov 2022 23:15:56 +0000 (16:15 -0700)]
cconv: Support pattern buffers of arbitrary size

Change the thread_options_pack structure to support pattern buffers
of arbitrary size by using a flexible array at the end of the the
structure to store both the verify_pattern and the buffer_pattern
in that order.

In this way, only the actual bytes of each pattern will be sent over
the wire and patterns of an arbitrary size can be used with the packed
structure.

In order to determine the required size of the structure the function
thread_options_pack_size() is introduced which returns the total
number of bytes required for a given thread_options instance.

The two callsites of convert_thread_options_to_net() are then converted
to dynamically allocate a pdu of the appropriate size and the
two callsites of convert_thread_options_to_cpu() are modified to
take the size of the received data to prevent buffer overruns.

Also add specific testing of this feature in fio_test_cconv().

Seeing this changes the client/server protocol, the FIO_SERVER_VER
is bumped.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agot/zbd: add test case to check experimental_verify option
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:08 +0000 (11:13 +0900)]
t/zbd: add test case to check experimental_verify option

The option experimental_verify does not work with zonemode=zbd. Add a
test case to check that fio errors out when the both options are
specified.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agot/zbd: remove experimental_verify option from test case #54
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:07 +0000 (11:13 +0900)]
t/zbd: remove experimental_verify option from test case #54

The option experimental_verify does not work with zonemode=zbd. Remove
it from the test case #54.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agot/zbd: add test case to check zone_reset_threshold/frequency with verify
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:06 +0000 (11:13 +0900)]
t/zbd: add test case to check zone_reset_threshold/frequency with verify

Recent commit fixed assertion failure observed with zone_reset_threshold
and zone_reset_frequency options together with verify. Add a test case
to confirm the fix. Run four types of workloads and confirm no error.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agot/zbd: modify test case #34 for block size unaligned to zone size
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:05 +0000 (11:13 +0900)]
t/zbd: modify test case #34 for block size unaligned to zone size

The test case #34 confirmed that the block size unaligned to zone size
is handled as an error. After recent fix, now fio is able to handle such
block sizes, then the check for the error is no longer required.

Instead of removing this unnecessary test case, change it to cover
verify with complex workload. It runs random write workload with high
queue depth with verify. Use two types of block sizes unaligned to zone
size. This test workload is same as test case #57 except the verify
option and block sizes.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agot/zbd: fix test case #33 for block size unaligned to zone size
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:04 +0000 (11:13 +0900)]
t/zbd: fix test case #33 for block size unaligned to zone size

Recent fix of zonemode=zbd support for block size unaligned to zone size
unveiled that the test case #33 has two issues.

First issue is test preparation. Before the fix, write was done to only
to the first zone due to a bug in zone selection which happens when
block size is not a divisor of zone size. Then, status of second zone
did not affect. After the fix, write count to the zones may vary if the
second zone has almost full status since the zone is skipped from write
target. Fix this by resetting the write target zones.

Second issue is expected written data size. The test case checks that
the written data size is larger than the io_size option value. This
expectation was fine before the fix because data write was repeated in
do_io() and the limit was checked with io_issue_bytes_exceeded(),
which triggers loop break when written data is larger than io_size.
However, after the fix, the limit is checked with keep_running() in
thread_main(). According to code and block comment in keep_running(),
fio job terminates even when written data size is smaller than io_size
if the gap is smaller than maximum IO size. Then the expected written
data size is the largest multiple of block size smaller than or equal to
the io_size. This io_size check change resulted in the test case
failure. Avoid the failure by fixing the expected written data size
calculation.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agozbd: prevent experimental verify with zonemode=zbd
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:03 +0000 (11:13 +0900)]
zbd: prevent experimental verify with zonemode=zbd

When the experimental_verify option is specified, fio does not record
normal I/O metadata to create verify read unit. Instead, fio resets file
status after normal I/O and before verify start, then replay I/Os to
regenerate write unit and adjust it to verify read. This I/O replay does
not work for zonemode=zbd since zone status needs to be restored at
verify start to the status before the normal I/O. However, such status
restore moves write pointers and erases data pattern for verify.

Check that the options experimental_verify and zonemode=zbd are not
specified together and error out in case they are both specified. Also
remove the helper function zbd_replay_write_order() which is called from
zbd_adjust_block(). This function adjusts verify read unit to meet zone
write restrictions for experimental verify, but such adjustment does not
work because zone status is not restored before verify start.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agozbd: fix zone reset condition for verify
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:02 +0000 (11:13 +0900)]
zbd: fix zone reset condition for verify

When data verification is requested, zbd_file_reset() resets zones only
when td->runstate is not TD_VERIFYING so that the data to read back for
verify is not wiped out. However, even when verify data to read is left,
td->runstate is not always TD_VERIFYING. When verify_backlog option is
set, or when block size is not divisor of zone size, zbd_file_reset()
can be called while td->runstate is TD_RUNNING. This causes verify
failures.

To avoid the failures, improve the check condition to reset zones in
zbd_file_reset(). On top of td->runstate, refer td->io_hist_len,
td->verify_batch and td->o.verify_backlog values to avoid zone reset.
This is same check as check_get_verify().

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agozbd, verify: verify before zone reset for zone_reset_threshold/frequency
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:01 +0000 (11:13 +0900)]
zbd, verify: verify before zone reset for zone_reset_threshold/frequency

When zone_reset_threshold and zone_reset_frequency options are specified
with zonemode=zbd, it resets zones not full. When verify option is
specified on top of that, the zone reset of non-full zones erases data
for verify and causes verify failure. Current implementation avoids this
scenario by assert.

To allow zone_reset_threshold/frequency options together with verify,
do verify before the zone reset. When zone reset is required to an open
zone with verify data, call get_next_verify() to get io_u for verify
read and return it from zbd_adjust_block(). When io_u->file is set,
get_next_verify() assumes the io_u is requeued and does nothing. Unset
io_u->file to tell get_next_verify() is not requeued.

Also modify verify_io_u() to skip rand_seed check when the option
zone_reset_frequency is set. When the option is set, random seed is not
reset for verify reads in same manner as verify_backlog option, then
this check is not valid.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agozbd: allow block size not divisor of zone size
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:13:00 +0000 (11:13 +0900)]
zbd: allow block size not divisor of zone size

Current implementation checks that block size is divisor of zone size
when verify work load is specified. After the recent fix of block size
unaligned to zone, this check is no longer valid. Remove the check.

The check had been valid since such block size left unwritten area at
each zone end and keeps the zones in open/active status until verify
read is done. It easily hit max open/active zones limitation. After the
fix, the zones with unwritten area are finished then they do not hit the
limitation.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agozbd: finish zones with remainder smaller than minimum write block size
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:12:59 +0000 (11:12 +0900)]
zbd: finish zones with remainder smaller than minimum write block size

When zonemode is zbd and block size is not divisor of zone size, write
target zone selection does not work as expected. When the write is
random write and the device has max open zone limit, the random write is
repeated to the zones selected up to the max open zone limit. All writes
are repeated only to the zones. When the write is sequential write,
write is done only for the first zone. The cause of such unexpected zone
selection is current write target zone selection logic. It selects write
target zones within open zones. When block size is not divisor of zone
size, the selected open zone has only remainder of writable blocks
smaller than the block size. Fio resets such zone after zone selection
and continues writing to it. This zone reset is required not to exceed
the limit of max_open_zones option or max_active_zone limit of the zoned
device, but it does not simulate the workload.

To avoid the zone reset and unexpected write to same zone, fix write
target zone handling of zones with remainder smaller than write block
size. Do not reset but finish such zone not to exceed the max_open_zones
option and max_active_zone limit. Then choose the zone next to the
finished zone as write target. To implement this, add the helper
function zbd_finish_zone().

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agozbd: add zbd_zone_remainder() helper function
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:12:58 +0000 (11:12 +0900)]
zbd: add zbd_zone_remainder() helper function

Add the helper function zbd_zone_remainder(), which returns the number
of bytes that are still available for writing before the zone gets full.
Use this function to improve readability. It will also be used in the
following patch.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agoengines/libzbc: add libzbc_finish_zone() helper function
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:12:57 +0000 (11:12 +0900)]
engines/libzbc: add libzbc_finish_zone() helper function

To support zone finish operation to ZBC drives through libzbc, add
finish_zone() callback to struct ioengine_ops, and implement in libzbc
IO engine. This feature is used to keep the same zone handling by
zonemode=zbd for libzbc engine as other engines.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agooslib: blkzoned: add blkzoned_finish_zone() helper function
Shin'ichiro Kawasaki [Mon, 14 Nov 2022 02:12:56 +0000 (11:12 +0900)]
oslib: blkzoned: add blkzoned_finish_zone() helper function

Add the helper function blkzoned_finish_zone() to support zone finish
operation to zoned block devices through ioctl. This feature will be
used to change status of zones which is not yet full but does not have
enough size to write next block, so that such zones do not exceed max
active zones limit. This function does zone finish only when kernel
supports the ioctl BLKFINISHZONE. Otherwise, it does nothing. This
should be fine since the kernel without BLKFINISHZONE does not report
max active zone limit through sysfs to user space.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
17 months agoMerge branch 'master' of https://github.com/bvanassche/fio
Vincent Fu [Mon, 14 Nov 2022 13:47:00 +0000 (08:47 -0500)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  os/os.h: Improve cpus_configured()
  configure: Fix the struct nvme_uring_cmd detection
  configure: Fix clock_gettime() detection

17 months agoos/os.h: Improve cpus_configured()
Bart Van Assche [Sun, 13 Nov 2022 23:10:10 +0000 (15:10 -0800)]
os/os.h: Improve cpus_configured()

Fix the following Coverity complaint:

1. negative_return: Calling sysconf, which might return a negative value.
2. return_negative_fn: Returning the return value of sysconf, which might be negative.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
17 months agoconfigure: Fix the struct nvme_uring_cmd detection
Bart Van Assche [Sun, 13 Nov 2022 23:11:54 +0000 (15:11 -0800)]
configure: Fix the struct nvme_uring_cmd detection

Prevent that struct nvme_uring_cmd detection fails as follows:

error: unused variable 'cmd' [-Werror=unused-variable]

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
17 months agoconfigure: Fix clock_gettime() detection
Bart Van Assche [Sun, 13 Nov 2022 23:09:22 +0000 (15:09 -0800)]
configure: Fix clock_gettime() detection

Prevent that the clock_gettime() and CLOCK_MONOTONIC tests fail as follows:

error: argument 2 null where non-null expected [-Werror=nonnull]

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
17 months agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Mon, 7 Nov 2022 23:20:04 +0000 (16:20 -0700)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Android: Enable zoned block device support
  Windows: Fix the build

17 months agoAndroid: Enable zoned block device support
Bart Van Assche [Mon, 7 Nov 2022 19:14:34 +0000 (11:14 -0800)]
Android: Enable zoned block device support

Enable support for --zonemode=zbd on Android.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
17 months agoWindows: Fix the build
Bart Van Assche [Mon, 7 Nov 2022 20:37:16 +0000 (12:37 -0800)]
Windows: Fix the build

Fix the build errors about passing arguments without a prototype.

Fixes: 93bcfd20e37c ("Move Windows port to MinGW")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
17 months agoFio 3.33 fio-3.33
Jens Axboe [Sun, 6 Nov 2022 20:55:41 +0000 (13:55 -0700)]
Fio 3.33

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

System information:

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

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

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

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

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

    $ gcc test.c

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

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

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

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

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

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

In libcufile ioengine_ops, set get_file_size to
generic_get_file_size.

Fixes #1213.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Help them with helpful message.

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

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

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

Typo and grammatical fix for README

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

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

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

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

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

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

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

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

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

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

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

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

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

Fix some style issues identified by pylint.

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

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

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

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

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

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

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

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

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

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

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

Fix the following compiler error:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes: c16dc793a3c45780f67ce65244b6e91323dee014 "Add randtrimwrite data
direction"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This fixes the following error:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Simplify the code of the server_cmpl_process() function.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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