summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-11-13 09:17:11 -0700
committerJens Axboe <axboe@kernel.dk>2020-11-13 09:57:26 -0700
commit42eb99528738f7d613e345c2db2eae63555234f7 (patch)
treec936b647f80435cd79be2ab71f367776bec30f9a
parent2fbe1e195999e23c95b08d03eadac0b5f95330e7 (diff)
downloadfio-segmented-threads.tar.gz
fio-segmented-threads.tar.bz2
Kill off 'max_jobs'segmented-threads
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>
-rw-r--r--init.c17
-rw-r--r--os/os-mac.h6
-rw-r--r--os/os.h4
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