fio.git
2 years agoiolog: add version 3 to support timestamp-based replay
Mohamad Gebai [Thu, 7 Apr 2022 17:40:29 +0000 (10:40 -0700)]
iolog: add version 3 to support timestamp-based replay

Version 3 format looks as follows:

    timestamp filename action offset length

All file and IO actions must have timestamps, including 'add'. The 'wait'
action is not allowed with version 3 so that we can leave all timing
functionality to timestamps.

Signed-off-by: Mohamad Gebai <mogeb@fb.com>
Link: https://lore.kernel.org/r/20220407174031.599117-2-mogeb@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoFio 3.30 fio-3.30
Jens Axboe [Wed, 6 Apr 2022 23:10:00 +0000 (17:10 -0600)]
Fio 3.30

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agosmalloc: fix ptr address in redzone error message
Vincent Fu [Tue, 5 Apr 2022 17:32:49 +0000 (17:32 +0000)]
smalloc: fix ptr address in redzone error message

sfree_check_redzone is passed a pointer to the address of the *header*
of an allocated block. This does not match the address of any of the
buffers returned by smalloc. Adjust the value printed out to refer to
the address returned by smalloc associated with the header in question.
This makes debugging easier because it allows us to more easily identify
the buffer where over-/under-run occurred.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoRename 'fallthrough' attribute to 'fio_fallthrough'
Jens Axboe [Wed, 30 Mar 2022 23:31:36 +0000 (17:31 -0600)]
Rename 'fallthrough' attribute to 'fio_fallthrough'

fallthrough is reserved in C++, so this causes issues with C++
programs pulling in the fio.h -> compiler.h header.

Rename it to something fio specific instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'status-interval-finished-jobs' of https://github.com/mmkayPL/fio
Jens Axboe [Tue, 29 Mar 2022 12:30:44 +0000 (06:30 -0600)]
Merge branch 'status-interval-finished-jobs' of https://github.com/mmkayPL/fio

* 'status-interval-finished-jobs' of https://github.com/mmkayPL/fio:
  Handle finished jobs when using status-interval

2 years agoHandle finished jobs when using status-interval
Kozlowski Mateusz [Tue, 29 Mar 2022 09:27:03 +0000 (11:27 +0200)]
Handle finished jobs when using status-interval

stat: When printing job stats with status-interval, don't keep adding values to
the total runtime if the jobs are already finished. This should fix the printing
of the intermediate runtime/average BW etc.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
2 years agoMerge branch 'master' of https://github.com/cccheng/fio
Jens Axboe [Mon, 28 Mar 2022 12:43:56 +0000 (06:43 -0600)]
Merge branch 'master' of https://github.com/cccheng/fio

* 'master' of https://github.com/cccheng/fio:
  Fix compile error of GCC 4

2 years agoFix compile error of GCC 4
Chung-Chiang Cheng [Mon, 28 Mar 2022 06:47:25 +0000 (14:47 +0800)]
Fix compile error of GCC 4

gcc-4.9.3 doesn't recognize __has_attribute(__fallthrough__) and reports
the following error.

  CC crc/crc32c-arm64.o
  In file included from crc/../os/../file.h:5:0,
                   from crc/../os/os-linux.h:32,
                   from crc/../os/os.h:39,
                   from crc/crc32c-arm64.c:2:
  crc/../os/../compiler/compiler.h:74:20: error: missing binary operator before token "("
  Makefile:501: recipe for target 'crc/crc32c-arm64.o' failed
  make: *** [crc/crc32c-arm64.o] Error 1

Signed-off-by: Chung-Chiang Cheng <cccheng@synology.com>
2 years agoMerge branch 'github-1372' of https://github.com/vincentkfu/fio
Jens Axboe [Thu, 24 Mar 2022 16:11:34 +0000 (10:11 -0600)]
Merge branch 'github-1372' of https://github.com/vincentkfu/fio

* 'github-1372' of https://github.com/vincentkfu/fio:
  io_u: produce bad offsets for some time_based jobs

2 years agoio_u: produce bad offsets for some time_based jobs
Vincent Fu [Wed, 23 Mar 2022 22:22:37 +0000 (18:22 -0400)]
io_u: produce bad offsets for some time_based jobs

Allow get_next_seq_offset to produce bad offsets for time_based jobs
when fio is accessing more than one file. Otherwise fio will not skip to
the next file once the current one is done.

Fixes: https://github.com/axboe/fio/issues/1372

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoengines/null: use correct -include
Jens Axboe [Sun, 20 Mar 2022 15:31:20 +0000 (09:31 -0600)]
engines/null: use correct -include

Fixes: cef0a8357b3f ("engines/null: update external engine compilation")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'master' of https://github.com/jnoc/fio
Jens Axboe [Sun, 20 Mar 2022 14:07:31 +0000 (08:07 -0600)]
Merge branch 'master' of https://github.com/jnoc/fio

* 'master' of https://github.com/jnoc/fio:
  Added citation.cff for easy APA/BibTeX citation directly from the Github repository

2 years agoAdded citation.cff for easy APA/BibTeX citation directly from the Github repository
Jonathon Carter [Sun, 20 Mar 2022 02:56:50 +0000 (02:56 +0000)]
Added citation.cff for easy APA/BibTeX citation directly from the Github repository

Signed-off-by: Jonathon Carter <hello@jcarter.uk>
2 years agoengines/null: update external engine compilation
Jens Axboe [Sun, 20 Mar 2022 13:22:33 +0000 (07:22 -0600)]
engines/null: update external engine compilation

Everything needs to include config-host.h, and make sure that the C++
side uses the right type for the queue op.

Fixes: https://github.com/axboe/fio/issues/1371
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'flags-fix' of https://github.com/albertofaria/fio
Jens Axboe [Tue, 15 Mar 2022 23:21:41 +0000 (17:21 -0600)]
Merge branch 'flags-fix' of https://github.com/albertofaria/fio

* 'flags-fix' of https://github.com/albertofaria/fio:
  Properly encode engine flags in thread_data::flags

2 years agoProperly encode engine flags in thread_data::flags
Alberto Faria [Tue, 15 Mar 2022 21:06:39 +0000 (21:06 +0000)]
Properly encode engine flags in thread_data::flags

We have 16 engine flags and an 18-bit shift, so cast engine flags to
unsigned long long before shifting to avoid dropping
FIO_ASYNCIO_SYNC_TRIM and FIO_NO_OFFLOAD.

Also make thread_data::flags unsigned long long to ensure it fits all
flags even when longs are 32 bit, and fix TD_ENG_FLAG_MASK.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2 years agot/dedupe: ensure that 'ret' is initialized
Jens Axboe [Fri, 11 Mar 2022 13:15:53 +0000 (06:15 -0700)]
t/dedupe: ensure that 'ret' is initialized

Fixes: 16b1e2456234 ("t/dedupe: handle errors more gracefully")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/dedupe: handle errors more gracefully
Jens Axboe [Fri, 11 Mar 2022 12:09:20 +0000 (05:09 -0700)]
t/dedupe: handle errors more gracefully

Don't assert for a deflate error, properly check for it and pass it
back up the stack so we can abort the thread.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'fuzz-cleanup' of https://github.com/vincentkfu/fio
Jens Axboe [Fri, 11 Mar 2022 02:11:24 +0000 (19:11 -0700)]
Merge branch 'fuzz-cleanup' of https://github.com/vincentkfu/fio

* 'fuzz-cleanup' of https://github.com/vincentkfu/fio:
  fuzz: avoid building t/fuzz/parse_ini by default

2 years agot/io_uring: only enable sync if we have preadv2
Jens Axboe [Fri, 11 Mar 2022 02:09:56 +0000 (19:09 -0700)]
t/io_uring: only enable sync if we have preadv2

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agofuzz: avoid building t/fuzz/parse_ini by default
Vincent Fu [Fri, 11 Mar 2022 00:45:46 +0000 (19:45 -0500)]
fuzz: avoid building t/fuzz/parse_ini by default

With a vanilla build t/fuzz/parse_ini will segfault because the symbol
FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is not defined. If the symbol
FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is defined, fio won't tear down
shared memory on program termination. Not tearing down shared memory is
necessary for t/fuzz/parse_ini to work correctly.

Don't build t/fuzz/parse_ini unless CFLAGS contains
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
2 years agoMerge branch 'improvement/enable-asan' of https://github.com/dpronin/fio
Jens Axboe [Fri, 11 Mar 2022 00:50:30 +0000 (17:50 -0700)]
Merge branch 'improvement/enable-asan' of https://github.com/dpronin/fio

* 'improvement/enable-asan' of https://github.com/dpronin/fio:
  ASAN enabling when configuring

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'improvement/prevent-sigsegv-when-dup-files' of https://github.com/dpron...
Jens Axboe [Fri, 11 Mar 2022 00:48:01 +0000 (17:48 -0700)]
Merge branch 'improvement/prevent-sigsegv-when-dup-files' of https://github.com/dpronin/fio

* 'improvement/prevent-sigsegv-when-dup-files' of https://github.com/dpronin/fio:
  improvements in dup_files function

2 years agoMerge branch 'refactoring/configure' of https://github.com/dpronin/fio
Jens Axboe [Fri, 11 Mar 2022 00:47:44 +0000 (17:47 -0700)]
Merge branch 'refactoring/configure' of https://github.com/dpronin/fio

* 'refactoring/configure' of https://github.com/dpronin/fio:
  configure script refactoring

2 years agoMerge branch 'master' of https://github.com/dpronin/fio
Jens Axboe [Fri, 11 Mar 2022 00:46:51 +0000 (17:46 -0700)]
Merge branch 'master' of https://github.com/dpronin/fio

* 'master' of https://github.com/dpronin/fio:
  fixed memory leak detected by ASAN

2 years agoASAN enabling when configuring
Denis Pronin [Thu, 10 Mar 2022 11:15:40 +0000 (14:15 +0300)]
ASAN enabling when configuring

introduced opportunity for a user to enable ASAN for the compiler
when calling 'configure' script using '--enable-asan' option

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
2 years agofixed memory leak detected by ASAN
Denis Pronin [Wed, 9 Mar 2022 16:41:45 +0000 (19:41 +0300)]
fixed memory leak detected by ASAN

release memory occupied for td->files for each thread_data
in the parent process

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
2 years agoimprovements in dup_files function
Denis Pronin [Thu, 10 Mar 2022 10:34:53 +0000 (13:34 +0300)]
improvements in dup_files function

cleared allocation of td->files when duplicating files,
call 'assert', before iterating over original thread_data,
that prevents possible segmentation fault when duplicating files

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
2 years agoconfigure script refactoring
Denis Pronin [Thu, 10 Mar 2022 10:16:41 +0000 (13:16 +0300)]
configure script refactoring

tabs are replaced by whitespaces in help page

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
2 years agoMerge branch 'master' of https://github.com/dpronin/fio
Jens Axboe [Wed, 9 Mar 2022 13:20:31 +0000 (06:20 -0700)]
Merge branch 'master' of https://github.com/dpronin/fio

* 'master' of https://github.com/dpronin/fio:
  - freeing job_sections array of strings upon freeing each its item in init.c

2 years agoMerge branch 'fix/asan-memleak-forkdata' of https://github.com/dpronin/fio
Jens Axboe [Wed, 9 Mar 2022 13:19:44 +0000 (06:19 -0700)]
Merge branch 'fix/asan-memleak-forkdata' of https://github.com/dpronin/fio

* 'fix/asan-memleak-forkdata' of https://github.com/dpronin/fio:
  - fixed memory leak in parent process detected by ASAN when forking and not freeing memory in the parent process allocated for fork_data

2 years agoMerge branch 'fix/asan-memleak' of https://github.com/dpronin/fio
Jens Axboe [Wed, 9 Mar 2022 13:18:42 +0000 (06:18 -0700)]
Merge branch 'fix/asan-memleak' of https://github.com/dpronin/fio

* 'fix/asan-memleak' of https://github.com/dpronin/fio:
  - fixed memory leak, which is happening when parsing options, claimed by ASAN

2 years ago- fixed memory leak in parent process detected by ASAN when forking and not freeing...
Denis Pronin [Wed, 9 Mar 2022 12:37:01 +0000 (15:37 +0300)]
- fixed memory leak in parent process detected by ASAN when forking and not freeing memory in the parent process allocated for fork_data

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
2 years ago- fixed memory leak, which is happening when parsing options, claimed by ASAN
Denis Pronin [Wed, 9 Mar 2022 11:53:43 +0000 (14:53 +0300)]
- fixed memory leak, which is happening when parsing options, claimed by ASAN

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
2 years ago- freeing job_sections array of strings upon freeing each its item in init.c
Denis Pronin [Wed, 9 Mar 2022 10:03:36 +0000 (13:03 +0300)]
- freeing job_sections array of strings upon freeing each its item in init.c

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
2 years agoMerge branch 'master' of https://github.com/dpronin/fio
Jens Axboe [Tue, 8 Mar 2022 23:42:37 +0000 (16:42 -0700)]
Merge branch 'master' of https://github.com/dpronin/fio

* 'master' of https://github.com/dpronin/fio:
  - fixed typo in configure script

2 years ago- fixed typo in configure script
Denis Pronin [Tue, 8 Mar 2022 17:34:25 +0000 (20:34 +0300)]
- fixed typo in configure script

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
2 years agoMakefile: get rid of fortify source
Jens Axboe [Mon, 7 Mar 2022 16:16:39 +0000 (09:16 -0700)]
Makefile: get rid of fortify source

Haven't seen anything useful come out of it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: add missing CR
Jens Axboe [Mon, 7 Mar 2022 16:11:40 +0000 (09:11 -0700)]
t/io_uring: add missing CR

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: support using preadv2
Jens Axboe [Mon, 7 Mar 2022 16:10:36 +0000 (09:10 -0700)]
t/io_uring: support using preadv2

Just for comparison for sync workloads, similarly to how we have support
for aio.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: add support for registering the ring fd
Jens Axboe [Mon, 7 Mar 2022 16:07:06 +0000 (09:07 -0700)]
t/io_uring: add support for registering the ring fd

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoio_uring.h: sync with 5.18 kernel bits
Jens Axboe [Mon, 7 Mar 2022 16:01:49 +0000 (09:01 -0700)]
io_uring.h: sync with 5.18 kernel bits

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: change fatal map buffers condition with multiple files
Jens Axboe [Mon, 7 Mar 2022 16:00:14 +0000 (09:00 -0700)]
t/io_uring: change fatal map buffers condition with multiple files

It _may_ not work with multiple files/devices, but for most common
cases it will. Just allow it for now with a warning.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: change map buffers registration opcode
Jens Axboe [Mon, 7 Mar 2022 15:59:22 +0000 (08:59 -0700)]
t/io_uring: change map buffers registration opcode

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agowindowsaio: open file for write if we have syncs
Jens Axboe [Sat, 26 Feb 2022 17:43:20 +0000 (10:43 -0700)]
windowsaio: open file for write if we have syncs

Windows wants the file opened for write if we do a file sync, so
ensure we do that if we have syncs.

Fixes: https://github.com/axboe/fio/issues/1352
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoAdd TD_F_SYNCS thread flag
Jens Axboe [Sat, 26 Feb 2022 17:42:01 +0000 (10:42 -0700)]
Add TD_F_SYNCS thread flag

It's not enough to just track writes, some operating systems require
a file to be opened for write to issue a file sync. Which does kind
of make sense...

Add such a flag and set it for iolog/blktrace replay, if we see a sync
in there.

This does mean we need to bump the IO engine version, as the engine
flags need to get shifted.

Link: https://github.com/axboe/fio/issues/1352
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'master' of https://github.com/bvanassche/fio
Jens Axboe [Thu, 24 Feb 2022 19:40:19 +0000 (12:40 -0700)]
Merge branch 'master' of https://github.com/bvanassche/fio

* 'master' of https://github.com/bvanassche/fio:
  Fix three compiler warnings

2 years agoFix three compiler warnings
Bart Van Assche [Thu, 24 Feb 2022 19:05:41 +0000 (11:05 -0800)]
Fix three compiler warnings

Fix three occurrences of the following clang compiler warning:

warning: suggest braces around initialization of subobject [-Wmissing-braces]

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2 years agoio_uring: use syscall helpers for the hot path
Jens Axboe [Mon, 21 Feb 2022 16:43:48 +0000 (09:43 -0700)]
io_uring: use syscall helpers for the hot path

The only real hot system call here is the io_uring_enter(2) call,
as that'll happen during the IO submission/completion parts. The rest
are just setup function calls, we don't really care about those.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agox86-64: add system call definitions
Jens Axboe [Mon, 21 Feb 2022 16:43:15 +0000 (09:43 -0700)]
x86-64: add system call definitions

Avoid a libc function call, just define our own syscall wrappers for
this architecture. Lifted from liburing.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoaarch64: add system call definitions
Jens Axboe [Mon, 21 Feb 2022 16:41:53 +0000 (09:41 -0700)]
aarch64: add system call definitions

Avoid a libc function call, just define our own syscall wrappers for
this architecture. Lifted from liburing.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'genfio-tempfile' of https://github.com/scop/fio
Jens Axboe [Sun, 20 Feb 2022 19:39:11 +0000 (12:39 -0700)]
Merge branch 'genfio-tempfile' of https://github.com/scop/fio

* 'genfio-tempfile' of https://github.com/scop/fio:
  genfio: fix temporary file handling

2 years agoMerge branch 'spelling' of https://github.com/scop/fio
Jens Axboe [Sun, 20 Feb 2022 19:28:51 +0000 (12:28 -0700)]
Merge branch 'spelling' of https://github.com/scop/fio

* 'spelling' of https://github.com/scop/fio:
  Spelling and grammar fixes

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'which-command-v-type-P' of https://github.com/scop/fio
Jens Axboe [Sun, 20 Feb 2022 19:26:52 +0000 (12:26 -0700)]
Merge branch 'which-command-v-type-P' of https://github.com/scop/fio

* 'which-command-v-type-P' of https://github.com/scop/fio:
  ci, t, tools: use `command` and `type` instead of `which`

2 years agoSpelling and grammar fixes
Ville Skyttä [Thu, 4 Nov 2021 07:39:32 +0000 (09:39 +0200)]
Spelling and grammar fixes

Signed-off-by: Ville Skyttä <ville.skytta@upcloud.com>
2 years agoci, t, tools: use `command` and `type` instead of `which`
Ville Skyttä [Thu, 4 Nov 2021 07:30:28 +0000 (09:30 +0200)]
ci, t, tools: use `command` and `type` instead of `which`

`which` is not POSIX, and cannot be assumed to installed everywhere.

`command -v` is available in POSIX and its predecessors at least since
1994: https://pubs.opengroup.org/onlinepubs/7908799/
It can be used as a replacement for `which` in a number of occurrences
in fio.

For bash scripts, `type -P` is available as a builtin replacement for
`which` and its $PATH search semantics.

Signed-off-by: Ville Skyttä <ville.skytta@upcloud.com>
2 years agogenfio: fix temporary file handling
Ville Skyttä [Tue, 2 Nov 2021 21:41:00 +0000 (23:41 +0200)]
genfio: fix temporary file handling

As a side effect, the template temp file is no longer left behind, as
a unique filename is used for it on each run.

Use the same method of figuring out the temp dir as in
check_status_file().

Signed-off-by: Ville Skyttä <ville.skytta@upcloud.com>
2 years agoMerge branch 'rpma-update-RPMA-engines-with-new-librpma-completions-API' of https...
Jens Axboe [Fri, 18 Feb 2022 16:02:03 +0000 (09:02 -0700)]
Merge branch 'rpma-update-RPMA-engines-with-new-librpma-completions-API' of https://github.com/ldorau/fio

* 'rpma-update-RPMA-engines-with-new-librpma-completions-API' of https://github.com/ldorau/fio:
  rpma: update RPMA engines with new librpma completions API
  rpma: RPMA engines require librpma>=v0.11.0 with rpma_cq_get_wc()

2 years agorpma: update RPMA engines with new librpma completions API
Oksana Salyk [Fri, 4 Feb 2022 19:00:36 +0000 (14:00 -0500)]
rpma: update RPMA engines with new librpma completions API

The API of librpma has been changed between v0.10.0 and v0.12.0
and fio has to be updated.

Signed-off-by: Oksana Salyk <oksana.salyk@intel.com>
2 years agorpma: RPMA engines require librpma>=v0.11.0 with rpma_cq_get_wc()
Lukasz Dorau [Fri, 18 Feb 2022 13:57:18 +0000 (14:57 +0100)]
rpma: RPMA engines require librpma>=v0.11.0 with rpma_cq_get_wc()

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
2 years agoCorrect F_FULLSYNC -> F_FULLFSYNC
Jens Axboe [Thu, 17 Feb 2022 19:53:59 +0000 (12:53 -0700)]
Correct F_FULLSYNC -> F_FULLFSYNC

Apparently used a mix of the two, inconsistently.

Fixes: a04e0665cb5d ("Use fcntl(..., F_FULLSYNC) if available")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoUse fcntl(..., F_FULLSYNC) if available
Jens Axboe [Thu, 17 Feb 2022 19:08:41 +0000 (12:08 -0700)]
Use fcntl(..., F_FULLSYNC) if available

Some operating systems don't perform a data integrity flush when
fsync() is done, but provide fcntl(fd, F_FULLSYNC) to provide that kind
of guarantee.

To ensure that comparisons between operating systems is fair, use
fcntl() to do a proper sync if available.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: align buffers correctly on non-4k page sizes
Jens Axboe [Thu, 17 Feb 2022 17:18:49 +0000 (10:18 -0700)]
t/io_uring: align buffers correctly on non-4k page sizes

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agot/io_uring: allow non-power-of-2 queue depths
Jens Axboe [Thu, 17 Feb 2022 17:16:19 +0000 (10:16 -0700)]
t/io_uring: allow non-power-of-2 queue depths

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agodiskutil: include limits.h for PATH_MAX
Jens Axboe [Wed, 16 Feb 2022 00:11:06 +0000 (17:11 -0700)]
diskutil: include limits.h for PATH_MAX

On OmniOS, compilation fails because of a missing PATH_MAX definition:

$ gmake
    CC cconv.o
In file included from stat.h:6:0,
                 from thread_options.h:7,
                 from cconv.c:4:
diskutil.h:52:12: error: 'PATH_MAX' undeclared here (not in a function); did you mean 'INT8_MAX'?
  char path[PATH_MAX];
            ^~~~~~~~
            INT8_MAX
gmake: *** [Makefile:505: cconv.o] Error 1

Add limits.h to fix that.

Link: https://github.com/axboe/fio/issues/1344
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge branch 'check_min_rate_cleanup' of https://github.com/PCPartPicker/fio
Jens Axboe [Tue, 15 Feb 2022 21:15:58 +0000 (14:15 -0700)]
Merge branch 'check_min_rate_cleanup' of https://github.com/PCPartPicker/fio

* 'check_min_rate_cleanup' of https://github.com/PCPartPicker/fio:
  Cleanup __check_min_rate

2 years agoMerge branch 'rand_nr_bugfix' of https://github.com/PCPartPicker/fio
Jens Axboe [Tue, 15 Feb 2022 20:54:21 +0000 (13:54 -0700)]
Merge branch 'rand_nr_bugfix' of https://github.com/PCPartPicker/fio

* 'rand_nr_bugfix' of https://github.com/PCPartPicker/fio:
  Fix :<nr> suffix with random read/write causing 0 initial offset

2 years agoFix :<nr> suffix with random read/write causing 0 initial offset
aggieNick02 [Tue, 15 Feb 2022 17:59:34 +0000 (11:59 -0600)]
Fix :<nr> suffix with random read/write causing 0 initial offset

When using the :<nr> suffix with random reads or writes, the initial
offset would be set to 0 for the first nr-1 operations. This happened
because td->ddir_seq_nr was initialized to the specified option value,
when it needs to always be initialized to 1, so that the first call to
get_next_offset leads to choosing a new random offset for the first nr
operations.

Signed-off-by: Nick Neumann nick@pcpartpicker.com
2 years agoMerge branch 'fix_bytesrate_eta' of https://github.com/PCPartPicker/fio
Jens Axboe [Tue, 15 Feb 2022 19:22:31 +0000 (12:22 -0700)]
Merge branch 'fix_bytesrate_eta' of https://github.com/PCPartPicker/fio

* 'fix_bytesrate_eta' of https://github.com/PCPartPicker/fio:
  Fix ETA display when rate and/or rate_min are specified

2 years agoFix ETA display when rate and/or rate_min are specified
aggieNick02 [Mon, 14 Feb 2022 21:13:50 +0000 (15:13 -0600)]
Fix ETA display when rate and/or rate_min are specified

The base passed to num2str in the ETA display code passed the wrong
base (0 instead of 1). Additionally, je->sig_figs was never set and
defaulted to 0. Both of these caused the desired range in the ETA code
to always display 0-0 when rate or rate_min was specified.

Signed-off-by: Nick Neumann nick@pcpartpicker.com
2 years agoci: detect Windows installer build failures
Vincent Fu [Tue, 15 Feb 2022 13:30:30 +0000 (13:30 +0000)]
ci: detect Windows installer build failures

When the Windows installer build fails, the build script actually
continues running and does not detect the failure. Use ls to determine
if the MSI file exists in order to detect whether or not the installer
build succeeded.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20220215133027.931-1-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoCleanup __check_min_rate
aggieNick02 [Mon, 14 Feb 2022 03:42:27 +0000 (21:42 -0600)]
Cleanup __check_min_rate

This is a cleanup of __check_min_rate. In looking at stuff for previous fixes,
it seems like there are a lot of boolean checks of things that are always true
or always false. I'll explain my reasoning for each change; it is possible I'm
missing something somehow but I've run through it a few times.

Here's my logic:

1) td->rate_bytes and td->rate_blocks are 0 on first call to __check_min_rate,
and then are the previous iteration's value of td->this_io_bytes and
td->this_io_blocks on subsequent calls

2) bytes and iops are the current iteration's values of td->this_io_bytes and
td->this_io_blocks

3) The values of td->this_io_bytes and td->this_io_blocks are monotonic with
respect to each call of __check_min_rate

Therefore, bytes and iops are always greater than or equal to td->rate_bytes
and td->rate_blocks. This means the "if (bytes < td->rate_bytes[ddir]) {" on
line 176 can never happen.

Now, I want to say the same thing about line 197, but that line is weird/wrong
in another way. rate_iops is td->o.rate_iops, the specified desired iops rate
from the job. So I believe that is a bug - the specified desired iops rate
should not even be examined in this function, just like the same is true for
the desired bytes rate. I'm pretty sure what is meant is to compare iops to
td->rate_blocks just like bytes is compared to td->rate_bytes in line 176,
which would similarly always be false.

Now we can focus on the else caluses (lines 180-192 and lines 202-213). If
spent is 0, we should just be returning false early like in 169-170, so let's
move that case up with it. The "if (rate < ratemin || bytes <
td->rate_bytes[ddir]) {" and "if (rate < rate_iops_min || iops <
td->rate_blocks[ddir]) {" both have impossibilities as the second part of the
or clause. All we really want is to compare computed bytes rate to ratemin, and
computed iops rate to rate_iops_min.

With all of that, this function becomes a lot simpler. The rest of the cleanup
is renaming of variables to make what they are clearer, and some other simple
things (like initializing the variables directly instead of initializing to
zero and then doing +=). The renames are as follows:

- td->lastrate to td->last_rate_check_time, the last time a min rate check was
performed

- bytes to current_rate_check_bytes, the number of bytes transferred so far at
the time this call to __check_min_rate was made

- iops to current_rate_check_blocks, the number of blocks transferred so far at
the time this call to __check_min_rate was made

- rate to current_rate_bytes or current_rate_iops, depending on if it is used
as the current cycle's byte rate or block rate

- ratemin to option_rate_bytes_min, the user supplied desired minimum bytes
rate

- rate_iops eliminated - should not be used in this function

- rate_iops_min to option_rate_iops_min, the user supplied desired minimum
block rate

- td->rate_bytes to td->last_rate_check_bytes - the number of bytes transferred
the *last* time a minimum rate check was called *and* passed (not
shortcircuited because not enough time had elapsed for the cycle or settling)

- td->rate_blocks to td->last_rate_check_blocks - the number of blocks
transferred the *last* time a minimum rate check was called *and* passed (not
shortcircuited because not enough time had elapsed for the cycle or settling)

Signed-off-by: Nick Neumann nick@pcpartpicker.com
2 years agoMerge branch 'fio-docs-ci' of https://github.com/vincentkfu/fio
Jens Axboe [Fri, 11 Feb 2022 23:29:44 +0000 (16:29 -0700)]
Merge branch 'fio-docs-ci' of https://github.com/vincentkfu/fio

* 'fio-docs-ci' of https://github.com/vincentkfu/fio:
  windows: update the installer build for renamed files
  ci: install sphinx packages and add doc building to GitHub Actions
  HOWTO: combine two chunk_size listings into a single one
  HOWTO: combine separate hipri listings into a single one
  HOWTO: combine multiple pool option listings
  docs: rename HOWTO to HOWTO.rst
  docs: update Makefile in order to detect build failures
  docs: document cpumode option for the cpuio ioengine

2 years agowindows: update the installer build for renamed files
Vincent Fu [Fri, 11 Feb 2022 21:55:41 +0000 (16:55 -0500)]
windows: update the installer build for renamed files

Update the MSI build instructions to point to the new README.rst and
HOWTO.rst

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
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>