fio.git
2 years agoMerge branch 'fio_offload_fixes' of https://github.com/PCPartPicker/fio
Jens Axboe [Fri, 11 Feb 2022 21:25:33 +0000 (14:25 -0700)]
Merge branch 'fio_offload_fixes' of https://github.com/PCPartPicker/fio

* 'fio_offload_fixes' of https://github.com/PCPartPicker/fio:
  Fix issues (assert or uninit var, hang) with check_min_rate and offloading

2 years agoci: install sphinx packages and add doc building to GitHub Actions
Vincent Fu [Fri, 4 Feb 2022 21:19:04 +0000 (16:19 -0500)]
ci: install sphinx packages and add doc building to GitHub Actions

To better detect breakage in our documentation builds let's add them to
our GitHub Actions CI.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoFix issues (assert or uninit var, hang) with check_min_rate and offloading
aggieNick02 [Fri, 11 Feb 2022 20:46:12 +0000 (14:46 -0600)]
Fix issues (assert or uninit var, hang) with check_min_rate and offloading

Using rate_min/rate_iops_min when io_submit_mode=offload option is set
leads to intermittent asserts and doesn't work. The variable comp_time
is never set in do_io in backend.c in the offload case, and comp_time is
then used in the calls to check_min_rate. The time computations in
check_min_rate either assert and terminate fio, or return meaningless
values, so any rate checking is not correct.

This first issue is fixed by adding a call to fio_gettime in the
offloading case. Once that is done though, there is still another
problem remaining. When the min rate is not achieved (with the
offloading option), fio detects it and tries to exit but fails. It ends
up in a state where ctrl-C will not cause an exit either. This happens
because cleanup_pending_aio(td) in the error case hangs in its second
call to io_u_queued_complete. Calling workqueue_flush in the error case
(when offloading) fixes the problem by making sure nothing is left in
the work queues and cleanup can proceed as it does in the non-offload
case.

Signed-off-by: Nick Neumann <nick@pcpartpicker.com>
2 years agoAdd aarch64 cpu clock support
Jens Axboe [Fri, 11 Feb 2022 13:58:12 +0000 (06:58 -0700)]
Add aarch64 cpu clock support

We can use cntvct_el0 to read the CPU clock.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: avoid unused `nr_batch` warning
Jens Axboe [Fri, 11 Feb 2022 13:42:13 +0000 (06:42 -0700)]
t/io_uring: avoid unused `nr_batch` warning

If we have libaio support, but not an appropriate CPU clock, then the
build throws a warning on nr_batch being assigned but never used.

Mirror what was done on the io_uring init path and only defined and
set `nr_batch` if we have CPU clock support.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agofio: really use LDFLAGS when linking dynamic engines
Eric Sandeen [Tue, 8 Feb 2022 16:00:39 +0000 (10:00 -0600)]
fio: really use LDFLAGS when linking dynamic engines

Fix stupid braino on my part.

Fixes: 2b3d4a6a924e ("fio: use LDFLAGS when linking dynamic engines")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Link: https://lore.kernel.org/r/1644336039-12774-1-git-send-email-sandeen@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoHOWTO: combine two chunk_size listings into a single one
Vincent Fu [Fri, 4 Feb 2022 21:05:37 +0000 (16:05 -0500)]
HOWTO: combine two chunk_size listings into a single one

This resolves the documentation build warning about multiple listings
for the chunk_size option.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoHOWTO: combine separate hipri listings into a single one
Vincent Fu [Fri, 4 Feb 2022 20:59:37 +0000 (15:59 -0500)]
HOWTO: combine separate hipri listings into a single one

Resolve doc build warnings about multiple appearances of the hipri
option.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoHOWTO: combine multiple pool option listings
Vincent Fu [Fri, 4 Feb 2022 20:34:10 +0000 (15:34 -0500)]
HOWTO: combine multiple pool option listings

Listing the pool option in multiple places makes it impossible to link
to it in the documentation. Combine the two pool option listings into
one to resolve the doc build warning.

Also clean up a few small formatting issues.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agodocs: rename HOWTO to HOWTO.rst
Vincent Fu [Fri, 4 Feb 2022 20:08:24 +0000 (15:08 -0500)]
docs: rename HOWTO to HOWTO.rst

Since the HOWTO uses the rst format, we should identify it that way. It
will display nicely on github.com.

Also update the documentation to refer to the new HOWTO.rst file.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agodocs: update Makefile in order to detect build failures
Vincent Fu [Fri, 28 Jan 2022 18:50:11 +0000 (18:50 +0000)]
docs: update Makefile in order to detect build failures

With the -W option sphinx-docs will yield a non-zero return code when it
encounters warnings.

With the --keep-going option sphinx-docs will continue running to the
end of the build even if it encounters errors.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agodocs: document cpumode option for the cpuio ioengine
Vincent Fu [Fri, 28 Jan 2022 18:45:29 +0000 (18:45 +0000)]
docs: document cpumode option for the cpuio ioengine

The cpumode option for the cpuio ioengine never had its own entry in the
documentation. Add an entry so that the documentation builds cleanly.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agot/io_uring: fix warnings for !ARCH_HAVE_CPU_CLOCK
Jens Axboe [Fri, 4 Feb 2022 16:02:49 +0000 (09:02 -0700)]
t/io_uring: fix warnings for !ARCH_HAVE_CPU_CLOCK

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: make free_clat_prio_stats() safe against NULL
Niklas Cassel [Fri, 4 Feb 2022 00:17:49 +0000 (00:17 +0000)]
stat: make free_clat_prio_stats() safe against NULL

The sfree() in free_clat_prio_stats() itself handles NULL, so the function
already handles a struct thread_stat without any per priority stats.
(Per priority stats are disabled on threads/thread_stats that we know will
never be able to contain more than a single priority.)

However, if malloc() in e.g. gen_mixed_ddir_stats_from_ts() or
__show_run_stats() failed to allocate memory, free_clat_prio_stats() will
be supplied a NULL pointer.

Fix free_clat_prio_stats() to handle a NULL pointer gracefully.

Fixes: 4ad856497c0b ("stat: add a new function to allocate a clat_prio_stat array")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20220204001741.34419-1-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agofio: use correct function declaration for set_epoch_time()
Jens Axboe [Thu, 3 Feb 2022 23:05:02 +0000 (16:05 -0700)]
fio: use correct function declaration for set_epoch_time()

Fixes: d5b3cfd4064d ("Support for alternate epochs in fio log files")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'fio_pr_alternate_epoch' of https://github.com/PCPartPicker/fio
Jens Axboe [Thu, 3 Feb 2022 22:34:40 +0000 (15:34 -0700)]
Merge branch 'fio_pr_alternate_epoch' of https://github.com/PCPartPicker/fio

* 'fio_pr_alternate_epoch' of https://github.com/PCPartPicker/fio:
  Support for alternate epochs in fio log files

2 years agoMerge branch 'cifuzz-integration' of https://github.com/DavidKorczynski/fio
Jens Axboe [Thu, 3 Feb 2022 22:33:47 +0000 (15:33 -0700)]
Merge branch 'cifuzz-integration' of https://github.com/DavidKorczynski/fio

* 'cifuzz-integration' of https://github.com/DavidKorczynski/fio:
  ci/Github actions: add CIFuzz integration

2 years agoMerge branch 'freebsd-comment-update' of https://github.com/macdice/fio
Jens Axboe [Thu, 3 Feb 2022 22:33:21 +0000 (15:33 -0700)]
Merge branch 'freebsd-comment-update' of https://github.com/macdice/fio

* 'freebsd-comment-update' of https://github.com/macdice/fio:
  Update comments about availability of fdatasync().

2 years agot/latency_percentiles.py: add tests for the new cmdprio_bssplit format
Niklas Cassel [Thu, 3 Feb 2022 19:28:32 +0000 (19:28 +0000)]
t/latency_percentiles.py: add tests for the new cmdprio_bssplit format

Add two new test cases for the new cmdprio_bssplit format.

While at it, fixup some small typos in the existing code.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-19-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: remove unused high/low prio struct members
Niklas Cassel [Thu, 3 Feb 2022 19:28:32 +0000 (19:28 +0000)]
stat: remove unused high/low prio struct members

Now when all users have moved to the new clat_prio_stat arrays,
remove io_u_plat_high_prio, io_u_plat_low_prio, clat_high_prio_stat,
and clat_low_prio_stat, as they are no longer used.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-18-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agogfio: drop support for high/low priority latency results
Niklas Cassel [Thu, 3 Feb 2022 19:28:31 +0000 (19:28 +0000)]
gfio: drop support for high/low priority latency results

High/low priority latencies have been replaced by a per prio array.
This allows us to have latency results for more than just two priorities.

Unfortunately this currently means that we have to drop the support for
visualizing the high/low priority latencies.

If someone wants to know the per prio latency results, both the regular
output and the json output contain this information.

The GUI could be extended to support the new per priority format at a
later time, if anyone has a huge need for this feature.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-17-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: convert json output to a new per priority granularity format
Niklas Cassel [Thu, 3 Feb 2022 19:28:31 +0000 (19:28 +0000)]
stat: convert json output to a new per priority granularity format

The JSON output will no longer contain high_prio/low_prio entries, but will
instead include a new list "prios", which will include an object per
prioclass/priolevel combination. Each of these objects will either have a
"clat_ns" object or a "lat_ns" object, depending on which latency type was
being tracked.

This JSON structure should make it easy if the per priority stats were ever
extended to be able to track multiple latency types at the same time, as
each prioclass/priolevel object will then simply contain (e.g.) both a
"clat_ns" and a "lat_ns" object.

Convert the JSON output to this new per priority granularity format,
and convert the tests to work with the new JSON output.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-16-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: report clat stats on a per priority granularity
Niklas Cassel [Thu, 3 Feb 2022 19:28:30 +0000 (19:28 +0000)]
stat: report clat stats on a per priority granularity

Convert the stat code to report clat stats on a per priority granularity,
rather than simply supporting high/low priority.

This is made possible by using the new clat_prio_stat array (per ddir),
together with the clat_prio_stat index which is saved in each io_u.

The per priority samples are only printed when there are samples for more
than one priority in the clat_prio_stat array. If there are only samples
for one priority, that means that all I/Os where submitted using the same
priority, so no need to print.

For example, running the following fio command:
fio --name=test --filename=/dev/sdc --direct=1 --runtime=60 --rw=randread \
    --ioengine=io_uring --ioscheduler=mq-deadline --iodepth=32 --bs=32k \
    --prioclass=2 --prio=7 --cmdprio_bssplit=32k/20/3/0:32k/10/1/4

Now results in the following output:
test: (groupid=0, jobs=1): err= 0: pid=465655: Tue Feb  1 02:24:47 2022
  read: IOPS=146, BW=4695KiB/s (4808kB/s)(276MiB/60239msec)
    slat (usec): min=18, max=335, avg=62.87, stdev=22.59
    clat (msec): min=2, max=2135, avg=217.97, stdev=287.26
     lat (msec): min=2, max=2135, avg=218.03, stdev=287.26
    clat prio 2/7 (msec): min=3, max=606, avg=106.57, stdev=86.64
    clat prio 3/0 (msec): min=10, max=2135, avg=664.94, stdev=339.42
    clat prio 1/4 (msec): min=2, max=300, avg=52.29, stdev=42.52
    clat percentiles (msec):
     |  1.00th=[    8],  5.00th=[   14], 10.00th=[   19], 20.00th=[   33],
     | 30.00th=[   52], 40.00th=[   77], 50.00th=[  108], 60.00th=[  144],
     | 70.00th=[  192], 80.00th=[  300], 90.00th=[  684], 95.00th=[  911],
     | 99.00th=[ 1234], 99.50th=[ 1318], 99.90th=[ 1687], 99.95th=[ 1770],
     | 99.99th=[ 2140]
    clat prio 2/7 (69.25% of IOs) percentiles (msec):
     |  1.00th=[    7],  5.00th=[   13], 10.00th=[   17], 20.00th=[   28],
     | 30.00th=[   44], 40.00th=[   64], 50.00th=[   85], 60.00th=[  111],
     | 70.00th=[  140], 80.00th=[  174], 90.00th=[  226], 95.00th=[  279],
     | 99.00th=[  368], 99.50th=[  418], 99.90th=[  502], 99.95th=[  567],
     | 99.99th=[  609]
    clat prio 3/0 (20.91% of IOs) percentiles (msec):
     |  1.00th=[   44],  5.00th=[  138], 10.00th=[  205], 20.00th=[  347],
     | 30.00th=[  464], 40.00th=[  558], 50.00th=[  659], 60.00th=[  760],
     | 70.00th=[  860], 80.00th=[  961], 90.00th=[ 1099], 95.00th=[ 1217],
     | 99.00th=[ 1485], 99.50th=[ 1687], 99.90th=[ 1871], 99.95th=[ 2140],
     | 99.99th=[ 2140]
    clat prio 1/4 (9.84% of IOs) percentiles (msec):
     |  1.00th=[    7],  5.00th=[   10], 10.00th=[   13], 20.00th=[   18],
     | 30.00th=[   24], 40.00th=[   30], 50.00th=[   39], 60.00th=[   51],
     | 70.00th=[   63], 80.00th=[   84], 90.00th=[  114], 95.00th=[  136],
     | 99.00th=[  188], 99.50th=[  197], 99.90th=[  300], 99.95th=[  300],
     | 99.99th=[  300]
   bw (  KiB/s): min= 3456, max= 5888, per=100.00%, avg=4697.60, stdev=472.38, samples=120
   iops        : min=  108, max=  184, avg=146.80, stdev=14.76, samples=120
  lat (msec)   : 4=0.11%, 10=2.57%, 20=8.67%, 50=18.21%, 100=18.34%
  lat (msec)   : 250=28.87%, 500=9.41%, 750=5.22%, 1000=5.09%, 2000=3.50%
  lat (msec)   : >=2000=0.01%
  cpu          : usr=0.16%, sys=0.97%, ctx=17715, majf=0, minf=262
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.2%, 32=99.6%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.1%, 64=0.0%, >=64=0.0%
     issued rwts: total=8839,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=32

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-15-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: disable per prio stats where not needed
Niklas Cassel [Thu, 3 Feb 2022 19:28:30 +0000 (19:28 +0000)]
stat: disable per prio stats where not needed

In order to avoid allocating a clat_prio_stat array for threadstats that we
know will never be able to contain more than a single priority, introduce a
new member disable_prio_stat in struct thread_stat.

The naming prefix is disable, since we want the default value to be 0
(enabled). This is because in default case, we do want sum_thread_stats()
to generate a per prio stat array. Only in the case where we know that we
don't want per priority stats to be generated, should this member be set
to 1.

Server version is intentionally not incremented, as it will be incremented
in a later patch in the series. No need to bump it multiple times for the
same patch series.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-14-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: add helper for resetting the latency buckets
Niklas Cassel [Thu, 3 Feb 2022 19:28:29 +0000 (19:28 +0000)]
stat: add helper for resetting the latency buckets

Add a helper for resetting the latency buckets, and call it where
appropriate.

This makes the code easier to read, and puts the reset of the DDIR_SYNC
latency buckets together with the other statements for DDIR_SYNC.

A follow up patch will also make use of this new helper function.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-13-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: increment members counter after call to sum_thread_stats()
Niklas Cassel [Thu, 3 Feb 2022 19:28:29 +0000 (19:28 +0000)]
stat: increment members counter after call to sum_thread_stats()

Increment ts->members after the call to sum_thread_stats(), just like how
it's done in client.c and gclient.c.

There is no reason why stat.c should increment ts->members before calling
sum_thread_stats(). Change stat.c so that it is consistent with client.c
and gclient.c. This way, sum_thread_stats() could actually make use of
ts->members (if it wanted to), since it is now being updated consistently.

No logical change, as currently, ts->members is only used in
show_thread_status_normal(), which is always called after the call to
sum_thread_stats().

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-12-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: use enum fio_ddir consistently
Niklas Cassel [Thu, 3 Feb 2022 19:28:28 +0000 (19:28 +0000)]
stat: use enum fio_ddir consistently

Most functions in stat.c uses enum fio_ddir dir both as a parameter
and as a local variable in functions.

int ddir is used in a very few places.

Convert the int ddir uses to enum fio_ddir dir so that the code is
consistent.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-11-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoexamples: add new cmdprio_bssplit format examples
Niklas Cassel [Thu, 3 Feb 2022 19:28:28 +0000 (19:28 +0000)]
examples: add new cmdprio_bssplit format examples

Add examples of the new cmdprio_bssplit format to cmdprio-bssplit.fio.

In this new format, a priority class and a priority level can be specified
in the cmdprio_bssplit entry itself.

Add the new cmdprio_bssplit format examples as new jobs, as the old format
is still supported.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-10-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agocmdprio: add support for a new cmdprio_bssplit entry format
Niklas Cassel [Thu, 3 Feb 2022 19:28:27 +0000 (19:28 +0000)]
cmdprio: add support for a new cmdprio_bssplit entry format

Add support for a new cmdprio_bssplit format, while keeping support for the
old format, by migrating to the split_parse_prio_ddir() parsing function.

In this new format, a priority class and priority level is defined inside
each entry itself. In comparison with the old format, the new format does
not restrict all entries to share the same priority class and priority
level.

Therefore, this new format is very useful if you need to submit I/Os with
multiple IO priority class + IO priority level combinations, e.g. when
testing or verifying an IO scheduler.

cmdprio will allocate a clat_prio_stat array that holds all unique
priorities (including the default priority). Finally, it will set the
clat_prio pointer in the struct thread_stat (td->ts.clat_prio) to the
newly allocated array.

We also add a clat_prio_stat index to io_u.h, that will inform which array
element (which priority value) this specific I/O was submitted with.
The clat_prio_stat index will be used by the stat.c code, to avoid a costly
search operation to find the correct array element to use, for each and
every add_sample().

Note that while this patch will send down the correct I/O pattern to the
drive (potentially using multiple different priorities), it will not
display the cmdprio_{bssplit,percentage} stats correctly until a later
commit in the series (which changes stat.c to report clat stats on a per
priority granularity). This was done to ease reviewing.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-9-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agooptions: add a parsing function for an additional cmdprio_bssplit format
Niklas Cassel [Thu, 3 Feb 2022 19:28:27 +0000 (19:28 +0000)]
options: add a parsing function for an additional cmdprio_bssplit format

The cmdprio_bssplit ioengine option for io_uring/libaio is currently parsed
using split_parse_ddir(). While this function works fine for parsing the
existing cmdprio_bssplit entry format, it forces every cmdprio_bssplit
entry to use the priority defined by cmdprio and cmdprio_class. This means
that there will only ever be at most two different priority values used in
the job.

To enable us to use more than two different priority values, add a new
parsing function, split_parse_prio_ddir(), that will support parsing the
existing cmdprio_bssplit entry format (blocksize/percentage), and a new
cmdprio_bssplit entry format (blocksize/percentage/prioclass/priolevel).

Since IO engines can be compiled as plugins, having the parse function in
options.c avoids potential problems with ioengines having different
versions of the same parsing function.

A follow up patch will change to the new parsing function.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-8-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoos: define min/max prio class and level for systems without ioprio
Niklas Cassel [Thu, 3 Feb 2022 19:28:26 +0000 (19:28 +0000)]
os: define min/max prio class and level for systems without ioprio

In order to avoid additional ifdef FIO_HAVE_IOPRIO_CLASS/FIO_HAVE_IOPRIO
from being added to the code, define IOPRIO_{MIN,MAX}_PRIO_CLASS and
IOPRIO_{MIN,MAX}_PRIO_CLASS as zero for systems without support for ioprio.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-7-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: add a new function to allocate a clat_prio_stat array
Niklas Cassel [Thu, 3 Feb 2022 19:28:26 +0000 (19:28 +0000)]
stat: add a new function to allocate a clat_prio_stat array

To be able to report clat stats on a per priority granularity (instead of
only high/low priority), we need a new function which allocates a
clat_prio_stat array. This array will hold the clat stats for all the
different priorities that will be used by the struct td.

The clat_prio_stat array will eventually replace io_u_plat_high_prio,
io_u_plat_low_prio, clat_high_prio_stat, and clat_low_prio_stat.

A follow up patch will convert stat.c to use the new array.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-6-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoclient/server: convert ss_data to use an offset instead of fixed position
Niklas Cassel [Thu, 3 Feb 2022 19:28:25 +0000 (19:28 +0000)]
client/server: convert ss_data to use an offset instead of fixed position

Store the location of the ss_data in the payload itself, rather than
assuming that it is always located at a fixed location, directly after
the cmd_ts_pdu data.

This is done as a cleanup patch in order to be able to handle
clat_prio_stats, which just like ss_data, may or may not be part of the
payload.

Server version is intentionally not incremented, as it will be incremented
in a later patch in the series. No need to bump it multiple times for the
same patch series.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-5-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: save the default ioprio in struct thread_stat
Niklas Cassel [Thu, 3 Feb 2022 19:28:25 +0000 (19:28 +0000)]
stat: save the default ioprio in struct thread_stat

To be able to report clat stats on a per priority granularity (instead of
only high/low priority), we need to be able to get the priority value that
was used for the stats in clat_stat.

When a thread is using a single priority (e.g. option prio/prioclass is
used (without any cmdprio options)), all the clat stats for this thread
will be stored in clat_stat. The problem with this is sum_thread_stats()
does not know the priority value that corresponds to the stats stored in
clat_stat.

Since we cannot access td->ioprio from sum_thread_stats(), simply mirror
td->ioprio inside struct thread_stat.

This way, sum_thread_stats() will be able to reuse the global clat stats
in clat_stat, without the need to duplicate the data for per priority
stats, in the case where there is only a single priority in use.

Server version is intentionally not incremented, as it will be incremented
in a later patch in the series. No need to bump it multiple times for the
same patch series.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-4-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agobackend: do ioprio_set() before calling the ioengine init callback
Niklas Cassel [Thu, 3 Feb 2022 19:28:24 +0000 (19:28 +0000)]
backend: do ioprio_set() before calling the ioengine init callback

To be able to report clat stats on a per priority granularity (instead of
only high/low priority), we need to do ioprio_set(), and the matching
td->ioprio assignment, before calling the io engine init callback.

When a thread is using more than a single priority (e.g. option
cmdprio_percentage is used), fio_cmdprio_init() will need to allocate and
initialize an array that will hold the clat stats for all the different
priorities that will be used by the struct td.

For fio_cmdprio_init() to be able to initialize a per priority clat array
properly, we need to assign td->ioprio before calling td_io_init().

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-3-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoinit: verify option lat_percentiles consistency for all jobs in group
Niklas Cassel [Thu, 3 Feb 2022 19:28:24 +0000 (19:28 +0000)]
init: verify option lat_percentiles consistency for all jobs in group

lat_percentiles is used to control if the high/low latency statistics
(which are saved in ts->io_u_plat_high_prio/ts->io_u_plat_low_prio)
should collect and display total latencies instead of completion latencies.

When doing group reporting, stat.c:__show_run_stats() happily overwrites
the dst ts with the setting of each job, which means that the summing can
take total lat samples for some jobs, and clat samples for some jobs, while
adding samples into the same group result.

The output summary will claim that the results are of whatever type the
final job in the group is set to.

To make sure that this cannot happen, verify that the option
lat_percentiles is consistent for all jobs in group.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-2-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoserver: fix formatting issue
Jens Axboe [Thu, 3 Feb 2022 22:28:16 +0000 (15:28 -0700)]
server: fix formatting issue

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'master' of https://github.com/blah325/fio
Jens Axboe [Thu, 3 Feb 2022 22:22:41 +0000 (15:22 -0700)]
Merge branch 'master' of https://github.com/blah325/fio

* 'master' of https://github.com/blah325/fio:
  Added a new windows only IO engine option “no_completion_thread”.
  Add Windows support for --server.
  Avoid client calls to recv() without prior poll()

2 years agoAdded a new windows only IO engine option “no_completion_thread”.
james rizzo [Thu, 16 Dec 2021 22:35:45 +0000 (15:35 -0700)]
Added a new windows only IO engine option “no_completion_thread”.

Without this option, Windows FIO creates a
completion polling thread for each worker thread. This also
requires an event queue for the completion thread to forward
completions to the worker thread. Polling directly improves
performance and better matches the linuxaio engine model.

Signed-off-by: james rizzo <james.rizzo@broadcom.com>
2 years agoMerge branch 'patch-1' of https://github.com/Nikratio/fio
Jens Axboe [Fri, 28 Jan 2022 21:50:51 +0000 (14:50 -0700)]
Merge branch 'patch-1' of https://github.com/Nikratio/fio

* 'patch-1' of https://github.com/Nikratio/fio:
  I/O size: fix description of filesize

2 years agoMakefile: build t/fio-dedupe only if zlib support is found
Vincent Fu [Fri, 28 Jan 2022 21:46:37 +0000 (21:46 +0000)]
Makefile: build t/fio-dedupe only if zlib support is found

df284fbdc23974c931865a8ddb7d171606b3c778 added zlib support as a
requirement for building fio-dedupe.

The current patch changes the Makefile to avoid trying to build
fio-dedupe when zlib support is not present.

Link: https://lore.kernel.org/fio/51b79acb-c314-143b-514c-a22ff9462829@gmail.com/T/#u
Reported-by: Professor Pro <annivation@gmail.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20220128214611.165312-1-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'docs' of https://github.com/vincentkfu/fio
Jens Axboe [Fri, 28 Jan 2022 20:12:13 +0000 (13:12 -0700)]
Merge branch 'docs' of https://github.com/vincentkfu/fio

* 'docs' of https://github.com/vincentkfu/fio:
  docs: update fio docs to pull from README.rst
  docs: rename README to README.rst
  Revert "Update README to markdown format"

2 years agodocs: update fio docs to pull from README.rst
Vincent Fu [Fri, 28 Jan 2022 19:13:23 +0000 (19:13 +0000)]
docs: update fio docs to pull from README.rst

doc/fio_doc.rst and doc/fio_man.rst originally included fio/README.
Change both to include fio/README.rst instead.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agodocs: rename README to README.rst
Vincent Fu [Fri, 28 Jan 2022 19:30:40 +0000 (14:30 -0500)]
docs: rename README to README.rst

GitHub can display reStructuredText. So just add the appropriate
extension to the README.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoRevert "Update README to markdown format"
Vincent Fu [Fri, 28 Jan 2022 19:29:26 +0000 (14:29 -0500)]
Revert "Update README to markdown format"

This reverts commit 82250ffc96497652b7f6f9b1b707ae1bee4d8f89.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agofio: use LDFLAGS when linking dynamic engines
Eric Sandeen [Wed, 26 Jan 2022 14:49:45 +0000 (08:49 -0600)]
fio: use LDFLAGS when linking dynamic engines

Without this, locally defined LDFLAGS won't be applied when
linking the dynamically loaded IO engines.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: link with libaio when necessary
Eric Sandeen [Tue, 25 Jan 2022 18:57:39 +0000 (12:57 -0600)]
t/io_uring: link with libaio when necessary

When CONFIG_LIBAIO is enabled, we need t/io_uring to link with it.
(libaio_LIBS only affects the aio engine, AFAICT.)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'rpma-add-support-for-File-System-DAX' of https://github.com/ldorau/fio
Jens Axboe [Wed, 26 Jan 2022 15:40:18 +0000 (08:40 -0700)]
Merge branch 'rpma-add-support-for-File-System-DAX' of https://github.com/ldorau/fio

* 'rpma-add-support-for-File-System-DAX' of https://github.com/ldorau/fio:
  rpma: add support for File System DAX
  rpma: RPMA engine requires librpma>=v0.10.0 with rpma_mr_advise()

2 years agorpma: add support for File System DAX
Wang, Long [Tue, 25 Jan 2022 09:18:14 +0000 (10:18 +0100)]
rpma: add support for File System DAX

File System DAX is handled in a different way than Device DAX:

1) In case of File System DAX, each thread uses a separate file
from this file system and no offset is needed. In case of Device DAX,
each thread uses a separate offset within the same Device DAX.

2) File System DAX requires rpma_mr_advise(3)(ibv_advise_mr(3))
to be called for the registered memory to avoid page faults
and degraded performance.

Ref: https://github.com/axboe/fio/issues/1238

Signed-off-by: Wang, Long <long1.wang@intel.com>
2 years agorpma: RPMA engine requires librpma>=v0.10.0 with rpma_mr_advise()
Lukasz Dorau [Mon, 24 Jan 2022 22:56:47 +0000 (23:56 +0100)]
rpma: RPMA engine requires librpma>=v0.10.0 with rpma_mr_advise()

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
2 years agoMerge branch 'master' of https://github.com/ben-ihelputech/fio
Jens Axboe [Fri, 21 Jan 2022 17:46:26 +0000 (10:46 -0700)]
Merge branch 'master' of https://github.com/ben-ihelputech/fio

* 'master' of https://github.com/ben-ihelputech/fio:
  Update README to markdown format

2 years agoUpdate README to markdown format
ben-ihelputech [Fri, 21 Jan 2022 15:01:13 +0000 (09:01 -0600)]
Update README to markdown format

- Updated README to README.md to make it look nicer when rendered on Github.

2 years agoiolog.c: Fix memory leak for blkparse case
Lukas Straub [Wed, 19 Jan 2022 21:14:40 +0000 (21:14 +0000)]
iolog.c: Fix memory leak for blkparse case

init_blkparse_read (load_blkparse previously) didn't free the
filename. Fix this by freeing it in the init_iolog function and
handling it for both init_iolog_read and init_blkparse_read.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/r/e4acf183ab789b7284bfa96089ebe1256e15f98d.1642626314.git.lukasstraub2@web.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoblktrace.c: Make thread-safe by removing local static variables
Lukas Straub [Wed, 19 Jan 2022 21:14:36 +0000 (21:14 +0000)]
blktrace.c: Make thread-safe by removing local static variables

Local static variables are not thread-safe. Make the functions in
blktrace.c safe by replacing them.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/r/b805bb3f6acf6c5b4d8811872c62af939aac62a7.1642626314.git.lukasstraub2@web.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoblktrace.c: Don't sleep indefinitely if there is a wrong timestamp
Lukas Straub [Wed, 19 Jan 2022 21:14:33 +0000 (21:14 +0000)]
blktrace.c: Don't sleep indefinitely if there is a wrong timestamp

Each of my traces have a single entry with a wrong timestamp
that causes a underflow followed by a infinite sleep.

Fix this by checking for underflow.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/r/a19b7ea899093c4c0ed98d2d9a310f2f0f01fddd.1642626314.git.lukasstraub2@web.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoblktrace.c: Don't hardcode direct-io
Lukas Straub [Wed, 19 Jan 2022 21:14:30 +0000 (21:14 +0000)]
blktrace.c: Don't hardcode direct-io

This is unexpected if one wants to test performance of a
standard filesystem (by pointing replay_redirect to a standard file)
with buffered io.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/r/239cc0c47c346408607772fb423aa5745a3779dd.1642626314.git.lukasstraub2@web.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agolinux-dev-lookup.c: Put the check for replay_redirect in the beginning
Lukas Straub [Wed, 19 Jan 2022 21:14:26 +0000 (21:14 +0000)]
linux-dev-lookup.c: Put the check for replay_redirect in the beginning

The machine may not have any block device nodes (like my dev container)
which makes this function fail despite replay_redirect being set.

Move the check to the beginning to fix this.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/r/0dd4b6407f7b7f5f15f1fcad409554ff339ffca1.1642626314.git.lukasstraub2@web.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoblktrace.c: Add support for read_iolog_chunked
Lukas Straub [Wed, 19 Jan 2022 21:14:23 +0000 (21:14 +0000)]
blktrace.c: Add support for read_iolog_chunked

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/r/d43a8a2d5fd23d9756cdcf280cd2f3572585f264.1642626314.git.lukasstraub2@web.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoiolog.c: Make iolog_items_to_fetch public
Lukas Straub [Wed, 19 Jan 2022 21:14:20 +0000 (21:14 +0000)]
iolog.c: Make iolog_items_to_fetch public

This function be needed in the next patch.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/r/81c9fbb31bbf0c487dc0ebff5eb85ca764fb14ef.1642626314.git.lukasstraub2@web.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoblktrace.c: Use file stream interface instead of fifo
Lukas Straub [Wed, 19 Jan 2022 21:14:16 +0000 (21:14 +0000)]
blktrace.c: Use file stream interface instead of fifo

Like in iolog.c use the file stream interface for accessing
the iolog file.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/r/5f52a20f95ebead7fa9ae8bce0acf8f0570219ca.1642626314.git.lukasstraub2@web.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agodocs: documentation for sg WRITE STREAM(16)
Vincent Fu [Mon, 15 Nov 2021 20:07:17 +0000 (20:07 +0000)]
docs: documentation for sg WRITE STREAM(16)

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20211115200807.117138-7-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agosg: allow fio to open and close streams for WRITE STREAM(16) commands
Vincent Fu [Mon, 15 Nov 2021 20:07:17 +0000 (20:07 +0000)]
sg: allow fio to open and close streams for WRITE STREAM(16) commands

If --stream_id=0 then fio will open a stream for WRITE STREAM(16) commands and
close the stream when the device file is closed.

Example:
./fio --name=test --filename=/dev/sdb --ioengine=sg --number_ios=1 --debug=file,io --sg_write_mode=write_stream --rw=randwrite
fio: set debug option file
fio: set debug option io
test: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=sg, iodepth=1
fio-3.27
Starting 1 process
file     1072297 setup files
file     1072297 get file size for 0x7f0306fa5110/0//dev/sdb
file     1072307 trying file /dev/sdb 290
file     1072307 fd open /dev/sdb
file     1072307 file not found in hash /dev/sdb
file     1072307 sgio_stream_control: opened stream 1
file     1072307 get file /dev/sdb, ref=0
io       1072307 drop page cache /dev/sdb
file     1072307 goodf=1, badf=2, ff=2b1
file     1072307 get_next_file_rr: 0x7f0306fa5110
file     1072307 get_next_file: 0x7f0306fa5110 [/dev/sdb]
file     1072307 get file /dev/sdb, ref=1
io       1072307 fill: io_u 0xb55700: off=0x35ef554000,len=0x1000,ddir=1,file=/dev/sdb
io       1072307 prep: io_u 0xb55700: off=0x35ef554000,len=0x1000,ddir=1,file=/dev/sdb
io       1072307 prep: io_u 0xb55700: ret=0
io       1072307 queue: io_u 0xb55700: off=0x35ef554000,len=0x1000,ddir=1,file=/dev/sdb
io       1072307 complete: io_u 0xb55700: off=0x35ef554000,len=0x1000,ddir=1,file=/dev/sdb
file     1072307 put file /dev/sdb, ref=2
file     1072307 close files
file     1072307 put file /dev/sdb, ref=1
file     1072307 sgio_stream_control: closed stream 1
file     1072307 fd close /dev/sdb
io       1072307 close ioengine sg
io       1072307 free ioengine sg

test: (groupid=0, jobs=1): err= 0: pid=1072307: Mon Aug 16 14:25:45 2021
  write: IOPS=200, BW=800KiB/s (819kB/s)(4096B/5msec); 0 zone resets
    clat (nsec): min=93339, max=93339, avg=93339.00, stdev= 0.00
     lat (nsec): min=96201, max=96201, avg=96201.00, stdev= 0.00
    clat percentiles (nsec):
     |  1.00th=[93696],  5.00th=[93696], 10.00th=[93696], 20.00th=[93696],
     | 30.00th=[93696], 40.00th=[93696], 50.00th=[93696], 60.00th=[93696],
     | 70.00th=[93696], 80.00th=[93696], 90.00th=[93696], 95.00th=[93696],
     | 99.00th=[93696], 99.50th=[93696], 99.90th=[93696], 99.95th=[93696],
     | 99.99th=[93696]
  lat (usec)   : 100=100.00%
  cpu          : usr=100.00%, sys=0.00%, ctx=2, majf=0, minf=20
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=0,1,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
  WRITE: bw=800KiB/s (819kB/s), 800KiB/s-800KiB/s (819kB/s-819kB/s), io=4096B (4096B), run=5-5msec

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20211115200807.117138-6-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agosg: add support for WRITE STREAM(16) commands
Vincent Fu [Mon, 15 Nov 2021 20:07:17 +0000 (20:07 +0000)]
sg: add support for WRITE STREAM(16) commands

Add the "write_stream" option to sg_write_mode to send WRITE STREAM(16)
commands. Use the new stream_id option to set the stream identifier.

Example:

sg_stream_ctl -o /dev/sdb
Assigned stream id: 1
./fio --name=test --filename=/dev/sdb --ioengine=sg --sg_write_mode=write_stream --stream_id=1 --rw=randwrite --time_based --runtime=10s
...
sg_stream_ctl -c --id=1 /dev/sdb

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20211115200807.117138-5-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agosg: improve sg_write_mode option names
Vincent Fu [Mon, 15 Nov 2021 20:07:17 +0000 (20:07 +0000)]
sg: improve sg_write_mode option names

There is a name collision for the sg_write_mode options for the WRITE AND
VERIFY and VERIFY commands. Deprecate the 'verify' option and use
'write_and_verify' instead. Do the same thing for 'same' and 'write_same' to
have a consistent naming scheme. The original option names are still supported
for backward compatibility but list them as deprecated.

Here are the new sg_write_mode options:

Option SCSI command
write WRITE (default)
write_and_verify WRITE AND VERIFY
verify (deprecated) WRITE AND VERIFY
write_same WRITE SAME
same (deprecated) WRITE SAME
write_same_ndob         WRITE SAME with NDOB flag set
verify_bytchk_00 VERIFY with BYTCHK set to 00
verify_bytchk_01 VERIFY with BYTCHK set to 01
verify_bytchk_11 VERIFY with BYTCHK set to 11

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20211115200807.117138-4-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agosg: add support for WRITE SAME(16) commands with NDOB flag set
Vincent Fu [Mon, 15 Nov 2021 20:07:17 +0000 (20:07 +0000)]
sg: add support for WRITE SAME(16) commands with NDOB flag set

Add the sg_write_mode option write_same_ndob to issue WRITE SAME(16) commands
with the no data output buffer flag set. This flag is not supported for WRITE
SAME(10). So all commands with this option will be WRITE SAME(16).

Also include an example job file.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20211115200807.117138-3-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agosg: add support for VERIFY command using write modes
Vincent Fu [Mon, 15 Nov 2021 20:07:17 +0000 (20:07 +0000)]
sg: add support for VERIFY command using write modes

fio does not have an explicit verify data direction and creating a new data
direction just for SCSI VERIFY commands probably is not worthwhile. The format
of SCSI VERIFY commands matches that of write operations since VERIFY commands
can include data transfer to the device. So it seems reasonable to have VERIFY
commands be accounted for as write operations by fio.

Use the sg_write_mode option to support SCSI VERIFY commands with different
BYTCHK values.

BYTCHK Description
00 No data is transferred to the device; device data is checked
01 Device data is compared with data transferred to device
11 Same as 01 except that only one sector of data is transferred to the
device and each sector specified in the verification extent is compared against
this transferred data.

Also update documentation and add a couple example jobs files.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20211115200807.117138-2-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: move unified=both mixed allocation and calculation to new helper
Niklas Cassel [Mon, 17 Jan 2022 15:50:54 +0000 (15:50 +0000)]
stat: move unified=both mixed allocation and calculation to new helper

When using unified_rw_reporting=both, we need to print both the
per ddir stats, as well as the mixed stats.

In order to print both, the regular printing functions are responsible
for printing the per ddir stats from the unmodified struct thread_stat,
and show_mixed_ddir_status(), show_mixed_ddir_status_terse()
or add_mixed_ddir_status_json() is responsible for calculating and
printing the mixed stats.

In order to keep the original struct thread_stat intact, these three
functions have to allocate a new local thread_stat, where the mixed ddir
result can be stored before printing.

Move the allocation and calculation of this new struct thread_stat to a
new helper function, so that the code is easier to follow.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20220117155045.311453-3-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: remove duplicated code in show_mixed_ddir_status()
Niklas Cassel [Mon, 17 Jan 2022 15:50:53 +0000 (15:50 +0000)]
stat: remove duplicated code in show_mixed_ddir_status()

When using unified_rw_reporting=mixed, show_ddir_status() is called,
and is solely responsible for printing the mixed stats.

When using unified_rw_reporting=both, show_ddir_status() is called
and prints the regular output, after that, show_mixed_ddir_status()
is called to print the mixed stats.

The way that show_mixed_ddir_status_terse() and
add_mixed_ddir_status_json() is implemented, is to alloc a new local ts
that will hold the mixed result, and then simply call the regular non-mixed
print function show_ddir_status_terse()/add_ddir_status_json() with this
local ts.

show_mixed_ddir_status() also allocates a new local ts, but fails to
initialize the lat percentiles and the percentile_list in the new local ts.
Therefore, show_mixed_ddir_status() has duplicated all the code from
show_ddir_status(), except that it uses the lat percentiles and the
percentile_list from the original ts.

Simplify show_mixed_ddir_status(), to behave in the same way as
show_mixed_ddir_status_terse() and add_mixed_ddir_status_json().

In other words, initialize the lat percentiles and the percentile_list in
the new local ts, and replace all the duplicated code with a simple call to
the regular non-mixed print function (show_ddir_status()).

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20220117155045.311453-2-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoinit: do not create lat logs when not needed
Damien Le Moal [Mon, 17 Jan 2022 02:11:27 +0000 (11:11 +0900)]
init: do not create lat logs when not needed

When any of the options disable_lat, disable_slat and disable_clat are
used, there is no need to create the lat log associated with the
disabled latency. In addition, when write_lat_log is also specified,
this change avoids the creation of empty latency log files.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20220117021127.9259-1-damien.lemoal@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: remove unnecessary bool parameter to sum_thread_stats()
Niklas Cassel [Mon, 10 Jan 2022 09:01:39 +0000 (09:01 +0000)]
stat: remove unnecessary bool parameter to sum_thread_stats()

We can deduce if it is the first struct io_stat src being added to the
struct io_stat dst by checking if the current amount of samples in dst
is zero.

Therefore, remove the bool parameter "first" to sum_stat().
Since sum_stat() was the only user of the bool parameter "first" to
the sum_thread_stats() function, we can remove it from sum_thread_stats()
as well.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220110090133.69955-1-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoengines/io_uring: don't set CQSIZE clamp unconditionally
Jens Axboe [Mon, 10 Jan 2022 02:34:27 +0000 (19:34 -0700)]
engines/io_uring: don't set CQSIZE clamp unconditionally

For older kernels without IORING_SETUP_CQSIZE, we'll get EINVAL if we
set it. Just retry the ring setup if that happens.

Link: https://github.com/axboe/fio/issues/1324
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'github-actions-i686' of https://github.com/vincentkfu/fio
Jens Axboe [Thu, 23 Dec 2021 23:27:33 +0000 (16:27 -0700)]
Merge branch 'github-actions-i686' of https://github.com/vincentkfu/fio

* 'github-actions-i686' of https://github.com/vincentkfu/fio:
  t/io_uring: fix help defaults for aio and random_io
  t/io_uring: fix 32-bit build warnings
  Revert "ci: temporarily remove linux-i686-gcc build"
  ci: workaround for problem with i686 builds

2 years agot/io_uring: fix help defaults for aio and random_io
Vincent Fu [Thu, 23 Dec 2021 21:08:09 +0000 (16:08 -0500)]
t/io_uring: fix help defaults for aio and random_io

The positions of the default values for aio and random_io were swapped
in the help message. Put the default values in their proper positions.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agot/io_uring: fix 32-bit build warnings
Vincent Fu [Tue, 21 Dec 2021 16:07:58 +0000 (11:07 -0500)]
t/io_uring: fix 32-bit build warnings

Also change the type for offset to long long since that's what is
expected by io_prep_pread.

Latency measurement for t/io_uring is actually broken on 32-bit builds
because iocb->data and io_event->data are 32-bit void pointers. So it is
not possible to fit both fileno and clock_index in there.

On a 32-bit build with 4-byte longs, the following warnings appear:

t/io_uring.c: In function ‘prep_more_ios_aio’:
t/io_uring.c:666:44: error: left shift count >= width of type [-Werror=shift-count-overflow]
  666 |    data |= ((unsigned long) s->clock_index << 32);
      |                                            ^~
t/io_uring.c: In function ‘reap_events_aio’:
t/io_uring.c:688:27: error: right shift count >= width of type [-Werror=shift-count-overflow]
  688 |    int clock_index = data >> 32;
      |                           ^~

Explicitly specify 64-bit types to resolve these warnings.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoRevert "ci: temporarily remove linux-i686-gcc build"
Vincent Fu [Sun, 19 Dec 2021 00:51:49 +0000 (19:51 -0500)]
Revert "ci: temporarily remove linux-i686-gcc build"

This reverts commit cea3243fb3bb44d541c2b3fb82ee45eb669b6fe6.

1420399f6620b417d9da4b801d3c049cf66e58f0 provides a work-around for the
problem with i686 builds. So we can now re-enable them.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoci: workaround for problem with i686 builds
Vincent Fu [Sun, 19 Dec 2021 00:46:51 +0000 (19:46 -0500)]
ci: workaround for problem with i686 builds

GitHub Actions currently has package dependency problems with some i386
packages. The work-around suggested in

https://github.com/actions/virtual-environments/issues/4620

appears to resolve the issue for our builds.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoFio 3.29 fio-3.29
Jens Axboe [Sat, 18 Dec 2021 14:09:32 +0000 (07:09 -0700)]
Fio 3.29

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agostat: code cleanup and leak free
Jens Axboe [Sat, 18 Dec 2021 14:06:12 +0000 (07:06 -0700)]
stat: code cleanup and leak free

This file is somewhat of a mess. Only functional change is the free of
ts_lcl in show_mixed_ddir_status(), rest is just a vague attempt at
bringing some sanity back into this file.

Fixes: https://github.com/axboe/fio/issues/1319
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoAdd Windows support for --server.
james rizzo [Thu, 16 Dec 2021 22:08:50 +0000 (15:08 -0700)]
Add Windows support for --server.

This required working around two calls to fork()

The first fork() was in accept_loop() where it creates a new process
to work on handle_connection(). This change set uses Window's
CreateProcess() in place of fork(). In order to support this,
it duplicates the socket connection via WSADuplicateSocket()
and passes the resulting WSAPROTOCOL_INFO to the process via a
named pipe. The pipe name is then passed to the process via a
new command line argument(--server-internal).

The second fork() was in handle_run_cmd() where it creates a new
process to work on fio_backend_thread(). This change set runs
fio_backend_thread() as a thread via pthread_create() instead of a
forked process.

There is also some supporting work in the monitoring of
spawned processes/threads in fio_server_check_conns() and
fio_server_check_jobs().

Signed-off-by: james rizzo <james.rizzo@broadcom.com>
2 years agoAvoid client calls to recv() without prior poll()
james rizzo [Thu, 16 Dec 2021 20:13:51 +0000 (13:13 -0700)]
Avoid client calls to recv() without prior poll()

Signed-off-by: james rizzo <james.rizzo@broadcom.com>
2 years agostat: sum sync_stat before reassigning bool first
Niklas Cassel [Wed, 15 Dec 2021 12:26:04 +0000 (12:26 +0000)]
stat: sum sync_stat before reassigning bool first

Currently, sum_stat(&dst->sync_stat, &src->sync_stat, first, false)
is called after the summing the stats on a per ddir level.

The for-loop that sums the stats on a per ddir level will reassign
bool first to false when unified_rw_rep is used.

This means that the call to sum_stat() for sync_stat will be called
with first == false, even when it is the first sync_stat being summed,
leading to incorrect sync_stat calculations when unified_rw_rep is used.

In order to ensure that sync_stat is not incorrectly affected by the
reassignment of first, move the sync_stat summing before the for-loop.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211215122557.95600-1-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoSupport for alternate epochs in fio log files
aggieNick02 [Tue, 14 Dec 2021 19:56:58 +0000 (13:56 -0600)]
Support for alternate epochs in fio log files

Add options log_alternate_epoch and log_alternate_epoch_clock_id. This
is similar to the log_unix_epoch option. This resolves the issue raised
in Issue #1314

log_alternate_epoch, if true, causes log files to use the same epoch
used used by the clock_id parameter to the unix clock_gettime function,
where clock_id is specified by the log_alternate_epoch_clock_id option.

This is particularly useful as it allows us to specify a clock id like
CLOCK_MONOTONIC_RAW, which is natural for synchronizing log files
between processes. The current log_unix_epoch is problematic for that
purpose because that clock is not monotonic or continuous.

It turns out that log_unix_epoch is actually equivalent to
log_alternate_epoch with log_alternate_epoch_clock_id set to
CLOCK_REALTIME=0. Since this is the default value of the
log_alternate_epoch_clock_id option anyways, we treat
log_alternate_epoch and log_unix_epoch as equivalent in functionality,
retaining the latter to avoid breaking existing clients.

Signed-off-by: Nick Neumann <nick@pcpartpicker.com>
2 years agot/zbd: Avoid inappropriate blkzone command call in zone_cap_bs
Shin'ichiro Kawasaki [Tue, 14 Dec 2021 01:24:13 +0000 (10:24 +0900)]
t/zbd: Avoid inappropriate blkzone command call in zone_cap_bs

When the script test-zbd-support is run for regular block devices or
SG nodes, blkzone command shall not be called. However, zone_cap_bs()
helper function calls the command regardless of the zone model or
device type, and results in error messages such as "unable to determine
zone size" or "not a block device". Avoid the command call by returning
the zone size argument passed to this function when the test device is
a regular block device or a SG node.

Fixes: 1ae82d673cf5 ("t/zbd: Align block size to zone capacity")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-13-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: introduce zbd_offset_to_zone() helper
Damien Le Moal [Tue, 14 Dec 2021 01:24:12 +0000 (10:24 +0900)]
zbd: introduce zbd_offset_to_zone() helper

Introduce the helper function zbd_offset_to_zone() to get a zone
structure using a file offset. In many functions, this replaces the
two line code pattern:

zone_idx = zbd_offset_to_zone_idx(f, offset);
z = zbd_get_zone(f, zone_idx);

with a single line of code:

z = zbd_offset_to_zone(f, offset);

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-12-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: rename get_zone()
Damien Le Moal [Tue, 14 Dec 2021 01:24:11 +0000 (10:24 +0900)]
zbd: rename get_zone()

Rename get_zone() to zbd_get_zone() to be consistent with the naming
pattern of most zbd functions.

No functional changes.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-11-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: rename zbd_zone_idx() and zbd_zone_nr()
Damien Le Moal [Tue, 14 Dec 2021 01:24:10 +0000 (10:24 +0900)]
zbd: rename zbd_zone_idx() and zbd_zone_nr()

Rename zbd_zone_idx() to zbd_offset_to_zone_idx() to make it clear that
the argument determining the zone is a file offset. To be consistent,
rename zbd_zone_nr() to zbd_zone_idx() to avoid confusion with a number
of zones. While at it, have both functions return value be of the same
unsigned int type.

No functional changes.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-10-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: simplify zbd_open_zone()
Damien Le Moal [Tue, 14 Dec 2021 01:24:09 +0000 (10:24 +0900)]
zbd: simplify zbd_open_zone()

Similarly to zbd_close_zone(), directly pass a pointer to a zone
information structure to zbd_open_zone() instead of a zone number.

No functional changes.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-9-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: simplify zbd_close_zone()
Damien Le Moal [Tue, 14 Dec 2021 01:24:08 +0000 (10:24 +0900)]
zbd: simplify zbd_close_zone()

Change the interface of zbd_close_zone() to directly use a pointer to a
zone information structure as all callers already have this information.
Also do nothing for zones that are not marked as open instead of
figuring out this fact by searching the array of open zones.

No functional changes.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-8-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: fix code style issues
Damien Le Moal [Tue, 14 Dec 2021 01:24:07 +0000 (10:24 +0900)]
zbd: fix code style issues

Avoid overly long lines, remove unnecessary curly brackets and add blank
lines to make the code more readable.

No functional changes.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-7-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: introduce zbd_zone_align_file_sizes() helper
Damien Le Moal [Tue, 14 Dec 2021 01:24:06 +0000 (10:24 +0900)]
zbd: introduce zbd_zone_align_file_sizes() helper

Move the code for the innermost loop of the function zbd_verify_sizes()
to the new helper function zbd_zone_align_file_sizes(). This helper
avoids large indentation of the code in zbd_verify_sizes() and makes
the code easier to read.

No functional changes.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-6-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: remove is_zone_open() helper
Damien Le Moal [Tue, 14 Dec 2021 01:24:05 +0000 (10:24 +0900)]
zbd: remove is_zone_open() helper

The helper function is_zone_open() is useless as a each zone has an open
flag indicating if it is part of the array of open zones. Remove this
function code and use the zone open flag in zbd_open_zone().

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-5-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: move and cleanup code
Damien Le Moal [Tue, 14 Dec 2021 01:24:04 +0000 (10:24 +0900)]
zbd: move and cleanup code

Move zone manipulation helper functions at the beginning of the zbd.c
file to avoid forward declarations and to group these functions
together apart from the IO manipulation functions.
Also fix function comments.

No functional changes.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-4-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agozbd: define local functions as static
Damien Le Moal [Tue, 14 Dec 2021 01:24:03 +0000 (10:24 +0900)]
zbd: define local functions as static

Define zbd_get_zoned_model(), zbd_report_zones(), zbd_reset_wp() and
zbd_get_max_open_zones() as static since these functions are used
locally only.

No functional changes.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-3-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agofio: Improve documentation of ignore_zone_limits option
Damien Le Moal [Tue, 14 Dec 2021 01:24:02 +0000 (10:24 +0900)]
fio: Improve documentation of ignore_zone_limits option

In the manual pages, change the description of the option
ignore_zone_limits to its action when set, instead of the confusing text
describing what happens when it is not set. Also add the description
of this option in the HOWTO file as it is missing.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-2-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoci: use macos 11 in virtual environment
Niklas Cassel [Tue, 14 Dec 2021 11:18:04 +0000 (11:18 +0000)]
ci: use macos 11 in virtual environment

GitHub Actions was recently enabled in commit ce1b5612ce99 ("ci: add CI
via GitHub Actions").

The commit has a AuthorDate of 2020.

The commit mentions that it uses macOS 10.15 rather than 11.0 because
11.0 is only private preview.

This was true in 2020, but looking at:
https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners

macos-11 is no longer marked as private preview, so let's use it in the
virtual environment.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214111756.52968-2-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoci: temporarily remove linux-i686-gcc build
Niklas Cassel [Tue, 14 Dec 2021 11:18:03 +0000 (11:18 +0000)]
ci: temporarily remove linux-i686-gcc build

GitHub Actions was recently enabled in commit ce1b5612ce99 ("ci: add CI
via GitHub Actions").

The new CI configuration was not properly tested before being merged,
as the linux-i686-gcc build currently fails for the master branch:
https://github.com/axboe/fio/actions

The problem appears to be related to ci/actions-install.sh wanting to
install broken packages on linux-i686-gcc.

The new CI configuration will also cause fio forks on GitHub to trigger
a GitHub Action (inside the forked repo) for every push.

Since the linux-i686-gcc build currently fails, this will currently cause
error emails to be sent out for every push to a forked repo.

In order to avoid spamming everyone who has forked fio on GitHub, let's
temporarily remove the linux-i686-gcc build until ci/actions-install.sh
specifies a working list of packages. Once that is done, this commit can
simply be reverted.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214111756.52968-1-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoUpdate comments about availability of fdatasync().
Thomas Munro [Sat, 11 Dec 2021 12:25:38 +0000 (01:25 +1300)]
Update comments about availability of fdatasync().

FreeBSD 11 added fdatasync(2), in 2016.

Signed-off-by: Thomas Munro <thomas.munro@gmail.com>
2 years agoMerge branch 'github-actions' of https://github.com/sitsofe/fio
Jens Axboe [Fri, 10 Dec 2021 18:08:26 +0000 (11:08 -0700)]
Merge branch 'github-actions' of https://github.com/sitsofe/fio

* 'github-actions' of https://github.com/sitsofe/fio:
  ci: retire travis configuration
  ci: add CI via GitHub Actions

2 years agoioengines: libzbc: disable libzbc block backend driver
Damien Le Moal [Fri, 10 Dec 2021 01:20:41 +0000 (10:20 +0900)]
ioengines: libzbc: disable libzbc block backend driver

libzbc includes 3 different internal backend drivers:
1) The block backend: this backend relies on the kernel SMR support and
   uses regular system calls.
2) The SCSI backend: this is a SG passthrough driver for SAS drives and
   for SATA drives accessible through an SMR compliant SAT (SCSI-to-ATA
   translation layer).
3) The ATA backend: this is a SG passthrough driver for SATA drives not
   handled by the system SAT (either kernel or HBA SAT)

libzbc automatically selects the internal backend driver, using the
first one that is detected as functional (tested in the same order shown
above).

When running on an SMR enabled system (SMR compliant HBA and kernel with
zoned block device support enabled), any fio job using the libzbc IO
engine will thus end up using the regular kernel IO path. This is silly:
for this IO path, the libaio or psync IO engines are far better (less
overhead and more functionalities). The libzbc IO engine should be
restricted to be a passthrough engine only, similarly to the sg engine.

Fix the libzbc engine to not allow the use of libzbc block backend
driver by removing the ZBC_O_DRV_BLOCK flag when opening the device.

Also adjust the test script t/zbd/run-tests-against-nullb to remove the
-l option to force the use of the libzbc IO engine as it will not work
anymore (since the nullb device is neither a SCSI nor an ATA device).

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20211210012041.310670-1-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'arm-detect-pmull' of https://github.com/sitsofe/fio
Jens Axboe [Mon, 6 Dec 2021 20:26:52 +0000 (13:26 -0700)]
Merge branch 'arm-detect-pmull' of https://github.com/sitsofe/fio

* 'arm-detect-pmull' of https://github.com/sitsofe/fio:
  os: detect PMULL support before enabling accelerated crc32c on ARM