Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Aug 4, 2018

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 17924179519397e49a7a82fd99d860f9ef077645:

Merge branch 'szaydel/solaris-Wincompatible-pointer-types' of https://github.com/szaydel/fio (2018-08-02 16:20:24 -0600)

are available in the git repository at:

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

for you to fetch changes up to 1d73ff2a4a8f02905cf338b2f0286d76d64e7c2a:

iolog: move the chunked items-to-fetch logic into separate function (2018-08-03 14:40:17 -0600)

----------------------------------------------------------------
Adam Kupczyk (4):
iolog: Added option read_iolog_chunked. Used to avoid reading large iologs at once. Allows iologs to be infinite, generated.
iolog: Added new option description to HOWTO platforms/windows: Add S_ISSOCK macro.
iolog: allow to read_iolog from unix socket

Jens Axboe (5):
Merge branch 'windows-s_issock' of https://github.com/aclamk/fio
Merge branch 'read_iolog-from-unix-socket' of https://github.com/aclamk/fio
Merge branch 'chunked-iolog-reading' of https://github.com/aclamk/fio
iolog: fix potential div-by-zero
iolog: move the chunked items-to-fetch logic into separate function

 HOWTO            |   6 +++
 backend.c        |   4 ++
 fio.1            |   5 +++
 fio.h            |   5 +++
 iolog.c          | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 options.c        |  11 +++++
 os/os-windows.h  |   4 ++
 thread_options.h |   1 +
 8 files changed, 147 insertions(+), 11 deletions(-)

---

Diff of recent changes:

HOWTO +6 -0
index 804d93e..16c5ae3 100644
@@ -2327,6 +2327,12 @@ I/O replay
 	replay, the file needs to be turned into a blkparse binary data file first
 	(``blkparse <device> -o /dev/null -d file_for_fio.bin``).
 
+.. option:: read_iolog_chunked=bool
+
+	Determines how iolog is read. If false(default) entire :option:`read_iolog`
+	will be read at once. If selected true, input from iolog will be read
+	gradually. Useful when iolog is very large, or it is generated.
+
 .. option:: replay_no_stall=bool
 
 	When replaying I/O with :option:`read_iolog` the default behavior is to
backend.c +4 -0
index 3c45e78..4b4ecde 100644
@@ -966,8 +966,10 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
 		 * Break if we exceeded the bytes. The exception is time
 		 * based runs, but we still need to break out of the loop
 		 * for those to run verification, if enabled.
+		 * Jobs read from iolog do not use this stop condition.
 		 */
 		if (bytes_issued >= total_bytes &&
+		    !td->o.read_iolog_file &&
 		    (!td->o.time_based ||
 		     (td->o.time_based && td->o.verify != VERIFY_NONE)))
 			break;
@@ -1909,6 +1911,8 @@ err:
 	 */
 	if (o->write_iolog_file)
 		write_iolog_close(td);
+	if (td->io_log_rfile)
+		fclose(td->io_log_rfile);
 
 	td_set_runstate(td, TD_EXITED);
 
fio.1 +5 -0
index a446aba..4386f85 100644
@@ -2057,6 +2057,11 @@ to replay a workload captured by blktrace. See
 replay, the file needs to be turned into a blkparse binary data file first
 (`blkparse <device> \-o /dev/null \-d file_for_fio.bin').
 .TP
+.BI read_iolog_chunked \fR=\fPbool
+Determines how iolog is read. If false (default) entire \fBread_iolog\fR will
+be read at once. If selected true, input from iolog will be read gradually.
+Useful when iolog is very large, or it is generated.
+.TP
 .BI replay_no_stall \fR=\fPbool
 When replaying I/O with \fBread_iolog\fR the default behavior is to
 attempt to respect the timestamps within the log and replay them with the
fio.h +5 -0
index 685aab1..b58057f 100644
@@ -399,6 +399,11 @@ struct thread_data {
 	 * For IO replaying
 	 */
 	struct flist_head io_log_list;
+	FILE *io_log_rfile;
+	unsigned int io_log_current;
+	unsigned int io_log_checkmark;
+	unsigned int io_log_highmark;
+	struct timespec io_log_highmark_time;
 
 	/*
 	 * For tracking/handling discards
iolog.c +111 -11

209 lines not on this page · raw message

options.c +11 -0
index 4b46402..f592027 100644
@@ -3135,6 +3135,17 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 		.group	= FIO_OPT_G_IOLOG,
 	},
 	{
+		.name	= "read_iolog_chunked",
+		.lname	= "Read I/O log in parts",
+		.type	= FIO_OPT_BOOL,
+		.off1	= offsetof(struct thread_options, read_iolog_chunked),
+		.def	= "0",
+		.parent	= "read_iolog",
+		.help	= "Parse IO pattern in chunks",
+		.category = FIO_OPT_C_IO,
+		.group	= FIO_OPT_G_IOLOG,
+	},
+	{
 		.name	= "replay_no_stall",
 		.lname	= "Don't stall on replay",
 		.type	= FIO_OPT_BOOL,
os/os-windows.h +4 -0
index 01f555e..aad446e 100644
@@ -74,6 +74,10 @@ int rand_r(unsigned *);
 /* Winsock doesn't support MSG_WAIT */
 #define OS_MSG_DONTWAIT	0
 
+#ifndef S_ISSOCK
+#define S_ISSOCK(x) 0
+#endif
+
 #define SIGCONT	0
 #define SIGUSR1	1
 #define SIGUSR2 2
thread_options.h +1 -0
index 8adba48..8bbf54b 100644
@@ -247,6 +247,7 @@ struct thread_options {
 	fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
 
 	char *read_iolog_file;
+	bool read_iolog_chunked;
 	char *write_iolog_file;
 
 	unsigned int write_bw_log;