Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Aug 14, 2018 Kbuild

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit fee14ab846ef542d9bb9ebf68f11f0ecb8636f5e:

Merge branch 'minor_fixes' of https://github.com/sitsofe/fio (2018-08-12 15:51:34 -0600)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to dcf6ad384149ee0b3f91c5a8127160cc291f7157:

Merge branch 'fio-man-page' of https://github.com/bvanassche/fio (2018-08-13 21:05:33 -0600)

----------------------------------------------------------------
Bart Van Assche (1):
Improve zone support documentation

Jens Axboe (5):
gclient: bump output time buf size
asprintf: fix indentation
Fix double free of zone cache data
Remove old zone gen from options
Merge branch 'fio-man-page' of https://github.com/bvanassche/fio

 HOWTO            | 18 +++++++++-----
 Makefile         |  2 +-
 backend.c        | 13 +++-------
 fio.1            | 17 +++++++++----
 gclient.c        |  2 +-
 options.c        | 46 +----------------------------------
 oslib/asprintf.c | 38 ++++++++++++++---------------
 zone-dist.c      | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 zone-dist.h      |  7 ++++++
 9 files changed, 131 insertions(+), 86 deletions(-)
 create mode 100644 zone-dist.c
 create mode 100644 zone-dist.h

---

Diff of recent changes:

HOWTO +12 -6
index 4c117c2..1bec806 100644
@@ -952,18 +952,24 @@ Target file/device
 
 	Unlink job files after each iteration or loop.  Default: false.
 
-.. option:: zonesize=int
+.. option:: zonerange=int
 
-	Divide a file into zones of the specified size. See :option:`zoneskip`.
+	Size of a single zone in which I/O occurs. See also :option:`zonesize`
+	and :option:`zoneskip`.
 
-.. option:: zonerange=int
+.. option:: zonesize=int
 
-	Give size of an I/O zone.  See :option:`zoneskip`.
+	Number of bytes to transfer before skipping :option:`zoneskip`
+	bytes. If this parameter is smaller than :option:`zonerange` then only
+	a fraction of each zone with :option:`zonerange` bytes will be
+	accessed.  If this parameter is larger than :option:`zonerange` then
+	each zone will be accessed multiple times before skipping
 
 .. option:: zoneskip=int
 
-	Skip the specified number of bytes when :option:`zonesize` data has been
-	read. The two zone options can be used to only do I/O on zones of a file.
+	Skip the specified number of bytes when :option:`zonesize` data have
+	been transferred. The three zone options can be used to do strided I/O
+	on a file.
 
 
 I/O type
Makefile +1 -1
index 20d3ec1..f9bd787 100644
@@ -50,7 +50,7 @@ SOURCE :=	$(sort $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/crc/*.c)) \
 		gettime-thread.c helpers.c json.c idletime.c td_error.c \
 		profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \
 		workqueue.c rate-submit.c optgroup.c helper_thread.c \
-		steadystate.c
+		steadystate.c zone-dist.c
 
 ifdef CONFIG_LIBHDFS
   HDFSFLAGS= -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -I $(FIO_LIBHDFS_INCLUDE)
backend.c +4 -9
index f6cfbdd..36bde6a 100644
@@ -47,6 +47,7 @@
 #include "rate-submit.h"
 #include "helper_thread.h"
 #include "pshared.h"
+#include "zone-dist.h"
 
 static struct fio_sem *startup_sem;
 static struct flist_head *cgroup_list;
@@ -1592,6 +1593,8 @@ static void *thread_main(void *data)
 		goto err;
 	}
 
+	td_zone_gen_index(td);
+
 	/*
 	 * Do this early, we don't want the compress threads to be limited
 	 * to the same CPUs as the IO workers. So do this before we set
@@ -1907,15 +1910,7 @@ err:
 	close_ioengine(td);
 	cgroup_shutdown(td, cgroup_mnt);
 	verify_free_state(td);
-
-	if (td->zone_state_index) {
-		int i;
-
-		for (i = 0; i < DDIR_RWDIR_CNT; i++)
-			free(td->zone_state_index[i]);
-		free(td->zone_state_index);
-		td->zone_state_index = NULL;
-	}
+	td_zone_free_index(td);
 
 	if (fio_option_is_set(o, cpumask)) {
 		ret = fio_cpuset_exit(&o->cpumask);
fio.1 +12 -5
index 0c604a6..18bf6a2 100644
@@ -724,15 +724,22 @@ false.
 .BI unlink_each_loop \fR=\fPbool
 Unlink job files after each iteration or loop. Default: false.
 .TP
-.BI zonesize \fR=\fPint
-Divide a file into zones of the specified size. See \fBzoneskip\fR.
+Fio supports strided data access. After having read \fBzonesize\fR bytes from an area that is \fBzonerange\fR bytes big, \fBzoneskip\fR bytes are skipped.
 .TP
 .BI zonerange \fR=\fPint
-Give size of an I/O zone. See \fBzoneskip\fR.
+Size of a single zone in which I/O occurs.
+.TP
+.BI zonesize \fR=\fPint
+Number of bytes to transfer before skipping \fBzoneskip\fR bytes. If this
+parameter is smaller than \fBzonerange\fR then only a fraction of each zone
+with \fBzonerange\fR bytes will be accessed.  If this parameter is larger than
+\fBzonerange\fR then each zone will be accessed multiple times before skipping
+to the next zone.
 .TP
 .BI zoneskip \fR=\fPint
-Skip the specified number of bytes when \fBzonesize\fR data has been
-read. The two zone options can be used to only do I/O on zones of a file.
+Skip the specified number of bytes after \fBzonesize\fR bytes of data have been
+transferred.
+
 .SS "I/O type"
 .TP
 .BI direct \fR=\fPbool
gclient.c +1 -1
index 7e5071d..04275a1 100644
@@ -121,7 +121,7 @@ static void gfio_text_op(struct fio_client *client, struct fio_net_cmd *cmd)
 	GtkTreeIter iter;
 	struct tm *tm;
 	time_t sec;
-	char tmp[64], timebuf[80];
+	char tmp[64], timebuf[96];
 
 	sec = p->log_sec;
 	tm = localtime(&sec);
options.c +1 -45

58 lines not on this page · raw message

oslib/asprintf.c +19 -19
index 969479f..ff503c5 100644
@@ -6,38 +6,38 @@
 #ifndef CONFIG_HAVE_VASPRINTF
 int vasprintf(char **strp, const char *fmt, va_list ap)
 {
-    va_list ap_copy;
-    char *str;
-    int len;
+	va_list ap_copy;
+	char *str;
+	int len;
 
 #ifdef va_copy
-    va_copy(ap_copy, ap);
+	va_copy(ap_copy, ap);
 #else
-    __va_copy(ap_copy, ap);
+	__va_copy(ap_copy, ap);
 #endif
-    len = vsnprintf(NULL, 0, fmt, ap_copy);
-    va_end(ap_copy);
+	len = vsnprintf(NULL, 0, fmt, ap_copy);
+	va_end(ap_copy);
 
-    if (len < 0)
-        return len;
+	if (len < 0)
+		return len;
 
-    len++;
-    str = malloc(len);
-    *strp = str;
-    return str ? vsnprintf(str, len, fmt, ap) : -1;
+	len++;
+	str = malloc(len);
+	*strp = str;
+	return str ? vsnprintf(str, len, fmt, ap) : -1;
 }
 #endif
 
 #ifndef CONFIG_HAVE_ASPRINTF
 int asprintf(char **strp, const char *fmt, ...)
 {
-    va_list arg;
-    int done;
+	va_list arg;
+	int done;
 
-    va_start(arg, fmt);
-    done = vasprintf(strp, fmt, arg);
-    va_end(arg);
+	va_start(arg, fmt);
+	done = vasprintf(strp, fmt, arg);
+	va_end(arg);
 
-    return done;
+	return done;
 }
 #endif
zone-dist.c new file +74 -0

74 lines not on this page · raw message

zone-dist.h new file +7 -0
new file mode 100644
index 0000000..c0b2884
@@ -0,0 +1,7 @@
+#ifndef FIO_ZONE_DIST_H
+#define FIO_ZONE_DIST_H
+
+void td_zone_gen_index(struct thread_data *td);
+void td_zone_free_index(struct thread_data *td);
+
+#endif