Recent changes (gfio)

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

 



The following changes since commit 9db01ef976006c002b05fa4e4ec589eb029aac5b:

  Merge branch 'master' into gfio (2013-02-07 15:45:39 +0100)

are available in the git repository at:

  git://git.kernel.dk/fio.git gfio

Aaron Carroll (2):
      configure: attempt to get Android going again
      configure: missing Android config options

Bruce Cran (1):
      Windows: io cancellation often fails and causes crashes, so remove it.

Jens Axboe (9):
      Fix bug with rate and read/write mixed workloads at 100% bias
      Fix rate limiting
      configure: allow --cpu to be specified
      Handle end_fsync if a file is closed
      configure: ensure that fatal errors kill config-host.h and mak files
      Turn f->engine_data into a 64-bit value
      Initialize global and non-static variables
      Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
      Merge branch 'master' into gfio

Nikolaus Jeremic (1):
      Fix replay of IO pattern with multiple open files

 Makefile             |    1 -
 backend.c            |   21 +++++++++++++++++++--
 configure            |   46 ++++++++++++++++++++++++++++++++--------------
 engines/binject.c    |   12 ++++++------
 engines/windowsaio.c |   28 ----------------------------
 file.h               |    2 +-
 gettime-thread.c     |    2 +-
 init.c               |    2 +-
 io_u.c               |    3 ++-
 iolog.c              |    1 +
 lib/getopt_long.c    |    5 +++--
 os/os-android.h      |    1 +
 12 files changed, 67 insertions(+), 57 deletions(-)

---

Diff of recent changes:

diff --git a/Makefile b/Makefile
index aff4fba..8eb2f45 100644
--- a/Makefile
+++ b/Makefile
@@ -94,7 +94,6 @@ ifeq ($(UNAME), Android)
   SOURCE += diskutil.c fifo.c blktrace.c trim.c profiles/tiobench.c
   LIBS += -ldl
   LDFLAGS += -rdynamic
-  CPPFLAGS += -DFIO_NO_HAVE_SHM_H
 endif
 ifeq ($(UNAME), SunOS)
   LIBS	 += -lpthread -ldl -laio -lrt -lnsl -lsocket
diff --git a/backend.c b/backend.c
index 592ea8b..4e8a438 100644
--- a/backend.c
+++ b/backend.c
@@ -322,6 +322,21 @@ requeue:
 	return 0;
 }
 
+static int fio_file_fsync(struct thread_data *td, struct fio_file *f)
+{
+	int ret;
+
+	if (fio_file_open(f))
+		return fio_io_sync(td, f);
+
+	if (td_io_open_file(td, f))
+		return 1;
+
+	ret = fio_io_sync(td, f);
+	td_io_close_file(td, f);
+	return ret;
+}
+
 static inline void __update_tv_cache(struct thread_data *td)
 {
 	fio_gettime(&td->tv_cache, NULL);
@@ -822,9 +837,11 @@ sync_done:
 			td_set_runstate(td, TD_FSYNCING);
 
 			for_each_file(td, f, i) {
-				if (!fio_file_open(f))
+				if (!fio_file_fsync(td, f))
 					continue;
-				fio_io_sync(td, f);
+
+				log_err("fio: end_fsync failed for file %s\n",
+								f->file_name);
 			}
 		}
 	} else
diff --git a/configure b/configure
index 1c8b2bb..71faf91 100755
--- a/configure
+++ b/configure
@@ -29,6 +29,14 @@ config_host_h="config-host.h"
 rm -rf $config_host_mak
 rm -rf $config_host_h
 
+fatal() {
+  echo $@
+  echo "Configure failed, check config.log and/or the above output"
+  rm -rf $config_host_mak
+  rm -rf $config_host_h
+  exit 1
+}
+
 # Default CFLAGS
 CFLAGS="-D_GNU_SOURCE"
 EXTFLAGS="-include config-host.h"
@@ -70,8 +78,7 @@ do_cc() {
     echo "ERROR: configure test passed without -Werror but failed with -Werror."
     echo "This is probably a bug in the configure script. The failing command"
     echo "will be at the bottom of config.log."
-    echo "You can run configure with --disable-werror to bypass this check."
-    exit 1
+    fatal "You can run configure with --disable-werror to bypass this check."
 }
 
 compile_object() {
@@ -91,8 +98,7 @@ feature_not_found() {
   echo "ERROR"
   echo "ERROR: User requested feature $feature"
   echo "ERROR: configure was not able to find it"
-  echo "ERROR"
-  exit 1;
+  fatal "ERROR"
 }
 
 has() {
@@ -131,11 +137,11 @@ gfio="no"
 for opt do
   optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
   case "$opt" in
-  --cc=*)
-    CC="$optarg"
-    ;;
-  --extra-cflags=*)
-  CFLAGS="$CFLAGS $optarg"
+  --cpu=*) cpu="$optarg"
+  ;;
+  --cc=*) CC="$optarg"
+  ;;
+  --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
   ;;
   --build-32bit-win=*) build_32bit_win="$optarg"
   ;;
@@ -153,6 +159,7 @@ for opt do
 done
 
 if test "$show_help" = "yes" ; then
+  echo "--cpu=                 Specify target CPU if auto-detect fails"
   echo "--cc=                  Specify compiler to use"
   echo "--extra-cflags=        Specify extra CFLAGS to pass to compiler"
   echo "--build-32bit-win=     Specify yes for a 32-bit build on Windows"
@@ -160,7 +167,9 @@ if test "$show_help" = "yes" ; then
   exit $exit_val
 fi
 
-if check_define __linux__ ; then
+if check_define __ANDROID__ ; then
+  targetos="Android"
+elif check_define __linux__ ; then
   targetos="Linux"
 elif check_define __OpenBSD__ ; then
   targetos='OpenBSD'
@@ -221,6 +230,17 @@ CYGWIN*)
   echo "CC=$CC" >> $config_host_mak
   echo "EXTFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
   exit 0
+  ;;
+Android)
+  output_sym "CONFIG_32BIT"
+  output_sym "CONFIG_LITTLE_ENDIAN"
+  output_sym "CONFIG_SOCKLEN_T"
+  output_sym "CONFIG_GETTIMEOFDAY"
+  output_sym "CONFIG_CLOCK_GETTIME"
+  output_sym "CONFIG_CLOCK_MONOTONIC"
+  echo "CC=$cc" >> $config_host_mak
+  echo "EXTFLAGS=$CFLAGS -include config-host.h -DFIO_NO_HAVE_SHM_H -D_GNU_SOURCE" >> $config_host_mak
+  exit 0
 esac
 
 if test ! -z "$cpu" ; then
@@ -284,8 +304,7 @@ case "$cpu" in
     cpu="sparc"
   ;;
   *)
-    echo "Unknown CPU"
-    exit 1;
+  echo "Unknown CPU"
   ;;
 esac
 
@@ -950,8 +969,7 @@ if test "$wordsize" = "64" ; then
 elif test "$wordsize" = "32" ; then
   output_sym "CONFIG_32BIT"
 else
-  echo "Unknown wordsize!"
-  exit 1
+  fatal "Unknown wordsize!"
 fi
 if test "$bigendian" = "yes" ; then
   output_sym "CONFIG_BIG_ENDIAN"
diff --git a/engines/binject.c b/engines/binject.c
index 7b8522a..fb19062 100644
--- a/engines/binject.c
+++ b/engines/binject.c
@@ -69,7 +69,7 @@ static unsigned int binject_read_commands(struct thread_data *td, void *p,
 one_more:
 	events = 0;
 	for_each_file(td, f, i) {
-		bf = (struct binject_file *) f->engine_data;
+		bf = (struct binject_file *) (uintptr_t) f->engine_data;
 		ret = read(bf->fd, p, left * sizeof(struct b_user_cmd));
 		if (ret < 0) {
 			if (errno == EAGAIN)
@@ -104,7 +104,7 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min,
 	 * Fill in the file descriptors
 	 */
 	for_each_file(td, f, i) {
-		bf = (struct binject_file *) f->engine_data;
+		bf = (struct binject_file *) (uintptr_t) f->engine_data;
 
 		/*
 		 * don't block for min events == 0
@@ -153,7 +153,7 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min,
 
 	if (!min) {
 		for_each_file(td, f, i) {
-			bf = (struct binject_file *) f->engine_data;
+			bf = (struct binject_file *) (uintptr_t) f->engine_data;
 			fcntl(bf->fd, F_SETFL, bd->fd_flags[i]);
 		}
 	}
@@ -167,7 +167,7 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min,
 static int fio_binject_doio(struct thread_data *td, struct io_u *io_u)
 {
 	struct b_user_cmd *buc = &io_u->buc;
-	struct binject_file *bf = (struct binject_file *) io_u->file->engine_data;
+	struct binject_file *bf = (struct binject_file *) (uintptr_t) io_u->file->engine_data;
 	int ret;
 
 	ret = write(bf->fd, buc, sizeof(*buc));
@@ -181,7 +181,7 @@ static int fio_binject_prep(struct thread_data *td, struct io_u *io_u)
 {
 	struct binject_data *bd = td->io_ops->data;
 	struct b_user_cmd *buc = &io_u->buc;
-	struct binject_file *bf = (struct binject_file *) io_u->file->engine_data;
+	struct binject_file *bf = (struct binject_file *) (uintptr_t) io_u->file->engine_data;
 
 	if (io_u->xfer_buflen & (bf->bs - 1)) {
 		log_err("read/write not sector aligned\n");
@@ -323,7 +323,7 @@ err_unmap:
 
 static int fio_binject_close_file(struct thread_data *td, struct fio_file *f)
 {
-	struct binject_file *bf = (struct binject_file *) f->engine_data;
+	struct binject_file *bf = (struct binject_file *) (uintptr_t) f->engine_data;
 
 	if (bf) {
 		binject_unmap_dev(td, bf);
diff --git a/engines/windowsaio.c b/engines/windowsaio.c
index 3a24fa7..f32c356 100644
--- a/engines/windowsaio.c
+++ b/engines/windowsaio.c
@@ -28,7 +28,6 @@ struct windowsaio_data {
 	HANDLE iocp;
 	HANDLE iothread;
 	HANDLE iocomplete_event;
-	CANCELIOEX pCancelIoEx;
 	BOOL iothread_running;
 };
 
@@ -37,8 +36,6 @@ struct thread_ctx {
 	struct windowsaio_data *wd;
 };
 
-static int fio_windowsaio_cancel(struct thread_data *td,
-				   struct io_u *io_u);
 static BOOL timeout_expired(DWORD start_count, DWORD end_count);
 static int fio_windowsaio_getevents(struct thread_data *td, unsigned int min,
 					unsigned int max, struct timespec *t);
@@ -54,7 +51,6 @@ static int fio_windowsaio_close_file(struct thread_data fio_unused *td, struct f
 static int fio_windowsaio_init(struct thread_data *td)
 {
 	struct windowsaio_data *wd;
-	HANDLE hKernel32Dll;
 	int rc = 0;
 
 	wd = calloc(1, sizeof(struct windowsaio_data));
@@ -89,8 +85,6 @@ static int fio_windowsaio_init(struct thread_data *td)
 		}
 	}
 
-	hKernel32Dll = GetModuleHandle("kernel32.dll");
-	wd->pCancelIoEx = (CANCELIOEX)GetProcAddress(hKernel32Dll, "CancelIoEx");
 	td->io_ops->data = wd;
 
 	if (!rc) {
@@ -402,27 +396,6 @@ static DWORD WINAPI IoCompletionRoutine(LPVOID lpParameter)
 	return 0;
 }
 
-static int fio_windowsaio_cancel(struct thread_data *td,
-				   struct io_u *io_u)
-{
-	int rc = 0;
-
-	struct windowsaio_data *wd = td->io_ops->data;
-
-	/* If we're running on Vista or newer, we can cancel individual IO requests */
-	if (wd->pCancelIoEx != NULL) {
-		struct fio_overlapped *ovl = io_u->engine_data;
-
-		if (!wd->pCancelIoEx(io_u->file->hFile, &ovl->o)) {
-			log_err("windowsaio: failed to cancel io\n");
-			rc = 1;
-		}
-	} else
-		rc = 1;
-
-	return rc;
-}
-
 static void fio_windowsaio_io_u_free(struct thread_data *td, struct io_u *io_u)
 {
 	struct fio_overlapped *o = io_u->engine_data;
@@ -457,7 +430,6 @@ static struct ioengine_ops ioengine = {
 	.version	= FIO_IOOPS_VERSION,
 	.init		= fio_windowsaio_init,
 	.queue		= fio_windowsaio_queue,
-	.cancel		= fio_windowsaio_cancel,
 	.getevents	= fio_windowsaio_getevents,
 	.event		= fio_windowsaio_event,
 	.cleanup	= fio_windowsaio_cleanup,
diff --git a/file.h b/file.h
index 95ecefe..eb0688c 100644
--- a/file.h
+++ b/file.h
@@ -97,7 +97,7 @@ struct fio_file {
 	/*
 	 * For use by the io engine
 	 */
-	uintptr_t engine_data;
+	uint64_t engine_data;
 
 	/*
 	 * if io is protected by a semaphore, this is set
diff --git a/gettime-thread.c b/gettime-thread.c
index c1b4b09..3d49034 100644
--- a/gettime-thread.c
+++ b/gettime-thread.c
@@ -6,7 +6,7 @@
 #include "fio.h"
 #include "smalloc.h"
 
-struct timeval *fio_tv;
+struct timeval *fio_tv = NULL;
 int fio_gtod_offload = 0;
 int fio_gtod_cpu = -1;
 static pthread_t gtod_thread;
diff --git a/init.c b/init.c
index ce699df..8ec1eb9 100644
--- a/init.c
+++ b/init.c
@@ -40,7 +40,7 @@ struct thread_data *threads = NULL;
 
 int exitall_on_terminate = 0;
 int output_format = FIO_OUTPUT_NORMAL;
-int eta_print;
+int eta_print = FIO_ETA_AUTO;
 FILE *f_out = NULL;
 FILE *f_err = NULL;
 char **job_sections = NULL;
diff --git a/io_u.c b/io_u.c
index 6ae3eae..1013c7f 100644
--- a/io_u.c
+++ b/io_u.c
@@ -497,7 +497,7 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
 	 * We have too much pending sleep in this direction. See if we
 	 * should switch.
 	 */
-	if (td_rw(td)) {
+	if (td_rw(td) && td->o.rwmix[odir]) {
 		/*
 		 * Other direction does not have too much pending, switch
 		 */
@@ -545,6 +545,7 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
 
 	if (ddir_trim(ddir))
 		return ddir;
+
 	return ddir;
 }
 
diff --git a/iolog.c b/iolog.c
index e54016d..9bcf0d8 100644
--- a/iolog.c
+++ b/iolog.c
@@ -315,6 +315,7 @@ static int read_iolog2(struct thread_data *td, FILE *f)
 									act);
 				continue;
 			}
+			fileno = get_fileno(td, fname);
 		} else if (r == 2) {
 			rw = DDIR_INVAL;
 			if (!strcmp(act, "add")) {
diff --git a/lib/getopt_long.c b/lib/getopt_long.c
index 70894e3..bdd524b 100644
--- a/lib/getopt_long.c
+++ b/lib/getopt_long.c
@@ -16,8 +16,9 @@
 
 #include "getopt.h"
 
-char *optarg;
-int optind, opterr, optopt;
+char *optarg = NULL;
+int optind = 0, opterr = 0, optopt = 0;
+
 static struct getopt_private_state {
 	const char *optptr;
 	const char *last_optstring;
diff --git a/os/os-android.h b/os/os-android.h
index e436f8f..cedfdaf 100644
--- a/os/os-android.h
+++ b/os/os-android.h
@@ -30,6 +30,7 @@
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_E4_ENG
 #define FIO_HAVE_BYTEORDER_FUNCS
+#define FIO_HAVE_MMAP_HUGE
 
 #define OS_MAP_ANON		MAP_ANONYMOUS
 
--
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