Kill off 'max_jobs' segmented-threads
authorJens Axboe <axboe@kernel.dk>
Fri, 13 Nov 2020 16:17:11 +0000 (09:17 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Nov 2020 16:57:26 +0000 (09:57 -0700)
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 <axboe@kernel.dk>
init.c
os/os-mac.h
os/os.h

diff --git a/init.c b/init.c
index c3442849c0900a89ee1e26260682bb5642384989..f9c20bdb17993e6f5c1003ace756af91d914c47f 100644 (file)
--- 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;
index 2852ac678857cd2ed7225f9d5d73f1d0d54ca2f7..683aab3220a54f4125ebe97327be75b2a2b64d86 100644 (file)
 #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 9a280e541f1b505a45622f7649279650c0c1165c..b46f4164008eb9d63a33f8b668204e77060314dd 100644 (file)
--- 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