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 <axboe@kernel.dk>
diff --git a/init.c b/init.c
index c344284..f9c20bd 100644
--- a/init.c
+++ b/init.c
@@ -45,7 +45,6 @@
#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 @@
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 @@
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 @@
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 2852ac6..683aab3 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 9a280e5..b46f416 100644
--- a/os/os.h
+++ b/os/os.h
@@ -172,10 +172,6 @@
#endif
#endif
-#ifndef FIO_MAX_JOBS
-#define FIO_MAX_JOBS 4096
-#endif
-
#ifndef CONFIG_SOCKLEN_T
typedef unsigned int socklen_t;
#endif