Recent changes (gfio)

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

 



The following changes since commit 5721d270285a5f7e41b0b076a4a43b825239d964:

  gfio: clear graphs for repeated runs on same connection (2012-09-26 14:11:49 +0200)

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

Jens Axboe (4):
      Fix segfault race on exit for platforms that don't have disk util support
      Merge branch 'master' into gfio
      gfio: add error option group
      Merge branch 'gfio' of ssh://brick.kernel.dk/data/git/fio into gfio

Roger Pau Monne (1):
      netbsd: fix gettid

 backend.c      |    8 ++++++++
 diskutil.c     |   10 +++-------
 diskutil.h     |   13 ++++++++++---
 options.c      |    6 +++---
 options.h      |    2 ++
 os/os-netbsd.h |    7 ++-----
 6 files changed, 28 insertions(+), 18 deletions(-)

---

Diff of recent changes:

diff --git a/backend.c b/backend.c
index 586eac8..3a1df29 100644
--- a/backend.c
+++ b/backend.c
@@ -67,6 +67,7 @@ unsigned int thread_number = 0;
 int shm_id = 0;
 int temp_stall_ts;
 unsigned long done_secs = 0;
+volatile int disk_util_exit = 0;
 
 #define PAGE_ALIGN(buf)	\
 	(char *) (((uintptr_t) (buf) + page_mask) & ~page_mask)
@@ -1621,6 +1622,13 @@ void wait_for_disk_thread_exit(void)
 	fio_mutex_down(disk_thread_mutex);
 }
 
+static void free_disk_util(void)
+{
+	disk_util_start_exit();
+	wait_for_disk_thread_exit();
+	disk_util_prune_entries();
+}
+
 static void *disk_thread_main(void *data)
 {
 	int ret = 0;
diff --git a/diskutil.c b/diskutil.c
index d2c0b97..d98e39a 100644
--- a/diskutil.c
+++ b/diskutil.c
@@ -15,7 +15,6 @@ static int last_majdev, last_mindev;
 static struct disk_util *last_du;
 
 static struct fio_mutex *disk_util_mutex;
-static int disk_util_exit;
 
 FLIST_HEAD(disk_list);
 
@@ -539,16 +538,13 @@ static void aggregate_slaves_stats(struct disk_util *masterdu)
 		agg->max_util.u.f = 100.0;
 }
 
-void free_disk_util(void)
+void disk_util_prune_entries(void)
 {
-	struct disk_util *du;
-
-	disk_util_exit = 1;
-	wait_for_disk_thread_exit();
-
 	fio_mutex_down(disk_util_mutex);
 
 	while (!flist_empty(&disk_list)) {
+		struct disk_util *du;
+
 		du = flist_entry(disk_list.next, struct disk_util, list);
 		flist_del(&du->list);
 		disk_util_free(du);
diff --git a/diskutil.h b/diskutil.h
index b223150..b89aacc 100644
--- a/diskutil.h
+++ b/diskutil.h
@@ -3,6 +3,8 @@
 #include "json.h"
 #define FIO_DU_NAME_SZ		64
 
+extern volatile int disk_util_exit;
+
 /*
  * Disk utils as read in /sys/block/<dev>/stat
  */
@@ -102,20 +104,25 @@ extern void wait_for_disk_thread_exit(void);
 #ifdef FIO_HAVE_DISK_UTIL
 extern void print_disk_util(struct disk_util_stat *, struct disk_util_agg *, int terse);
 extern void show_disk_util(int terse, struct json_object *parent);
-extern void free_disk_util(void);
 extern void init_disk_util(struct thread_data *);
 extern int update_io_ticks(void);
 extern void setup_disk_util(void);
+extern void disk_util_prune_entries(void);
 #else
 #define print_disk_util(dus, agg, terse)
 #define show_disk_util(terse, parent)
-#define free_disk_util()
+#define disk_util_prune_entries()
 #define init_disk_util(td)
 #define setup_disk_util()
 static inline int update_io_ticks(void)
 {
-	return 0;
+	return disk_util_exit;
 }
 #endif
 
+static inline void disk_util_start_exit(void)
+{
+	disk_util_exit = 1;
+}
+
 #endif
diff --git a/options.c b/options.c
index c4ecf02..14a9831 100644
--- a/options.c
+++ b/options.c
@@ -2707,7 +2707,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 		.help	= "Continue on non-fatal errors during IO",
 		.def	= "none",
 		.category = FIO_OPT_C_GENERAL,
-		.group	= FIO_OPT_G_INVALID,
+		.group	= FIO_OPT_G_ERR,
 		.posval = {
 			  { .ival = "none",
 			    .oval = ERROR_TYPE_NONE,
@@ -2750,7 +2750,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 		.help	= "Set a specific list of errors to ignore",
 		.parent	= "rw",
 		.category = FIO_OPT_C_GENERAL,
-		.group	= FIO_OPT_G_INVALID,
+		.group	= FIO_OPT_G_ERR,
 	},
 	{
 		.name	= "error_dump",
@@ -2759,7 +2759,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 		.def	= "0",
 		.help	= "Dump info on each error",
 		.category = FIO_OPT_C_GENERAL,
-		.group	= FIO_OPT_G_INVALID,
+		.group	= FIO_OPT_G_ERR,
 	},
 	{
 		.name	= "profile",
diff --git a/options.h b/options.h
index 786574f..330cc87 100644
--- a/options.h
+++ b/options.h
@@ -87,6 +87,7 @@ enum opt_category_group {
 	__FIO_OPT_G_RANDOM,
 	__FIO_OPT_G_IO_BUF,
 	__FIO_OPT_G_TIOBENCH,
+	__FIO_OPT_G_ERR,
 	__FIO_OPT_G_NR,
 
 	FIO_OPT_G_RATE		= (1U << __FIO_OPT_G_RATE),
@@ -110,6 +111,7 @@ enum opt_category_group {
 	FIO_OPT_G_RANDOM	= (1U << __FIO_OPT_G_RANDOM),
 	FIO_OPT_G_IO_BUF	= (1U << __FIO_OPT_G_IO_BUF),
 	FIO_OPT_G_TIOBENCH	= (1U << __FIO_OPT_G_TIOBENCH),
+	FIO_OPT_G_ERR		= (1U << __FIO_OPT_G_ERR),
 	FIO_OPT_G_INVALID	= (1U << __FIO_OPT_G_NR),
 };
 
diff --git a/os/os-netbsd.h b/os/os-netbsd.h
index aef578e..de687ba 100644
--- a/os/os-netbsd.h
+++ b/os/os-netbsd.h
@@ -4,8 +4,8 @@
 #define	FIO_OS	os_netbsd
 
 #include <errno.h>
+#include <lwp.h>
 #include <sys/param.h>
-#include <sys/thr.h>
 #include <sys/endian.h>
 /* XXX hack to avoid confilcts between rbtree.h and <sys/rb.h> */
 #define	rb_node	_rb_node
@@ -63,10 +63,7 @@ static inline unsigned long long os_phys_mem(void)
 
 static inline int gettid(void)
 {
-	long lwpid;
-
-	thr_self(&lwpid);
-	return (int) lwpid;
+	return (int) _lwp_self();
 }
 
 #ifdef MADV_FREE
--
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