Recent changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 8d5844e9df308cc06d86a83d6bf28a29db46b6a9:

  Make smalloc use anonymous memory mmaps (2011-06-29 09:50:08 +0200)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Jens Axboe (3):
      Fix for terminating threads in ramp time
      Add --max-jobs/-j command line option
      Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio

 README      |    1 +
 eta.c       |    2 +-
 fio.c       |    4 ++--
 fio.h       |    2 +-
 init.c      |   16 +++++++++++++++-
 os/os-mac.h |    6 ++++++
 os/os.h     |    4 ++++
 7 files changed, 30 insertions(+), 5 deletions(-)

---

Diff of recent changes:

diff --git a/README b/README
index ca7f73c..08b4df6 100644
--- a/README
+++ b/README
@@ -145,6 +145,7 @@ $ fio
 				sections can be specified.
 	--alloc-size=kb	Set smalloc pool to this size in kb (def 1024)
 	--warnings-fatal Fio parser warnings are fatal
+	--max-jobs		Maximum number of threads/processes to support
 
 
 Any parameters following the options will be assumed to be job files,
diff --git a/eta.c b/eta.c
index b367ce9..e1cced4 100644
--- a/eta.c
+++ b/eta.c
@@ -7,7 +7,7 @@
 
 #include "fio.h"
 
-static char run_str[MAX_JOBS + 1];
+static char run_str[REAL_MAX_JOBS + 1];
 
 /*
  * Sets the status of the 'td' in the printed status map.
diff --git a/fio.c b/fio.c
index 5ea1a2c..2beda81 100644
--- a/fio.c
+++ b/fio.c
@@ -102,7 +102,7 @@ static void terminate_threads(int group_id)
 			/*
 			 * if the thread is running, just let it exit
 			 */
-			if (td->runstate < TD_RUNNING)
+			if (td->runstate < TD_RAMP)
 				kill(td->pid, SIGTERM);
 			else {
 				struct ioengine_ops *ops = td->io_ops;
@@ -1515,7 +1515,7 @@ static void run_threads(void)
 	set_genesis_time();
 
 	while (todo) {
-		struct thread_data *map[MAX_JOBS];
+		struct thread_data *map[REAL_MAX_JOBS];
 		struct timeval this_start;
 		int this_jobs = 0, left;
 
diff --git a/fio.h b/fio.h
index 16866dd..fc64e3a 100644
--- a/fio.h
+++ b/fio.h
@@ -557,7 +557,7 @@ static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u)
 #define RAND_MAP_IDX(f, b)	(TO_MAP_BLOCK(f, b) / BLOCKS_PER_MAP)
 #define RAND_MAP_BIT(f, b)	(TO_MAP_BLOCK(f, b) & (BLOCKS_PER_MAP - 1))
 
-#define MAX_JOBS	(2048)
+#define REAL_MAX_JOBS		2048
 
 #define td_non_fatal_error(e)	((e) == EIO || (e) == EILSEQ)
 
diff --git a/init.c b/init.c
index d5813c6..baf3130 100644
--- a/init.c
+++ b/init.c
@@ -27,7 +27,7 @@ static char fio_version_string[] = "fio 1.55";
 #define FIO_RANDSEED		(0xb1899bedUL)
 
 static char **ini_file;
-static int max_jobs = MAX_JOBS;
+static int max_jobs = FIO_MAX_JOBS;
 static int dump_cmdline;
 
 static struct thread_data def_thread;
@@ -144,6 +144,11 @@ static struct option l_opts[FIO_NR_OPTIONS] = {
 		.val		= 'w',
 	},
 	{
+		.name		= (char *) "max-jobs",
+		.has_arg	= required_argument,
+		.val		= 'j',
+	},
+	{
 		.name		= NULL,
 	},
 };
@@ -1039,6 +1044,7 @@ static void usage(const char *name)
 	printf("\t--alloc-size=kb\tSet smalloc pool to this size in kb"
 		" (def 1024)\n");
 	printf("\t--warnings-fatal Fio parser warnings are fatal\n");
+	printf("\t--max-jobs\tMaximum number of threads/processes to support\n");
 	printf("\nFio was written by Jens Axboe <jens.axboe@xxxxxxxxxx>");
 	printf("\n                   Jens Axboe <jaxboe@xxxxxxxxxxxx>\n");
 }
@@ -1247,6 +1253,14 @@ static int parse_cmd_line(int argc, char *argv[])
 		case 'w':
 			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;
+			}
+			break;
 		default:
 			do_exit++;
 			exit_val = 1;
diff --git a/os/os-mac.h b/os/os-mac.h
index 42e1fea..7446a43 100644
--- a/os/os-mac.h
+++ b/os/os-mac.h
@@ -25,6 +25,12 @@
 
 #define OS_MAP_ANON		MAP_ANON
 
+/*
+ * 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
+
 typedef off_t off64_t;
 
 /* OS X as of 10.6 doesn't have the timer_* functions. 
diff --git a/os/os.h b/os/os.h
index 1569e40..4bbdd62 100644
--- a/os/os.h
+++ b/os/os.h
@@ -106,6 +106,10 @@ typedef unsigned long os_cpu_mask_t;
 #define FIO_PREFERRED_ENGINE	"sync"
 #endif
 
+#ifndef FIO_MAX_JOBS
+#define FIO_MAX_JOBS		2048
+#endif
+
 #ifndef FIO_HAVE_BLKTRACE
 static inline int is_blktrace(const char *fname)
 {
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux