Skip to content

Commit

Permalink
Merge branch 'axboe:master' into directory-operation
Browse files Browse the repository at this point in the history
  • Loading branch information
friendy-su authored Mar 21, 2024
2 parents 2dd3540 + f226220 commit 8494e34
Show file tree
Hide file tree
Showing 61 changed files with 1,970 additions and 302 deletions.
97 changes: 69 additions & 28 deletions HOWTO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,9 @@ Time related parameters
CPU mask of other jobs.

.. option:: job_start_clock_id=int
The clock_id passed to the call to `clock_gettime` used to record job_start
in the `json` output format. Default is 0, or CLOCK_REALTIME.

The clock_id passed to the call to `clock_gettime` used to record
job_start in the `json` output format. Default is 0, or CLOCK_REALTIME.


Target file/device
Expand Down Expand Up @@ -1630,7 +1631,7 @@ Block size
Comma-separated ranges may be specified for reads, writes, and trims as
described in :option:`blocksize`.

Example: ``bsrange=1k-4k,2k-8k``.
Example: ``bsrange=1k-4k,2k-8k`` also the ':' delimiter ``bsrange=1k:4k,2k:8k``.

.. option:: bssplit=str[,str][,str]

Expand Down Expand Up @@ -2506,11 +2507,11 @@ with the caveat that when used on the command line, they must come after the
want fio to use placement identifier only at indices 0, 2 and 5 specify
``fdp_pli=0,2,5``.

.. option:: md_per_io_size=int : [io_uring_cmd]
.. option:: md_per_io_size=int : [io_uring_cmd] [xnvme]

Size in bytes for separate metadata buffer per IO. Default: 0.

.. option:: pi_act=int : [io_uring_cmd]
.. option:: pi_act=int : [io_uring_cmd] [xnvme]

Action to take when nvme namespace is formatted with protection
information. If this is set to 1 and namespace is formatted with
Expand All @@ -2526,7 +2527,7 @@ with the caveat that when used on the command line, they must come after the
it will use the default slower generator.
(see: https://github.com/intel/isa-l)

.. option:: pi_chk=str[,str][,str] : [io_uring_cmd]
.. option:: pi_chk=str[,str][,str] : [io_uring_cmd] [xnvme]

Controls the protection information check. This can take one or more
of these values. Default: none.
Expand All @@ -2539,16 +2540,25 @@ with the caveat that when used on the command line, they must come after the
**APPTAG**
Enables protection information checking of application tag field.

.. option:: apptag=int : [io_uring_cmd]
.. option:: apptag=int : [io_uring_cmd] [xnvme]

Specifies logical block application tag value, if namespace is
formatted to use end to end protection information. Default: 0x1234.

.. option:: apptag_mask=int : [io_uring_cmd]
.. option:: apptag_mask=int : [io_uring_cmd] [xnvme]

Specifies logical block application tag mask value, if namespace is
formatted to use end to end protection information. Default: 0xffff.

.. option:: num_range=int : [io_uring_cmd]

For trim command this will be the number of ranges to trim per I/O
request. The number of logical blocks per range is determined by the
:option:`bs` option which should be a multiple of logical block size.
This cannot be used with read or write. Note that setting this
option > 1, :option:`log_offset` will not be able to log all the
offsets. Default: 1.

.. option:: cpuload=int : [cpuio]

Attempt to use the specified percentage of CPU cycles. This is a mandatory
Expand Down Expand Up @@ -2641,10 +2651,13 @@ with the caveat that when used on the command line, they must come after the
User datagram protocol V6.
**unix**
UNIX domain socket.
**vsock**
VSOCK protocol.

When the protocol is TCP or UDP, the port must also be given, as well as the
hostname if the job is a TCP listener or UDP reader. For unix sockets, the
When the protocol is TCP, UDP or VSOCK, the port must also be given, as well as the
hostname if the job is a TCP or VSOCK listener or UDP reader. For unix sockets, the
normal :option:`filename` option should be used and the port is invalid.
When the protocol is VSOCK, the :option:`hostname` is the CID of the remote VM.

.. option:: listen : [netsplice] [net]

Expand Down Expand Up @@ -2788,7 +2801,7 @@ with the caveat that when used on the command line, they must come after the

.. option:: sg_write_mode=str : [sg]

Specify the type of write commands to issue. This option can take three values:
Specify the type of write commands to issue. This option can take ten values:

**write**
This is the default where write opcodes are issued as usual.
Expand Down Expand Up @@ -3325,8 +3338,8 @@ I/O rate

.. option:: rate_cycle=int

Average bandwidth for :option:`rate` and :option:`rate_min` over this number
of milliseconds. Defaults to 1000.
Average bandwidth for :option:`rate_min` and :option:`rate_iops_min`
over this number of milliseconds. Defaults to 1000.


I/O latency
Expand Down Expand Up @@ -4078,12 +4091,15 @@ Measurements and reporting

.. option:: log_avg_msec=int

By default, fio will log an entry in the iops, latency, or bw log for every
I/O that completes. When writing to the disk log, that can quickly grow to a
very large size. Setting this option makes fio average the each log entry
over the specified period of time, reducing the resolution of the log. See
:option:`log_max_value` as well. Defaults to 0, logging all entries.
Also see `Log File Formats`_.
By default, fio will log an entry in the iops, latency, or bw log for
every I/O that completes. When writing to the disk log, that can
quickly grow to a very large size. Setting this option directs fio to
instead record an average over the specified duration for each log
entry, reducing the resolution of the log. When the job completes, fio
will flush any accumulated latency log data, so the final log interval
may not match the value specified by this option and there may even be
duplicate timestamps. See :option:`log_window_value` as well. Defaults
to 0, logging entries for each I/O. Also see `Log File Formats`_.

.. option:: log_hist_msec=int

Expand All @@ -4103,11 +4119,28 @@ Measurements and reporting
histogram logs contain 1216 latency bins. See :option:`write_hist_log`
and `Log File Formats`_.

.. option:: log_max_value=bool
.. option:: log_window_value=str, log_max_value=str

If :option:`log_avg_msec` is set, fio by default logs the average over that
window. This option determines whether fio logs the average, maximum or
both the values over the window. This only affects the latency logging,
as both average and maximum values for iops or bw log will be same.
Accepted values are:

**avg**
Log average value over the window. The default.

**max**
Log maximum value in the window.

**both**
Log both average and maximum value over the window.

**0**
Backward-compatible alias for **avg**.

If :option:`log_avg_msec` is set, fio logs the average over that window. If
you instead want to log the maximum value, set this option to 1. Defaults to
0, meaning that averaged values are logged.
**1**
Backward-compatible alias for **max**.

.. option:: log_offset=bool

Expand Down Expand Up @@ -5076,11 +5109,19 @@ toggled with :option:`log_offset`.
by the ioengine specific :option:`cmdprio_percentage`.

Fio defaults to logging every individual I/O but when windowed logging is set
through :option:`log_avg_msec`, either the average (by default) or the maximum
(:option:`log_max_value` is set) *value* seen over the specified period of time
is recorded. Each *data direction* seen within the window period will aggregate
its values in a separate row. Further, when using windowed logging the *block
size* and *offset* entries will always contain 0.
through :option:`log_avg_msec`, either the average (by default), the maximum
(:option:`log_window_value` is set to max) *value* seen over the specified period
of time, or both the average *value* and maximum *value1* (:option:`log_window_value`
is set to both) is recorded. The log file format when both the values are reported
takes this form:

*time* (`msec`), *value*, *value1*, *data direction*, *block size* (`bytes`),
*offset* (`bytes`), *command priority*


Each *data direction* seen within the window period will aggregate its values in a
separate row. Further, when using windowed logging the *block size* and *offset*
entries will always contain 0.


Client/Server
Expand Down
5 changes: 5 additions & 0 deletions arch/arch-x86_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ static inline unsigned long arch_ffz(unsigned long bitmask)
return bitmask;
}

static inline void tsc_barrier(void)
{
__asm__ __volatile__("mfence":::"memory");
}

static inline unsigned long long get_cpu_clock(void)
{
unsigned int lo, hi;
Expand Down
7 changes: 7 additions & 0 deletions arch/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ extern unsigned long arch_flags;
#include "arch-generic.h"
#endif

#if !defined(__x86_64__) && defined(CONFIG_SYNC_SYNC)
static inline void tsc_barrier(void)
{
__sync_synchronize();
}
#endif

#include "../lib/ffz.h"
/* IWYU pragma: end_exports */

Expand Down
24 changes: 19 additions & 5 deletions backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ static int init_io_u(struct thread_data *td)
int init_io_u_buffers(struct thread_data *td)
{
struct io_u *io_u;
unsigned long long max_bs, min_write;
unsigned long long max_bs, min_write, trim_bs = 0;
int i, max_units;
int data_xfer = 1;
char *p;
Expand All @@ -1344,7 +1344,18 @@ int init_io_u_buffers(struct thread_data *td)
td->orig_buffer_size = (unsigned long long) max_bs
* (unsigned long long) max_units;

if (td_ioengine_flagged(td, FIO_NOIO) || !(td_read(td) || td_write(td)))
if (td_trim(td) && td->o.num_range > 1) {
trim_bs = td->o.num_range * sizeof(struct trim_range);
td->orig_buffer_size = trim_bs
* (unsigned long long) max_units;
}

/*
* For reads, writes, and multi-range trim operations we need a
* data buffer
*/
if (td_ioengine_flagged(td, FIO_NOIO) ||
!(td_read(td) || td_write(td) || (td_trim(td) && td->o.num_range > 1)))
data_xfer = 0;

/*
Expand Down Expand Up @@ -1396,7 +1407,10 @@ int init_io_u_buffers(struct thread_data *td)
fill_verify_pattern(td, io_u->buf, max_bs, io_u, 0, 0);
}
}
p += max_bs;
if (td_trim(td) && td->o.num_range > 1)
p += trim_bs;
else
p += max_bs;
}

return 0;
Expand Down Expand Up @@ -2080,14 +2094,14 @@ static void reap_threads(unsigned int *nr_running, uint64_t *t_rate,
uint64_t *m_rate)
{
unsigned int cputhreads, realthreads, pending;
int status, ret;
int ret;

/*
* reap exited threads (TD_EXITED -> TD_REAPED)
*/
realthreads = pending = cputhreads = 0;
for_each_td(td) {
int flags = 0;
int flags = 0, status;

if (!strcmp(td->o.ioengine, "cpuio"))
cputhreads++;
Expand Down
2 changes: 2 additions & 0 deletions cconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ int convert_thread_options_to_cpu(struct thread_options *o,
o->serialize_overlap = le32_to_cpu(top->serialize_overlap);
o->size = le64_to_cpu(top->size);
o->io_size = le64_to_cpu(top->io_size);
o->num_range = le32_to_cpu(top->num_range);
o->size_percent = le32_to_cpu(top->size_percent);
o->io_size_percent = le32_to_cpu(top->io_size_percent);
o->fill_device = le32_to_cpu(top->fill_device);
Expand Down Expand Up @@ -609,6 +610,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top,

top->size = __cpu_to_le64(o->size);
top->io_size = __cpu_to_le64(o->io_size);
top->num_range = __cpu_to_le32(o->num_range);
top->verify_backlog = __cpu_to_le64(o->verify_backlog);
top->start_delay = __cpu_to_le64(o->start_delay);
top->start_delay_high = __cpu_to_le64(o->start_delay_high);
Expand Down
5 changes: 2 additions & 3 deletions ci/actions-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ install_macos() {
#echo "Updating homebrew..."
#brew update >/dev/null 2>&1
echo "Installing packages..."
HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs sphinx-doc pygments python-certifi
brew link sphinx-doc --force
pip3 install scipy six statsmodels
HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs
pip3 install scipy six statsmodels sphinx
}

install_windows() {
Expand Down
6 changes: 4 additions & 2 deletions client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1718,8 +1718,10 @@ static struct cmd_iolog_pdu *convert_iolog(struct fio_net_cmd *cmd,
s = (struct io_sample *)((char *)s + sizeof(struct io_u_plat_entry) * i);

s->time = le64_to_cpu(s->time);
if (ret->log_type != IO_LOG_TYPE_HIST)
s->data.val = le64_to_cpu(s->data.val);
if (ret->log_type != IO_LOG_TYPE_HIST) {
s->data.val.val0 = le64_to_cpu(s->data.val.val0);
s->data.val.val1 = le64_to_cpu(s->data.val.val1);
}
s->__ddir = __le32_to_cpu(s->__ddir);
s->bs = le64_to_cpu(s->bs);
s->priority = le16_to_cpu(s->priority);
Expand Down
24 changes: 23 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,25 @@ elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
fi
print_config "TCP_NODELAY" "$tcp_nodelay"

##########################################
# Check whether we have vsock
if test "$vsock" != "yes" ; then
vsock="no"
fi
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/vm_sockets.h>
int main(int argc, char **argv)
{
return socket(AF_VSOCK, SOCK_STREAM, 0);
}
EOF
if compile_prog "" "" "vsock"; then
vsock="yes"
fi
print_config "vsock" "$vsock"

##########################################
# Check whether we have SO_SNDBUF
if test "$window_size" != "yes" ; then
Expand Down Expand Up @@ -2678,7 +2697,7 @@ fi
##########################################
# Check if we have xnvme
if test "$xnvme" != "no" ; then
if check_min_lib_version xnvme 0.7.0; then
if check_min_lib_version xnvme 0.7.4; then
xnvme="yes"
xnvme_cflags=$(pkg-config --cflags xnvme)
xnvme_libs=$(pkg-config --libs xnvme)
Expand Down Expand Up @@ -3192,6 +3211,9 @@ fi
if test "$ipv6" = "yes" ; then
output_sym "CONFIG_IPV6"
fi
if test "$vsock" = "yes"; then
output_sym "CONFIG_VSOCK"
fi
if test "$http" = "yes" ; then
output_sym "CONFIG_HTTP"
fi
Expand Down
Loading

0 comments on commit 8494e34

Please sign in to comment.