Recent changes (master)
The following changes since commit ded6cce8274ccf6f3820fb19ab46fd6d2aed0311:
Merge branch 'Read_Stats_Not_Reported_For_Timed_Backlog_Verifies' of github.com:horshack-dpreview/fio (2023-02-15 12:49:31 -0500)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to f9fc7a27cae5ea2dbb310c05f7b693c68ba15537:
backend: fix runtime when used with thinktime (2023-02-17 19:52:50 -0700)
----------------------------------------------------------------
Ankit Kumar (1):
backend: fix runtime when used with thinktime
Jens Axboe (1):
Get rid of O_ATOMIC
Vincent Fu (3):
iolog: handle trim commands when reading iologs
filesetup: don't skip flags for trim workloads Merge branch 'remove_pmemblk_engine' of github.com:osalyk/fio
osalyk (1):
pmemblk: remove pmemblk engine
HOWTO.rst | 11 -- Makefile | 5 - backend.c | 28 ++- ci/actions-install.sh | 1 - configure | 41 ----- engines/ime.c | 4 - engines/libzbc.c | 6 - engines/pmemblk.c | 449 ------------------------------------------------ examples/pmemblk.fio | 71 -------- examples/pmemblk.png | Bin 107529 -> 0 bytes filesetup.c | 10 -- fio.1 | 10 -- init.c | 6 - iolog.c | 27 ++- memory.c | 4 +- options.c | 6 - os/os-linux.h | 6 - os/os.h | 6 - os/windows/examples.wxs | 4 - 19 files changed, 42 insertions(+), 653 deletions(-) delete mode 100644 engines/pmemblk.c delete mode 100644 examples/pmemblk.fio delete mode 100644 examples/pmemblk.png
---
Diff of recent changes:
HOWTO.rst +0 -11
@@ -1110,12 +1110,6 @@ I/O type OpenBSD and ZFS on Solaris don't support direct I/O. On Windows the synchronous ioengines don't support direct I/O. Default: false. -.. option:: atomic=bool - - If value is true, attempt to use atomic direct I/O. Atomic writes are - guaranteed to be stable once acknowledged by the operating system. Only - Linux supports O_ATOMIC right now. - .. option:: buffered=bool If value is true, use buffered I/O. This is the opposite of the
@@ -2147,11 +2141,6 @@ I/O engine before overwriting. The `trimwrite` mode works well for this constraint. - **pmemblk** - Read and write using filesystem DAX to a file on a filesystem - mounted with DAX on a persistent memory device through the PMDK - libpmemblk library. - **dev-dax** Read and write using device DAX to a persistent memory device (e.g., /dev/dax0.0) through the PMDK libpmem library.
Makefile +0 -5
@@ -208,11 +208,6 @@ ifdef CONFIG_MTD SOURCE += oslib/libmtd.c SOURCE += oslib/libmtd_legacy.c endif -ifdef CONFIG_PMEMBLK - pmemblk_SRCS = engines/pmemblk.c - pmemblk_LIBS = -lpmemblk - ENGINES += pmemblk -endif ifdef CONFIG_LINUX_DEVDAX dev-dax_SRCS = engines/dev-dax.c dev-dax_LIBS = -lpmem
backend.c +22 -6
@@ -866,6 +866,7 @@ static void handle_thinktime(struct thread_data *td, enum fio_ddir ddir, struct timespec *time) {unsigned long long b; +unsigned long long runtime_left;uint64_t total;int left;struct timespec now;
@@ -874,7 +875,7 @@ static void handle_thinktime(struct thread_data *td, enum fio_ddir ddir,if (td->o.thinktime_iotime) {fio_gettime (&now,NULL );if (utime_since (&td->last_thinktime, &now) - >= td->o.thinktime_iotime + td->o.thinktime) { + >= td->o.thinktime_iotime) { stall = true; }else if (!fio_option_is_set (&td->o, thinktime_blocks)) {/*
@@ -897,11 +898,24 @@ static void handle_thinktime(struct thread_data *td, enum fio_ddir ddir,io_u_quiesce (td); + left = td->o.thinktime_spin; +if (td->o.timeout) { + runtime_left = td->o.timeout -utime_since_now (&td->epoch); +if (runtime_left < (unsigned long long )left) + left = runtime_left; + } + total =0 ; -if (td->o.thinktime_spin) - total =usec_spin (td->o.thinktime_spin); +if (left) + total =usec_spin (left); left = td->o.thinktime - total; +if (td->o.timeout) { + runtime_left = td->o.timeout -utime_since_now (&td->epoch); +if (runtime_left < (unsigned long long )left) + left = runtime_left; + } +if (left) total +=usec_sleep (td, left);
@@ -930,8 +944,10 @@ static void handle_thinktime(struct thread_data *td, enum fio_ddir ddir,fio_gettime (time,NULL ); td->last_thinktime_blocks = b; -if (td->o.thinktime_iotime) +if (td->o.thinktime_iotime) { +fio_gettime (&now,NULL ); td->last_thinktime = now; + } }/*
@@ -1333,7 +1349,7 @@ int init_io_u_buffers(struct thread_data *td)* overflow later. this adjustment may be too much if we get * lucky and the allocator gives us an aligned address. */ -if (td->o.odirect || td->o.mem_align || td->o.oatomic || +if (td->o.odirect || td->o.mem_align ||td_ioengine_flagged (td,FIO_RAWIO )) td->orig_buffer_size += page_mask + td->o.mem_align;
@@ -1352,7 +1368,7 @@ int init_io_u_buffers(struct thread_data *td)if (data_xfer &&allocate_io_mem (td))return 1 ; -if (td->o.odirect || td->o.mem_align || td->o.oatomic || +if (td->o.odirect || td->o.mem_align ||td_ioengine_flagged (td,FIO_RAWIO )) p =PTR_ALIGN (td->orig_buffer, page_mask) + td->o.mem_align;else
ci/actions-install.sh +0 -1
@@ -45,7 +45,6 @@ DPKGCFG libnbd-dev libpmem-dev libpmem2-dev - libpmemblk-dev libprotobuf-c-dev librbd-dev libtcmalloc-minimal4
configure +0 -41
59 lines not on this page · raw message
engines/ime.c +0 -4
@@ -188,10 +188,6 @@ static int fio_ime_open_file(struct thread_data *td, struct fio_file *f)return 1 ; } -if (td->o.oatomic) { -td_verror (td,EINVAL ,"IME does not support atomic IO" ); -return 1 ; - }if (td->o.odirect) flags |=O_DIRECT ; flags |= td->o.sync_io;
engines/libzbc.c +0 -6
@@ -71,12 +71,6 @@ static int libzbc_open_dev(struct thread_data *td, struct fio_file *f, flags |=O_RDONLY ; } -if (td->o.oatomic) { -td_verror (td,EINVAL ,"libzbc does not support O_ATOMIC" ); -log_err ("%s: libzbc does not support O_ATOMIC\n" , f->file_name); -return -EINVAL ; - } - ld =calloc (1 ,sizeof (*ld));if (!ld)return -ENOMEM ;
engines/pmemblk.c deleted +0 -449
449 lines not on this page · raw message
examples/pmemblk.fio deleted +0 -71
71 lines not on this page · raw message
examples/pmemblk.png deleted binary +0 -0
filesetup.c +0 -10
@@ -737,21 +737,11 @@ int generic_open_file(struct thread_data *td, struct fio_file *f) f_out = stderr; } -if (td_trim (td)) - goto skip_flags;if (td->o.odirect) flags |=OS_O_DIRECT ; -if (td->o.oatomic) { -if (!FIO_O_ATOMIC ) { -td_verror (td,EINVAL ,"OS does not support atomic IO" ); -return 1 ; - } - flags |=OS_O_DIRECT |FIO_O_ATOMIC ; - } flags |= td->o.sync_io;if (td->o.create_on_open && td->o.allow_create) flags |=O_CREAT ; -skip_flags:if (f->filetype !=FIO_TYPE_FILE ) flags |=FIO_O_NOATIME ;
fio.1 +0 -10
@@ -873,11 +873,6 @@ If value is true, use non-buffered I/O. This is usually O_DIRECT. Note that OpenBSD and ZFS on Solaris don't support direct I/O. On Windows the synchronous ioengines don't support direct I/O. Default: false. .TP -.BI atomic \fR=\fPbool -If value is true, attempt to use atomic direct I/O. Atomic writes are -guaranteed to be stable once acknowledged by the operating system. Only -Linux supports O_ATOMIC right now. -.TP .BI buffered \fR=\fPbool If value is true, use buffered I/O. This is the opposite of the \fBdirect\fR option. Defaults to true.
@@ -1959,11 +1954,6 @@ e.g., on NAND, writing sequentially to erase blocks and discarding before overwriting. The \fBtrimwrite\fR mode works well for this constraint. .TP -.B pmemblk -Read and write using filesystem DAX to a file on a filesystem -mounted with DAX on a persistent memory device through the PMDK -libpmemblk library. -.TP .B dev\-dax Read and write using device DAX to a persistent memory device (e.g., /dev/dax0.0) through the PMDK libpmem library.
init.c +0 -6
@@ -916,12 +916,6 @@ static int fixup_options(struct thread_data *td) ret |=1 ; } -/* -* O_ATOMIC implies O_DIRECT -*/ -if (o->oatomic) - o->odirect =1 ; -/* * If randseed is set, that overrides randrepeat */
iolog.c +18 -9
@@ -439,7 +439,7 @@ static bool read_iolog(struct thread_data *td)unsigned long long offset;unsigned int bytes;unsigned long long delay =0 ; -int reads, writes, waits, fileno =0 , file_action =0 ;/* stupid gcc */ +int reads, writes, trims, waits, fileno =0 , file_action =0 ;/* stupid gcc */ char *rfname, *fname, *act;char *str, *p;enum fio_ddir rw;
@@ -461,7 +461,7 @@ static bool read_iolog(struct thread_data *td) rfname = fname =malloc (256 +16 ); act =malloc (256 +16 ); - syncs = reads = writes = waits =0 ; + syncs = reads = writes = trims = waits =0 ;while ((p =fgets (str,4096 , td->io_log_rfile)) !=NULL ) {struct io_piece *ipo;int r;
@@ -552,6 +552,13 @@ static bool read_iolog(struct thread_data *td)if (read_only)continue ; writes++; + }else if (rw ==DDIR_TRIM ) { +/* +* Don't add a trim for ro mode +*/ +if (read_only) +continue ; + trims++; }else if (rw ==DDIR_WAIT ) {if (td->o.no_stall)continue ;
@@ -634,14 +641,16 @@ static bool read_iolog(struct thread_data *td)return true; } -if (!reads && !writes && !waits) +if (!reads && !writes && !waits && !trims)return false; -else if (reads && !writes) - td->o.td_ddir =TD_DDIR_READ ; -else if (!reads && writes) - td->o.td_ddir =TD_DDIR_WRITE ; -else - td->o.td_ddir =TD_DDIR_RW ; + + td->o.td_ddir =0 ; +if (reads) + td->o.td_ddir |=TD_DDIR_READ ; +if (writes) + td->o.td_ddir |=TD_DDIR_WRITE ; +if (trims) + td->o.td_ddir |=TD_DDIR_TRIM ;return true; }
memory.c +2 -2
@@ -295,7 +295,7 @@ int allocate_io_mem(struct thread_data *td) total_mem = td->orig_buffer_size; -if (td->o.odirect || td->o.mem_align || td->o.oatomic || +if (td->o.odirect || td->o.mem_align ||td_ioengine_flagged (td,FIO_MEMALIGN )) { total_mem += page_mask;if (td->o.mem_align && td->o.mem_align > page_size)
@@ -341,7 +341,7 @@ void free_io_mem(struct thread_data *td)unsigned int total_mem; total_mem = td->orig_buffer_size; -if (td->o.odirect || td->o.oatomic) +if (td->o.odirect) total_mem += page_mask;if (td->io_ops->iomem_alloc && !fio_option_is_set (&td->o, mem_type)) {
options.c +0 -6
@@ -2096,12 +2096,6 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .help = "Hadoop Distributed Filesystem (HDFS) engine" },#endif -#ifdef CONFIG_PMEMBLK - { .ival = "pmemblk", - .help = "PMDK libpmemblk based IO engine", - }, - -#endif#ifdef CONFIG_IME { .ival = "ime_psync", .help = "DDN's IME synchronous IO engine",
os/os-linux.h +0 -6
@@ -205,12 +205,6 @@ static inline unsigned long long os_phys_mem(void)#define FIO_O_NOATIME 0#endif -#ifdef O_ATOMIC -#define OS_O_ATOMIC O_ATOMIC -#else -#define OS_O_ATOMIC 040000000 -#endif -#ifdef MADV_REMOVE #define FIO_MADV_FREE MADV_REMOVE#endif
os/os.h +0 -6
@@ -133,12 +133,6 @@ extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);#define OS_O_DIRECT O_DIRECT#endif -#ifdef OS_O_ATOMIC -#define FIO_O_ATOMIC OS_O_ATOMIC -#else -#define FIO_O_ATOMIC 0 -#endif -#ifndef FIO_HAVE_HUGETLB #define SHM_HUGETLB 0#define MAP_HUGETLB 0
os/windows/examples.wxs +0 -4
@@ -125,9 +125,6 @@ <Component> <File Source="..\..\examples\numa.fio" /> </Component> - <Component> - <File Source="..\..\examples\pmemblk.fio" /> - </Component> <Component> <File Source="..\..\examples\poisson-rate-submission.fio" /> </Component>
@@ -212,7 +209,6 @@ <ComponentRef Id="netio_multicast.fio" /> <ComponentRef Id="null.fio" /> <ComponentRef Id="numa.fio" /> - <ComponentRef Id="pmemblk.fio" /> <ComponentRef Id="poisson_rate_submission.fio" /> <ComponentRef Id="rados.fio"/> <ComponentRef Id="rand_zones.fio" />