X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.h;h=049692d65e03783d3dcd934f2225c50482e7a6cb;hp=477b19a437613fda8037b09a77ab705ab25eea5d;hb=0b9d69ecb14045cf3b2622ae922756b9889b25e6;hpb=f2bba1820a567ac00b09916239ac8feb125cead2 diff --git a/fio.h b/fio.h index 477b19a4..049692d6 100644 --- a/fio.h +++ b/fio.h @@ -42,6 +42,7 @@ struct group_run_stats { unsigned long long max_bw[2], min_bw[2]; unsigned long long io_kb[2]; unsigned long long agg[2]; + unsigned int kb_base; }; /* @@ -118,6 +119,8 @@ struct thread_stat { unsigned continue_on_error; unsigned long total_err_count; int first_error; + + unsigned int kb_base; }; struct bssplit { @@ -134,6 +137,7 @@ struct thread_options { char *opendir; char *ioengine; enum td_ddir td_ddir; + unsigned int kb_base; unsigned int ddir_nr; unsigned int iodepth; unsigned int iodepth_low; @@ -174,6 +178,7 @@ struct thread_options { unsigned int verify_pattern; unsigned int verify_pattern_bytes; unsigned int verify_fatal; + unsigned int verify_async; unsigned int use_thread; unsigned int unlink; unsigned int do_disk_util; @@ -192,6 +197,7 @@ struct thread_options { unsigned int thinktime_spin; unsigned int thinktime_blocks; unsigned int fsync_blocks; + unsigned int fdatasync_blocks; unsigned int start_delay; unsigned long long timeout; unsigned long long ramp_time; @@ -201,12 +207,15 @@ struct thread_options { unsigned long long zone_size; unsigned long long zone_skip; enum fio_memtype mem_type; + unsigned int mem_align; unsigned int stonewall; unsigned int new_group; unsigned int numjobs; os_cpu_mask_t cpumask; unsigned int cpumask_set; + os_cpu_mask_t verify_cpumask; + unsigned int verify_cpumask_set; unsigned int iolog; unsigned int rwmixcycle; unsigned int rwmix[2]; @@ -317,6 +326,17 @@ struct thread_data { struct flist_head io_u_freelist; struct flist_head io_u_busylist; struct flist_head io_u_requeues; + pthread_mutex_t io_u_lock; + pthread_cond_t free_cond; + + /* + * async verify offload + */ + struct flist_head verify_list; + pthread_t *verify_threads; + unsigned int nr_verify_threads; + pthread_cond_t verify_cond; + int verify_thread_exit; /* * Rate state @@ -446,7 +466,7 @@ static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u) #define MAX_JOBS (1024) -#define td_non_fatal_error(e) ((e) == -EIO || (e) == EILSEQ) +#define td_non_fatal_error(e) ((e) == EIO || (e) == EILSEQ) static inline void update_error_count(struct thread_data *td, int err) { @@ -491,6 +511,7 @@ extern int in_ramp_time(struct thread_data *); */ extern int __must_check parse_options(int, char **); extern int fio_options_parse(struct thread_data *, char **, int); +extern void fio_keywords_init(void); extern int fio_cmd_option_parse(struct thread_data *, const char *, char *); extern void fio_fill_default_options(struct thread_data *); extern int fio_show_option_help(const char *); @@ -654,4 +675,31 @@ static inline int should_check_rate(struct thread_data *td, return ret; } +static inline int is_power_of_2(unsigned int val) +{ + return (val != 0 && ((val & (val - 1)) == 0)); +} + +/* + * We currently only need to do locking if we have verifier threads + * accessing our internal structures too + */ +static inline void td_io_u_lock(struct thread_data *td) +{ + if (td->o.verify_async) + pthread_mutex_lock(&td->io_u_lock); +} + +static inline void td_io_u_unlock(struct thread_data *td) +{ + if (td->o.verify_async) + pthread_mutex_unlock(&td->io_u_lock); +} + +static inline void td_io_u_free_notify(struct thread_data *td) +{ + if (td->o.verify_async) + pthread_cond_signal(&td->free_cond); +} + #endif