The following changes since commit bed59bab819823dffe270435b65ed8feafb52148: genfio: Don't consider only /dev/ disk device (2013-08-08 17:40:56 +0200) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (3): powerpc: disable use of ATBU clock Add number_ios= option verify: fix problem with hole punching on newer Linux kernels HOWTO | 7 +++++++ arch/arch-ppc.h | 8 +++++++- cconv.c | 2 ++ filesetup.c | 3 ++- fio.1 | 7 +++++++ io_u.c | 3 +++ options.c | 10 ++++++++++ server.h | 2 +- thread_options.h | 2 ++ 9 files changed, 41 insertions(+), 3 deletions(-) --- Diff of recent changes: diff --git a/HOWTO b/HOWTO index 2335a07..005dac2 100644 --- a/HOWTO +++ b/HOWTO @@ -709,6 +709,13 @@ offset_increment=int If this is provided, then the real offset becomes which are intended to operate on a file in parallel in disjoint segments, with even spacing between the starting points. +number_ios=int Fio will normally perform IOs until it has exhausted the size + of the region set by size=, or if it exhaust the allocated + time (or hits an error condition). With this setting, the + range/size can be set independently of the number of IOs to + perform. When fio reaches this number, it will exit normally + and report status. + fsync=int If writing to a file, issue a sync of the dirty data for every number of blocks given. For example, if you give 32 as a parameter, fio will sync the file for every 32 diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h index 65e6b74..6c1029c 100644 --- a/arch/arch-ppc.h +++ b/arch/arch-ppc.h @@ -118,6 +118,12 @@ static inline int arch_init(char *envp[]) } #define ARCH_HAVE_FFZ -#define ARCH_HAVE_CPU_CLOCK + +/* + * We don't have it on all platforms, lets comment this out until we + * can handle it more intelligently. + * + * #define ARCH_HAVE_CPU_CLOCK + */ #endif diff --git a/cconv.c b/cconv.c index 8e7c69e..21e3a51 100644 --- a/cconv.c +++ b/cconv.c @@ -146,6 +146,7 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->zone_skip = le64_to_cpu(top->zone_skip); o->lockmem = le64_to_cpu(top->lockmem); o->offset_increment = le64_to_cpu(top->offset_increment); + o->number_ios = le64_to_cpu(top->number_ios); o->overwrite = le32_to_cpu(top->overwrite); o->bw_avg_time = le32_to_cpu(top->bw_avg_time); @@ -394,6 +395,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->start_offset = __cpu_to_le64(o->start_offset); top->trim_backlog = __cpu_to_le64(o->trim_backlog); top->offset_increment = __cpu_to_le64(o->offset_increment); + top->number_ios = __cpu_to_le64(o->number_ios); for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++) top->percentile_list[i].u.i = __cpu_to_le64(fio_double_to_uint64(o->percentile_list[i].u.f)); diff --git a/filesetup.c b/filesetup.c index 6427f3e..7d3a061 100644 --- a/filesetup.c +++ b/filesetup.c @@ -388,7 +388,8 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, if (f->mmap_ptr) { ret = posix_madvise(f->mmap_ptr, f->mmap_sz, POSIX_MADV_DONTNEED); #ifdef FIO_MADV_FREE - (void) posix_madvise(f->mmap_ptr, f->mmap_sz, FIO_MADV_FREE); + if (f->filetype == FIO_TYPE_BD) + (void) posix_madvise(f->mmap_ptr, f->mmap_sz, FIO_MADV_FREE); #endif } else if (f->filetype == FIO_TYPE_FILE) { ret = posix_fadvise(f->fd, off, len, POSIX_FADV_DONTNEED); diff --git a/fio.1 b/fio.1 index b54eead..e35bd93 100644 --- a/fio.1 +++ b/fio.1 @@ -576,6 +576,13 @@ that starts at 0 and is incremented for each job. This option is useful if there are several jobs which are intended to operate on a file in parallel in disjoint segments, with even spacing between the starting points. .TP +.BI number_ios \fR=\fPint +Fio will normally perform IOs until it has exhausted the size of the region +set by \fBsize\fR, or if it exhaust the allocated time (or hits an error +condition). With this setting, the range/size can be set independently of +the number of IOs to perform. When fio reaches this number, it will exit +normally and report status. +.TP .BI fsync \fR=\fPint How many I/Os to perform before issuing an \fBfsync\fR\|(2) of dirty data. If 0, don't sync. Default: 0. diff --git a/io_u.c b/io_u.c index a35aafd..c50a17d 100644 --- a/io_u.c +++ b/io_u.c @@ -1413,6 +1413,9 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u, add_bw_sample(td, idx, bytes, &icd->time); add_iops_sample(td, idx, bytes, &icd->time); + + if (td->o.number_ios && !--td->o.number_ios) + td->done = 1; } static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir) diff --git a/options.c b/options.c index 1816d0b..caf89d3 100644 --- a/options.c +++ b/options.c @@ -1483,6 +1483,16 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .group = FIO_OPT_G_INVALID, }, { + .name = "number_ios", + .lname = "Number of IOs to perform", + .type = FIO_OPT_STR_VAL, + .off1 = td_var_offset(number_ios), + .help = "Force job completion of this number of IOs", + .def = "0", + .category = FIO_OPT_C_IO, + .group = FIO_OPT_G_INVALID, + }, + { .name = "bs", .lname = "Block size", .alias = "blocksize", diff --git a/server.h b/server.h index 2f41be0..aefd418 100644 --- a/server.h +++ b/server.h @@ -38,7 +38,7 @@ struct fio_net_cmd_reply { }; enum { - FIO_SERVER_VER = 24, + FIO_SERVER_VER = 25, FIO_SERVER_MAX_FRAGMENT_PDU = 1024, diff --git a/thread_options.h b/thread_options.h index eaafaee..3f345c5 100644 --- a/thread_options.h +++ b/thread_options.h @@ -236,6 +236,7 @@ struct thread_options { unsigned int flow_sleep; unsigned long long offset_increment; + unsigned long long number_ios; unsigned int sync_file_range; }; @@ -440,6 +441,7 @@ struct thread_options_pack { uint32_t flow_sleep; uint64_t offset_increment; + uint64_t number_ios; uint32_t sync_file_range; } __attribute__((packed)); -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html