From 42eb99528738f7d613e345c2db2eae63555234f7 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 13 Nov 2020 09:17:11 -0700 Subject: [PATCH] Kill off 'max_jobs' We don't really need this anymore - we cap the number of segments separately, and since the chunk size is small enough, this removes the need to have per-OS limits on the thread area size. Signed-off-by: Jens Axboe --- init.c | 17 ++++------------- os/os-mac.h | 6 ------ os/os.h | 4 ---- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/init.c b/init.c index c3442849..f9c20bdb 100644 --- a/init.c +++ b/init.c @@ -45,7 +45,6 @@ const char fio_version_string[] = FIO_VERSION; #define FIO_RANDSEED (0xb1899bedUL) static char **ini_file; -static int max_jobs = FIO_MAX_JOBS; static bool dump_cmdline; static bool parse_only; static bool merge_blktrace_only; @@ -352,8 +351,10 @@ static int add_thread_segment(void) size_t size = JOBS_PER_SEG * sizeof(struct thread_data); int i; - if (nr_segments + 1 >= REAL_MAX_SEG) + if (nr_segments + 1 >= REAL_MAX_SEG) { + log_err("error: maximum number of jobs reached.\n"); return -1; + } size += 2 * sizeof(unsigned int); @@ -494,11 +495,6 @@ static struct thread_data *get_new_job(bool global, struct thread_data *parent, log_err("error: failed to setup shm segment\n"); return NULL; } - if (thread_number >= max_jobs) { - log_err("error: maximum number of jobs (%d) reached.\n", - max_jobs); - return NULL; - } seg = &segments[cur_segment]; td = &seg->threads[seg->nr_threads++]; @@ -2741,12 +2737,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type) warnings_fatal = 1; break; case 'j': - max_jobs = atoi(optarg); - if (!max_jobs || max_jobs > REAL_MAX_JOBS) { - log_err("fio: invalid max jobs: %d\n", max_jobs); - do_exit++; - exit_val = 1; - } + /* we don't track/need this anymore, ignore it */ break; case 'S': did_arg = true; diff --git a/os/os-mac.h b/os/os-mac.h index 2852ac67..683aab32 100644 --- a/os/os-mac.h +++ b/os/os-mac.h @@ -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 diff --git a/os/os.h b/os/os.h index 9a280e54..b46f4164 100644 --- a/os/os.h +++ b/os/os.h @@ -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 -- 2.25.1