Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message May 20, 2016

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit e391c70489d9f63612bce419d7fa0df5d15abf16:

filesetup: align a size given as a percentage to the block size (2016-05-18 15:06:05 -0600)

are available in the git repository at:

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

for you to fetch changes up to 6fa3ad511a61666b492ed8126330db9f876359bc:

iolog: fix duplicate handling of compression end (2016-05-19 15:49:57 -0600)

----------------------------------------------------------------
Jens Axboe (13):
flist: add flist_last_entry()
backend: only do forceful timeout exit if the job isn't actively finishing
backend: mark the thread as finishing, when we are out of the IO loop
backend: dump state of stuck thread
iolog: switch to list based scheme
iolog: don't quiesce on completion
backend: move iolog compression init before CPU affinity settings
iolog: fix missing new-line in inflate debug statement
iolog: memset() zstream at init time
iolog: sum last chunk length to total
iolog: more compression debugging/fixes
iolog: fix bug with ret != Z_STREAM_END
iolog: fix duplicate handling of compression end

 backend.c |  19 ++++++--
 flist.h   |   3 ++
 iolog.c   | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++------------
 iolog.h   |  25 +++++++---
 server.c  | 139 ++++++++++++++++++++++++++++++++++++--------------------
 stat.c    | 137 +++++++++++++++++++++++++++++++++++++------------------
 6 files changed, 342 insertions(+), 135 deletions(-)

---

Diff of recent changes:

backend.c +14 -5
index 7de6f65..f830040 100644
@@ -1472,6 +1472,14 @@ static void *thread_main(void *data)
 	}
 
 	/*
+	 * 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
+	 * any potential CPU affinity
+	 */
+	if (iolog_compress_init(td, sk_out))
+		goto err;
+
+	/*
 	 * If we have a gettimeofday() thread, make sure we exclude that
 	 * thread from this job
 	 */
@@ -1605,9 +1613,6 @@ static void *thread_main(void *data)
 			goto err;
 	}
 
-	if (iolog_compress_init(td, sk_out))
-		goto err;
-
 	fio_verify_init(td);
 
 	if (rate_submit_init(td, sk_out))
@@ -1705,6 +1710,8 @@ static void *thread_main(void *data)
 			break;
 	}
 
+	td_set_runstate(td, TD_FINISHING);
+
 	update_rusage_stat(td);
 	td->ts.total_run_time = mtime_since_now(&td->epoch);
 	td->ts.io_bytes[DDIR_READ] = td->io_bytes[DDIR_READ];
@@ -1813,8 +1820,9 @@ static int fork_main(struct sk_out *sk_out, int shmid, int offset)
 
 static void dump_td_info(struct thread_data *td)
 {
-	log_err("fio: job '%s' hasn't exited in %lu seconds, it appears to "
-		"be stuck. Doing forceful exit of this job.\n", td->o.name,
+	log_err("fio: job '%s' (state=%d) hasn't exited in %lu seconds, it "
+		"appears to be stuck. Doing forceful exit of this job.\n",
+			td->o.name, td->runstate,
 			(unsigned long) time_since_now(&td->terminate_time));
 }
 
@@ -1900,6 +1908,7 @@ static void reap_threads(unsigned int *nr_running, unsigned int *t_rate,
 		 * move on.
 		 */
 		if (td->terminate &&
+		    td->runstate < TD_FSYNCING &&
 		    time_since_now(&td->terminate_time) >= FIO_REAP_TIMEOUT) {
 			dump_td_info(td);
 			td_set_runstate(td, TD_REAPED);
flist.h +3 -0
index d453e79..b4fe6e6 100644
@@ -177,6 +177,9 @@ static inline void flist_splice_init(struct flist_head *list,
 #define flist_first_entry(ptr, type, member) \
 	flist_entry((ptr)->next, type, member)
 
+#define flist_last_entry(ptr, type, member) \
+	flist_entry((ptr)->prev, type, member)
+
 /**
  * flist_for_each	-	iterate over a list
  * @pos:	the &struct flist_head to use as a loop counter.
iolog.c +124 -30

282 lines not on this page · raw message

iolog.h +19 -6
index 739a7c8..2b7813b 100644
@@ -42,6 +42,16 @@ enum {
 };
 
 #define DEF_LOG_ENTRIES		1024
+#define MAX_LOG_ENTRIES		(1024 * DEF_LOG_ENTRIES)
+
+#define LOG_QUIESCE_SZ		(64 * 1024 * 1024)
+
+struct io_logs {
+	struct flist_head list;
+	uint64_t nr_samples;
+	uint64_t max_samples;
+	void *log;
+};
 
 /*
  * Dynamically growing data sample log
@@ -50,9 +60,8 @@ struct io_log {
 	/*
 	 * Entries already logged
 	 */
-	uint64_t nr_samples;
-	uint64_t max_samples;
-	void *log;
+	struct flist_head io_logs;
+	uint32_t cur_log_max;
 
 	unsigned int log_ddir_mask;
 
@@ -65,7 +74,7 @@ struct io_log {
 	/*
 	 * If we fail extending the log, stop collecting more entries.
 	 */
-	unsigned int disabled;
+	bool disabled;
 
 	/*
 	 * Log offsets
@@ -128,10 +137,14 @@ static inline struct io_sample *__get_sample(void *samples, int log_offset,
 	return (struct io_sample *) ((char *) samples + sample_offset);
 }
 
+struct io_logs *iolog_cur_log(struct io_log *);
+uint64_t iolog_nr_samples(struct io_log *);
+
 static inline struct io_sample *get_sample(struct io_log *iolog,
+					   struct io_logs *cur_log,
 					   uint64_t sample)
 {
-	return __get_sample(iolog->log, iolog->log_offset, sample);
+	return __get_sample(cur_log->log, iolog->log_offset, sample);
 }
 
 enum {
@@ -219,7 +232,7 @@ extern void flush_samples(FILE *, void *, uint64_t);
 extern void free_log(struct io_log *);
 extern void fio_writeout_logs(bool);
 extern void td_writeout_logs(struct thread_data *, bool);
-extern int iolog_flush(struct io_log *, int);
+extern int iolog_cur_flush(struct io_log *, struct io_logs *);
 
 static inline void init_ipo(struct io_piece *ipo)
 {
server.c +89 -50

185 lines not on this page · raw message

stat.c +93 -44

159 lines not on this page · raw message