Recent changes (master)
The following changes since commit 84f9318fc16e33633ac9f789dcef7cc58c3b8595:
t/latency_percentiles.py: tweak terse output parse (2020-11-12 11:26:58 -0700)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to 2ee239fb084355e115cf8c2bf8051e8807c4222a:
Merge branch 'segmented-threads' (2020-11-13 10:06:26 -0700)
----------------------------------------------------------------
Jens Axboe (4):
Wrap thread_data in thread_segment
Add thread_segments as needed
Kill off 'max_jobs'
Merge branch 'segmented-threads'
backend.c | 5 +- fio.h | 27 +++++++++-- gettime-thread.c | 2 +- init.c | 142 +++++++++++++++++++++++++++++-------------------------- libfio.c | 5 ++ os/os-mac.h | 6 --- os/os.h | 4 -- server.c | 2 +- 8 files changed, 108 insertions(+), 85 deletions(-)
---
Diff of recent changes:
backend.c +3 -2
@@ -62,8 +62,9 @@ struct io_log *agg_io_log[DDIR_RWDIR_CNT];int groupid =0 ;unsigned int thread_number =0 ; +unsigned int nr_segments =0 ; +unsigned int cur_segment =0 ;unsigned int stat_number =0 ; -int shm_id =0 ;int temp_stall_ts;unsigned long done_secs =0 ;#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
@@ -76,7 +77,7 @@ pthread_mutex_t overlap_check = PTHREAD_MUTEX_INITIALIZER;static void sig_int (int sig) { -if (threads) { +if (nr_segments) {if (is_backend)fio_server_got_signal (sig);else {
fio.h +22 -5
@@ -467,6 +467,12 @@ struct thread_data { }; +struct thread_segment { +struct thread_data *threads; +int shm_id; +int nr_threads; +}; +/* * when should interactive ETA output be generated */
@@ -510,10 +516,15 @@ enum {#define __fio_stringify_1 (x) #x#define __fio_stringify (x) __fio_stringify_1(x) +#define REAL_MAX_JOBS 4096 +#define JOBS_PER_SEG 8 +#define REAL_MAX_SEG (REAL_MAX_JOBS / JOBS_PER_SEG) +extern bool exitall_on_terminate;extern unsigned int thread_number;extern unsigned int stat_number; -extern int shm_id; +extern unsigned int nr_segments; +extern unsigned int cur_segment;extern int groupid;extern int output_format;extern int append_terse_output;
@@ -542,7 +553,15 @@ extern char *trigger_remote_cmd;extern long long trigger_timeout;extern char *aux_path; -extern struct thread_data *threads; +extern struct thread_segment segments[REAL_MAX_SEG ]; + +static inline struct thread_data *tnumber_to_td (unsigned int tnumber) +{ +struct thread_segment *seg; + + seg = &segments[tnumber /JOBS_PER_SEG ]; +return &seg->threads[tnumber & (JOBS_PER_SEG -1 )]; +}static inline bool is_running_backend (void ) {
@@ -557,8 +576,6 @@ static inline void fio_ro_check(const struct thread_data *td, struct io_u *io_u) !(io_u->ddir == DDIR_TRIM && !td_trim(td))); } -#define REAL_MAX_JOBS 4096 -static inline bool should_fsync (struct thread_data *td) {if (td->last_was_sync)
@@ -709,7 +726,7 @@ extern void lat_target_reset(struct thread_data *);* Iterates all threads/processes within all the defined jobs */ #define for_each_td (td, i) \ - for ((i) = 0, (td) = &threads[0]; (i) < (int) thread_number; (i)++, (td)++) + for ((i) = 0, (td) = &segments[0].threads[0]; (i) < (int) thread_number; (i)++, (td) = tnumber_to_td((i)))#define for_each_file (td, f, i) \ if ((td)->files_index) \ for ((i) = 0, (f) = (td)->files[0]; \
gettime-thread.c +1 -1
@@ -58,7 +58,7 @@ static void *gtod_thread_main(void *data)* but I'm not sure what to use outside of a simple CPU nop to relax * it - we don't want to lose precision. */ -while (threads) { +while (nr_segments) {fio_gtod_update (); nop; }
init.c +76 -66
225 lines not on this page · raw message
libfio.c +5 -0
@@ -156,8 +156,13 @@ void reset_all_stats(struct thread_data *td)void reset_fio_state (void ) { +int i; + groupid =0 ; thread_number =0 ; + cur_segment =0 ; +for (i =0 ; i < nr_segments; i++) + segments[i].nr_threads =0 ; stat_number =0 ; done_secs =0 ; }
os/os-mac.h +0 -6
@@ -27,12 +27,6 @@#define fio_swap32 (x) OSSwapInt32(x)#define fio_swap64 (x) OSSwapInt64(x) -/* -* OSX has a pitifully small shared memory segment by default, -* so default to a lower number of max jobs supported -*/ -#define FIO_MAX_JOBS 128 -#ifndef CONFIG_CLOCKID_T typedef unsigned int clockid_t ;#endif
os/os.h +0 -4
@@ -172,10 +172,6 @@ extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);#endif #endif -#ifndef FIO_MAX_JOBS -#define FIO_MAX_JOBS 4096 -#endif -#ifndef CONFIG_SOCKLEN_T typedef unsigned int socklen_t ;#endif
server.c +1 -1
@@ -950,7 +950,7 @@ static int handle_update_job_cmd(struct fio_net_cmd *cmd)return 0 ; } - td = &threads[tnumber -1 ]; + td =tnumber_to_td (tnumber);convert_thread_options_to_cpu (&td->o, &pdu->top);send_update_job_reply (cmd->tag,0 );return 0 ;